diff -Nru libbde-20190102/ABOUT-NLS libbde-20240223/ABOUT-NLS --- libbde-20190102/ABOUT-NLS 2013-01-13 14:53:07.000000000 +0000 +++ libbde-20240223/ABOUT-NLS 2023-12-03 08:56:43.000000000 +0000 @@ -1,1282 +1 @@ -1 Notes on the Free Translation Project -*************************************** - -Free software is going international! The Free Translation Project is -a way to get maintainers of free software, translators, and users all -together, so that free software will gradually become able to speak many -languages. A few packages already provide translations for their -messages. - - If you found this `ABOUT-NLS' file inside a distribution, you may -assume that the distributed package does use GNU `gettext' internally, -itself available at your nearest GNU archive site. But you do _not_ -need to install GNU `gettext' prior to configuring, installing or using -this package with messages translated. - - Installers will find here some useful hints. These notes also -explain how users should proceed for getting the programs to use the -available translations. They tell how people wanting to contribute and -work on translations can contact the appropriate team. - -1.1 INSTALL Matters -=================== - -Some packages are "localizable" when properly installed; the programs -they contain can be made to speak your own native language. Most such -packages use GNU `gettext'. Other packages have their own ways to -internationalization, predating GNU `gettext'. - - By default, this package will be installed to allow translation of -messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. Installers may use special -options at configuration time for changing the default behaviour. The -command: - - ./configure --disable-nls - -will _totally_ disable translation of messages. - - When you already have GNU `gettext' installed on your system and run -configure without an option for your new package, `configure' will -probably detect the previously built and installed `libintl' library -and will decide to use it. If not, you may have to to use the -`--with-libintl-prefix' option to tell `configure' where to look for it. - - Internationalized packages usually have many `po/LL.po' files, where -LL gives an ISO 639 two-letter code identifying the language. Unless -translations have been forbidden at `configure' time by using the -`--disable-nls' switch, all available translations are installed -together with the package. However, the environment variable `LINGUAS' -may be set, prior to configuration, to limit the installed set. -`LINGUAS' should then contain a space separated list of two-letter -codes, stating which languages are allowed. - -1.2 Using This Package -====================== - -As a user, if your language has been installed for this package, you -only have to set the `LANG' environment variable to the appropriate -`LL_CC' combination. If you happen to have the `LC_ALL' or some other -`LC_xxx' environment variables set, you should unset them before -setting `LANG', otherwise the setting of `LANG' will not have the -desired effect. Here `LL' is an ISO 639 two-letter language code, and -`CC' is an ISO 3166 two-letter country code. For example, let's -suppose that you speak German and live in Germany. At the shell -prompt, merely execute `setenv LANG de_DE' (in `csh'), -`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). -This can be done from your `.login' or `.profile' file, once and for -all. - - You might think that the country code specification is redundant. -But in fact, some languages have dialects in different countries. For -example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The -country code serves to distinguish the dialects. - - The locale naming convention of `LL_CC', with `LL' denoting the -language and `CC' denoting the country, is the one use on systems based -on GNU libc. On other systems, some variations of this scheme are -used, such as `LL' or `LL_CC.ENCODING'. You can get the list of -locales supported by your system for your language by running the -command `locale -a | grep '^LL''. - - Not all programs have translations for all languages. By default, an -English message is shown in place of a nonexistent translation. If you -understand other languages, you can set up a priority list of languages. -This is done through a different environment variable, called -`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' -for the purpose of message handling, but you still need to have `LANG' -set to the primary language; this is required by other parts of the -system libraries. For example, some Swedish users who would rather -read translations in German than English for when Swedish is not -available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. - - Special advice for Norwegian users: The language code for Norwegian -bokma*l changed from `no' to `nb' recently (in 2003). During the -transition period, while some message catalogs for this language are -installed under `nb' and some older ones under `no', it's recommended -for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and -older translations are used. - - In the `LANGUAGE' environment variable, but not in the `LANG' -environment variable, `LL_CC' combinations can be abbreviated as `LL' -to denote the language's main dialect. For example, `de' is equivalent -to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' -(Portuguese as spoken in Portugal) in this context. - -1.3 Translating Teams -===================== - -For the Free Translation Project to be a success, we need interested -people who like their own language and write it well, and who are also -able to synergize with other translators speaking the same language. -Each translation team has its own mailing list. The up-to-date list of -teams can be found at the Free Translation Project's homepage, -`http://translationproject.org/', in the "Teams" area. - - If you'd like to volunteer to _work_ at translating messages, you -should become a member of the translating team for your own language. -The subscribing address is _not_ the same as the list itself, it has -`-request' appended. For example, speakers of Swedish can send a -message to `sv-request@li.org', having this message body: - - subscribe - - Keep in mind that team members are expected to participate -_actively_ in translations, or at solving translational difficulties, -rather than merely lurking around. If your team does not exist yet and -you want to start one, or if you are unsure about what to do or how to -get started, please write to `coordinator@translationproject.org' to -reach the coordinator for all translator teams. - - The English team is special. It works at improving and uniformizing -the terminology in use. Proven linguistic skills are praised more than -programming skills, here. - -1.4 Available Packages -====================== - -Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of June -2010. The matrix shows, in regard of each package, for which languages -PO files have been submitted to translation coordination, with a -translation percentage of at least 50%. - - Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca - +--------------------------------------------------+ - a2ps | [] [] | - aegis | | - ant-phone | | - anubis | | - aspell | [] [] | - bash | | - bfd | | - bibshelf | [] | - binutils | | - bison | | - bison-runtime | [] | - bluez-pin | [] [] | - bombono-dvd | | - buzztard | | - cflow | | - clisp | | - coreutils | [] [] | - cpio | | - cppi | | - cpplib | [] | - cryptsetup | | - dfarc | | - dialog | [] [] | - dico | | - diffutils | [] | - dink | | - doodle | | - e2fsprogs | [] | - enscript | [] | - exif | | - fetchmail | [] | - findutils | [] | - flex | [] | - freedink | | - gas | | - gawk | [] [] | - gcal | [] | - gcc | | - gettext-examples | [] [] [] [] | - gettext-runtime | [] [] | - gettext-tools | [] [] | - gip | [] | - gjay | | - gliv | [] | - glunarclock | [] [] | - gnubiff | | - gnucash | [] | - gnuedu | | - gnulib | | - gnunet | | - gnunet-gtk | | - gnutls | | - gold | | - gpe-aerial | | - gpe-beam | | - gpe-bluetooth | | - gpe-calendar | | - gpe-clock | [] | - gpe-conf | | - gpe-contacts | | - gpe-edit | | - gpe-filemanager | | - gpe-go | | - gpe-login | | - gpe-ownerinfo | [] | - gpe-package | | - gpe-sketchbook | | - gpe-su | [] | - gpe-taskmanager | [] | - gpe-timesheet | [] | - gpe-today | [] | - gpe-todo | | - gphoto2 | | - gprof | [] | - gpsdrive | | - gramadoir | | - grep | | - grub | [] [] | - gsasl | | - gss | | - gst-plugins-bad | [] | - gst-plugins-base | [] | - gst-plugins-good | [] | - gst-plugins-ugly | [] | - gstreamer | [] [] [] | - gtick | | - gtkam | [] | - gtkorphan | [] | - gtkspell | [] [] [] | - gutenprint | | - hello | [] | - help2man | | - hylafax | | - idutils | | - indent | [] [] | - iso_15924 | | - iso_3166 | [] [] [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | | - iso_639 | [] [] [] [] | - iso_639_3 | | - jwhois | | - kbd | | - keytouch | [] | - keytouch-editor | | - keytouch-keyboa... | [] | - klavaro | [] | - latrine | | - ld | [] | - leafpad | [] [] | - libc | [] [] | - libexif | () | - libextractor | | - libgnutls | | - libgpewidget | | - libgpg-error | | - libgphoto2 | | - libgphoto2_port | | - libgsasl | | - libiconv | [] | - libidn | | - lifelines | | - liferea | [] [] | - lilypond | | - linkdr | [] | - lordsawar | | - lprng | | - lynx | [] | - m4 | | - mailfromd | | - mailutils | | - make | | - man-db | | - man-db-manpages | | - minicom | | - mkisofs | | - myserver | | - nano | [] [] | - opcodes | | - parted | | - pies | | - popt | | - psmisc | | - pspp | [] | - pwdutils | | - radius | [] | - recode | [] [] | - rosegarden | | - rpm | | - rush | | - sarg | | - screem | | - scrollkeeper | [] [] [] | - sed | [] [] | - sharutils | [] [] | - shishi | | - skencil | | - solfege | | - solfege-manual | | - soundtracker | | - sp | | - sysstat | | - tar | [] | - texinfo | | - tin | | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | [] | - vice | | - vmm | | - vorbis-tools | | - wastesedge | | - wdiff | | - wget | [] [] | - wyslij-po | | - xchat | [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] | - +--------------------------------------------------+ - af am an ar as ast az be be@latin bg bn_IN bs ca - 6 0 1 2 3 19 1 10 3 28 3 1 38 - - crh cs da de el en en_GB en_ZA eo es et eu fa - +-------------------------------------------------+ - a2ps | [] [] [] [] [] [] [] | - aegis | [] [] [] | - ant-phone | [] () | - anubis | [] [] | - aspell | [] [] [] [] [] | - bash | [] [] [] | - bfd | [] | - bibshelf | [] [] [] | - binutils | [] | - bison | [] [] | - bison-runtime | [] [] [] [] | - bluez-pin | [] [] [] [] [] [] | - bombono-dvd | [] | - buzztard | [] [] [] | - cflow | [] [] | - clisp | [] [] [] [] | - coreutils | [] [] [] [] | - cpio | | - cppi | | - cpplib | [] [] [] | - cryptsetup | [] | - dfarc | [] [] [] | - dialog | [] [] [] [] [] | - dico | | - diffutils | [] [] [] [] [] [] | - dink | [] [] [] | - doodle | [] | - e2fsprogs | [] [] [] | - enscript | [] [] [] | - exif | () [] [] | - fetchmail | [] [] () [] [] [] | - findutils | [] [] [] | - flex | [] [] | - freedink | [] [] [] | - gas | [] | - gawk | [] [] [] | - gcal | [] | - gcc | [] [] | - gettext-examples | [] [] [] [] | - gettext-runtime | [] [] [] [] | - gettext-tools | [] [] [] | - gip | [] [] [] [] | - gjay | [] | - gliv | [] [] [] | - glunarclock | [] [] | - gnubiff | () | - gnucash | [] () () () () | - gnuedu | [] [] | - gnulib | [] [] | - gnunet | | - gnunet-gtk | [] | - gnutls | [] [] | - gold | [] | - gpe-aerial | [] [] [] [] | - gpe-beam | [] [] [] [] | - gpe-bluetooth | [] [] | - gpe-calendar | [] | - gpe-clock | [] [] [] [] | - gpe-conf | [] [] [] | - gpe-contacts | [] [] [] | - gpe-edit | [] [] | - gpe-filemanager | [] [] [] | - gpe-go | [] [] [] [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] [] [] | - gpe-package | [] [] [] | - gpe-sketchbook | [] [] [] [] | - gpe-su | [] [] [] [] | - gpe-taskmanager | [] [] [] [] | - gpe-timesheet | [] [] [] [] | - gpe-today | [] [] [] [] | - gpe-todo | [] [] [] | - gphoto2 | [] [] () [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] [] | - gramadoir | [] [] [] | - grep | [] | - grub | [] [] | - gsasl | [] | - gss | | - gst-plugins-bad | [] [] [] [] [] | - gst-plugins-base | [] [] [] [] [] | - gst-plugins-good | [] [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] [] [] | - gstreamer | [] [] [] [] [] | - gtick | [] () [] | - gtkam | [] [] () [] [] | - gtkorphan | [] [] [] [] | - gtkspell | [] [] [] [] [] [] [] | - gutenprint | [] [] [] | - hello | [] [] [] [] | - help2man | [] | - hylafax | [] [] | - idutils | [] [] | - indent | [] [] [] [] [] [] [] | - iso_15924 | [] () [] [] | - iso_3166 | [] [] [] [] () [] [] [] () | - iso_3166_2 | () | - iso_4217 | [] [] [] () [] [] | - iso_639 | [] [] [] [] () [] [] | - iso_639_3 | [] | - jwhois | [] | - kbd | [] [] [] [] [] | - keytouch | [] [] | - keytouch-editor | [] [] | - keytouch-keyboa... | [] | - klavaro | [] [] [] [] | - latrine | [] () | - ld | [] [] | - leafpad | [] [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] [] () | - libextractor | | - libgnutls | [] | - libgpewidget | [] [] | - libgpg-error | [] [] | - libgphoto2 | [] () | - libgphoto2_port | [] () [] | - libgsasl | | - libiconv | [] [] [] [] [] | - libidn | [] [] [] | - lifelines | [] () | - liferea | [] [] [] [] [] | - lilypond | [] [] [] | - linkdr | [] [] [] | - lordsawar | [] | - lprng | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailfromd | | - mailutils | [] | - make | [] [] [] | - man-db | | - man-db-manpages | | - minicom | [] [] [] [] | - mkisofs | | - myserver | | - nano | [] [] [] | - opcodes | [] [] | - parted | [] [] | - pies | | - popt | [] [] [] [] [] | - psmisc | [] [] [] | - pspp | [] | - pwdutils | [] | - radius | [] | - recode | [] [] [] [] [] [] | - rosegarden | () () () | - rpm | [] [] [] | - rush | | - sarg | | - screem | | - scrollkeeper | [] [] [] [] [] | - sed | [] [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | | - skencil | [] () [] | - solfege | [] [] [] | - solfege-manual | [] [] | - soundtracker | [] [] [] | - sp | [] | - sysstat | [] [] [] | - tar | [] [] [] [] | - texinfo | [] [] [] | - tin | [] [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | [] [] [] [] | - vice | () () | - vmm | [] | - vorbis-tools | [] [] | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] [] | - wyslij-po | | - xchat | [] [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] [] [] | - +-------------------------------------------------+ - crh cs da de el en en_GB en_ZA eo es et eu fa - 5 64 105 117 18 1 8 0 28 89 18 19 0 - - fi fr ga gl gu he hi hr hu hy id is it ja ka kn - +----------------------------------------------------+ - a2ps | [] [] [] [] | - aegis | [] [] | - ant-phone | [] [] | - anubis | [] [] [] [] | - aspell | [] [] [] [] | - bash | [] [] [] [] | - bfd | [] [] [] | - bibshelf | [] [] [] [] [] | - binutils | [] [] [] | - bison | [] [] [] [] | - bison-runtime | [] [] [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] | - bombono-dvd | [] | - buzztard | [] | - cflow | [] [] [] | - clisp | [] | - coreutils | [] [] [] [] [] | - cpio | [] [] [] [] | - cppi | [] [] | - cpplib | [] [] [] | - cryptsetup | [] [] [] | - dfarc | [] [] [] | - dialog | [] [] [] [] [] [] [] | - dico | | - diffutils | [] [] [] [] [] [] [] [] [] | - dink | [] | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - exif | [] [] [] [] [] [] | - fetchmail | [] [] [] [] | - findutils | [] [] [] [] [] [] | - flex | [] [] [] | - freedink | [] [] [] | - gas | [] [] | - gawk | [] [] [] [] () [] | - gcal | [] | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] | - gettext-tools | [] [] [] [] | - gip | [] [] [] [] [] [] | - gjay | [] | - gliv | [] () | - glunarclock | [] [] [] [] | - gnubiff | () [] () | - gnucash | () () () () () [] | - gnuedu | [] [] | - gnulib | [] [] [] [] [] [] | - gnunet | | - gnunet-gtk | [] | - gnutls | [] [] | - gold | [] [] | - gpe-aerial | [] [] [] | - gpe-beam | [] [] [] [] | - gpe-bluetooth | [] [] [] [] | - gpe-calendar | [] [] | - gpe-clock | [] [] [] [] [] | - gpe-conf | [] [] [] [] | - gpe-contacts | [] [] [] [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] [] [] | - gpe-go | [] [] [] [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] [] [] [] | - gpe-package | [] [] [] | - gpe-sketchbook | [] [] [] [] | - gpe-su | [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] | - gpe-todo | [] [] [] | - gphoto2 | [] [] [] [] [] [] | - gprof | [] [] [] [] | - gpsdrive | [] [] [] | - gramadoir | [] [] [] | - grep | [] [] | - grub | [] [] [] [] | - gsasl | [] [] [] [] [] | - gss | [] [] [] [] [] | - gst-plugins-bad | [] [] [] [] [] [] | - gst-plugins-base | [] [] [] [] [] [] | - gst-plugins-good | [] [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] [] [] | - gstreamer | [] [] [] [] [] | - gtick | [] [] [] [] [] | - gtkam | [] [] [] [] [] | - gtkorphan | [] [] [] | - gtkspell | [] [] [] [] [] [] [] [] [] | - gutenprint | [] [] [] [] | - hello | [] [] [] | - help2man | [] [] | - hylafax | [] | - idutils | [] [] [] [] [] [] | - indent | [] [] [] [] [] [] [] [] | - iso_15924 | [] () [] [] | - iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | - iso_3166_2 | () [] [] [] | - iso_4217 | [] () [] [] [] [] | - iso_639 | [] () [] [] [] [] [] [] [] | - iso_639_3 | () [] [] | - jwhois | [] [] [] [] [] | - kbd | [] [] | - keytouch | [] [] [] [] [] [] | - keytouch-editor | [] [] [] [] [] | - keytouch-keyboa... | [] [] [] [] [] | - klavaro | [] [] | - latrine | [] [] [] | - ld | [] [] [] [] | - leafpad | [] [] [] [] [] [] [] () | - libc | [] [] [] [] [] | - libexif | [] | - libextractor | | - libgnutls | [] [] | - libgpewidget | [] [] [] [] | - libgpg-error | [] [] | - libgphoto2 | [] [] [] | - libgphoto2_port | [] [] [] | - libgsasl | [] [] [] [] [] | - libiconv | [] [] [] [] [] [] | - libidn | [] [] [] [] | - lifelines | () | - liferea | [] [] [] [] | - lilypond | [] [] | - linkdr | [] [] [] [] [] | - lordsawar | | - lprng | [] | - lynx | [] [] [] [] [] | - m4 | [] [] [] [] [] [] | - mailfromd | | - mailutils | [] [] | - make | [] [] [] [] [] [] [] [] [] | - man-db | [] [] | - man-db-manpages | [] | - minicom | [] [] [] [] [] | - mkisofs | [] [] [] [] | - myserver | | - nano | [] [] [] [] [] [] | - opcodes | [] [] [] [] | - parted | [] [] [] [] | - pies | | - popt | [] [] [] [] [] [] [] [] [] | - psmisc | [] [] [] | - pspp | | - pwdutils | [] [] | - radius | [] [] | - recode | [] [] [] [] [] [] [] [] | - rosegarden | () () () () () | - rpm | [] [] | - rush | | - sarg | [] | - screem | [] [] | - scrollkeeper | [] [] [] [] | - sed | [] [] [] [] [] [] [] [] | - sharutils | [] [] [] [] [] [] [] | - shishi | [] | - skencil | [] | - solfege | [] [] [] [] | - solfege-manual | [] [] | - soundtracker | [] [] | - sp | [] () | - sysstat | [] [] [] [] [] | - tar | [] [] [] [] [] [] [] | - texinfo | [] [] [] [] | - tin | [] | - unicode-han-tra... | | - unicode-transla... | [] [] | - util-linux-ng | [] [] [] [] [] [] | - vice | () () () | - vmm | [] | - vorbis-tools | [] | - wastesedge | () () | - wdiff | [] | - wget | [] [] [] [] [] [] [] [] | - wyslij-po | [] [] [] | - xchat | [] [] [] [] [] [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] [] [] | - +----------------------------------------------------+ - fi fr ga gl gu he hi hr hu hy id is it ja ka kn - 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 - - ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne - +-----------------------------------------------+ - a2ps | [] | - aegis | | - ant-phone | | - anubis | [] [] | - aspell | [] | - bash | | - bfd | | - bibshelf | [] [] | - binutils | | - bison | [] | - bison-runtime | [] [] [] [] [] | - bluez-pin | [] [] [] [] [] | - bombono-dvd | | - buzztard | | - cflow | | - clisp | | - coreutils | [] | - cpio | | - cppi | | - cpplib | | - cryptsetup | | - dfarc | [] | - dialog | [] [] [] [] [] | - dico | | - diffutils | [] [] | - dink | | - doodle | | - e2fsprogs | | - enscript | | - exif | [] | - fetchmail | | - findutils | | - flex | | - freedink | [] | - gas | | - gawk | | - gcal | | - gcc | | - gettext-examples | [] [] [] [] | - gettext-runtime | [] | - gettext-tools | [] | - gip | [] [] | - gjay | | - gliv | | - glunarclock | [] | - gnubiff | | - gnucash | () () () () | - gnuedu | | - gnulib | | - gnunet | | - gnunet-gtk | | - gnutls | [] | - gold | | - gpe-aerial | [] | - gpe-beam | [] | - gpe-bluetooth | [] [] | - gpe-calendar | [] | - gpe-clock | [] [] [] [] [] | - gpe-conf | [] [] | - gpe-contacts | [] [] | - gpe-edit | [] | - gpe-filemanager | [] [] | - gpe-go | [] [] [] | - gpe-login | [] | - gpe-ownerinfo | [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] | - gpe-timesheet | [] [] | - gpe-today | [] [] [] [] | - gpe-todo | [] [] | - gphoto2 | | - gprof | [] | - gpsdrive | | - gramadoir | | - grep | | - grub | | - gsasl | | - gss | | - gst-plugins-bad | [] [] [] [] | - gst-plugins-base | [] [] | - gst-plugins-good | [] [] | - gst-plugins-ugly | [] [] [] [] [] | - gstreamer | | - gtick | | - gtkam | [] | - gtkorphan | [] [] | - gtkspell | [] [] [] [] [] [] [] | - gutenprint | | - hello | [] [] [] | - help2man | | - hylafax | | - idutils | | - indent | | - iso_15924 | [] [] | - iso_3166 | [] [] () [] [] [] [] [] | - iso_3166_2 | | - iso_4217 | [] [] | - iso_639 | [] [] | - iso_639_3 | [] | - jwhois | [] | - kbd | | - keytouch | [] | - keytouch-editor | [] | - keytouch-keyboa... | [] | - klavaro | [] | - latrine | [] | - ld | | - leafpad | [] [] [] | - libc | [] | - libexif | | - libextractor | | - libgnutls | [] | - libgpewidget | [] [] | - libgpg-error | | - libgphoto2 | | - libgphoto2_port | | - libgsasl | | - libiconv | | - libidn | | - lifelines | | - liferea | | - lilypond | | - linkdr | | - lordsawar | | - lprng | | - lynx | | - m4 | | - mailfromd | | - mailutils | | - make | [] | - man-db | | - man-db-manpages | | - minicom | [] | - mkisofs | | - myserver | | - nano | [] [] | - opcodes | | - parted | | - pies | | - popt | [] [] [] | - psmisc | | - pspp | | - pwdutils | | - radius | | - recode | | - rosegarden | | - rpm | | - rush | | - sarg | | - screem | | - scrollkeeper | [] [] | - sed | | - sharutils | | - shishi | | - skencil | | - solfege | [] | - solfege-manual | | - soundtracker | | - sp | | - sysstat | [] | - tar | [] | - texinfo | [] | - tin | | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | | - vice | | - vmm | | - vorbis-tools | | - wastesedge | | - wdiff | | - wget | [] | - wyslij-po | | - xchat | [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] | - +-----------------------------------------------+ - ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne - 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 - - nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr - +---------------------------------------------------+ - a2ps | [] [] [] [] [] [] [] [] | - aegis | [] [] [] | - ant-phone | [] [] | - anubis | [] [] [] | - aspell | [] [] [] [] [] | - bash | [] [] | - bfd | [] | - bibshelf | [] [] | - binutils | [] [] | - bison | [] [] [] | - bison-runtime | [] [] [] [] [] [] [] | - bluez-pin | [] [] [] [] [] [] [] [] | - bombono-dvd | [] () | - buzztard | [] [] | - cflow | [] | - clisp | [] [] | - coreutils | [] [] [] [] [] [] | - cpio | [] [] [] | - cppi | [] | - cpplib | [] | - cryptsetup | [] | - dfarc | [] | - dialog | [] [] [] [] | - dico | [] | - diffutils | [] [] [] [] [] [] | - dink | () | - doodle | [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] [] | - exif | [] [] [] () [] | - fetchmail | [] [] [] [] | - findutils | [] [] [] [] [] | - flex | [] [] [] [] [] | - freedink | [] [] | - gas | | - gawk | [] [] [] [] | - gcal | | - gcc | [] | - gettext-examples | [] [] [] [] [] [] [] [] | - gettext-runtime | [] [] [] [] [] [] [] [] [] | - gettext-tools | [] [] [] [] [] [] | - gip | [] [] [] [] [] | - gjay | | - gliv | [] [] [] [] [] [] | - glunarclock | [] [] [] [] [] | - gnubiff | [] () | - gnucash | [] () () () | - gnuedu | [] | - gnulib | [] [] [] [] | - gnunet | | - gnunet-gtk | | - gnutls | [] [] | - gold | | - gpe-aerial | [] [] [] [] [] [] [] | - gpe-beam | [] [] [] [] [] [] [] | - gpe-bluetooth | [] [] | - gpe-calendar | [] [] [] [] | - gpe-clock | [] [] [] [] [] [] [] [] | - gpe-conf | [] [] [] [] [] [] [] | - gpe-contacts | [] [] [] [] [] | - gpe-edit | [] [] [] | - gpe-filemanager | [] [] [] | - gpe-go | [] [] [] [] [] [] [] [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] [] [] [] [] [] [] | - gpe-package | [] [] | - gpe-sketchbook | [] [] [] [] [] [] [] | - gpe-su | [] [] [] [] [] [] [] [] | - gpe-taskmanager | [] [] [] [] [] [] [] [] | - gpe-timesheet | [] [] [] [] [] [] [] [] | - gpe-today | [] [] [] [] [] [] [] [] | - gpe-todo | [] [] [] [] [] | - gphoto2 | [] [] [] [] [] [] [] [] | - gprof | [] [] [] | - gpsdrive | [] [] | - gramadoir | [] [] | - grep | [] [] [] [] | - grub | [] [] [] | - gsasl | [] [] [] [] | - gss | [] [] [] | - gst-plugins-bad | [] [] [] [] [] [] | - gst-plugins-base | [] [] [] [] [] | - gst-plugins-good | [] [] [] [] [] | - gst-plugins-ugly | [] [] [] [] [] [] | - gstreamer | [] [] [] [] [] | - gtick | [] [] [] | - gtkam | [] [] [] [] [] [] | - gtkorphan | [] | - gtkspell | [] [] [] [] [] [] [] [] [] [] | - gutenprint | [] [] | - hello | [] [] [] [] | - help2man | [] [] | - hylafax | [] | - idutils | [] [] [] [] [] | - indent | [] [] [] [] [] [] [] | - iso_15924 | [] [] [] [] | - iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | - iso_3166_2 | [] [] [] | - iso_4217 | [] [] [] [] [] [] [] [] | - iso_639 | [] [] [] [] [] [] [] [] [] | - iso_639_3 | [] [] | - jwhois | [] [] [] [] | - kbd | [] [] [] | - keytouch | [] [] [] | - keytouch-editor | [] [] [] | - keytouch-keyboa... | [] [] [] | - klavaro | [] [] | - latrine | [] [] | - ld | | - leafpad | [] [] [] [] [] [] [] [] [] | - libc | [] [] [] [] | - libexif | [] [] () [] | - libextractor | | - libgnutls | [] [] | - libgpewidget | [] [] [] | - libgpg-error | [] [] | - libgphoto2 | [] [] | - libgphoto2_port | [] [] [] [] [] | - libgsasl | [] [] [] [] [] | - libiconv | [] [] [] [] [] | - libidn | [] [] | - lifelines | [] [] | - liferea | [] [] [] [] [] () () [] | - lilypond | [] | - linkdr | [] [] [] | - lordsawar | | - lprng | [] | - lynx | [] [] [] | - m4 | [] [] [] [] [] | - mailfromd | [] | - mailutils | [] | - make | [] [] [] [] | - man-db | [] [] [] | - man-db-manpages | [] [] [] | - minicom | [] [] [] [] | - mkisofs | [] [] [] | - myserver | | - nano | [] [] [] [] | - opcodes | [] [] | - parted | [] [] [] [] | - pies | [] | - popt | [] [] [] [] | - psmisc | [] [] [] | - pspp | [] [] | - pwdutils | [] | - radius | [] [] [] | - recode | [] [] [] [] [] [] [] [] | - rosegarden | () () | - rpm | [] [] [] | - rush | [] [] | - sarg | | - screem | | - scrollkeeper | [] [] [] [] [] [] [] [] | - sed | [] [] [] [] [] [] [] [] [] | - sharutils | [] [] [] [] | - shishi | [] | - skencil | [] [] | - solfege | [] [] [] [] | - solfege-manual | [] [] [] | - soundtracker | [] | - sp | | - sysstat | [] [] [] [] | - tar | [] [] [] [] | - texinfo | [] [] [] [] | - tin | [] | - unicode-han-tra... | | - unicode-transla... | | - util-linux-ng | [] [] [] [] [] | - vice | [] | - vmm | [] | - vorbis-tools | [] [] | - wastesedge | [] | - wdiff | [] [] | - wget | [] [] [] [] [] [] [] | - wyslij-po | [] [] [] | - xchat | [] [] [] [] [] [] [] [] [] | - xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | - xkeyboard-config | [] [] [] | - +---------------------------------------------------+ - nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr - 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 - - sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW - +---------------------------------------------------+ - a2ps | [] [] [] [] [] | 27 - aegis | [] | 9 - ant-phone | [] [] [] [] | 9 - anubis | [] [] [] [] | 15 - aspell | [] [] [] | 20 - bash | [] [] [] | 12 - bfd | [] | 6 - bibshelf | [] [] [] | 16 - binutils | [] [] | 8 - bison | [] [] | 12 - bison-runtime | [] [] [] [] [] [] | 29 - bluez-pin | [] [] [] [] [] [] [] [] | 37 - bombono-dvd | [] | 4 - buzztard | [] | 7 - cflow | [] [] [] | 9 - clisp | | 10 - coreutils | [] [] [] [] | 22 - cpio | [] [] [] [] [] [] | 13 - cppi | [] [] | 5 - cpplib | [] [] [] [] [] [] | 14 - cryptsetup | [] [] | 7 - dfarc | [] | 9 - dialog | [] [] [] [] [] [] [] | 30 - dico | [] | 2 - diffutils | [] [] [] [] [] [] | 30 - dink | | 4 - doodle | [] [] | 7 - e2fsprogs | [] [] [] | 11 - enscript | [] [] [] [] | 17 - exif | [] [] [] | 16 - fetchmail | [] [] [] | 17 - findutils | [] [] [] [] [] | 20 - flex | [] [] [] [] | 15 - freedink | [] | 10 - gas | [] | 4 - gawk | [] [] [] [] | 18 - gcal | [] [] | 5 - gcc | [] [] [] | 7 - gettext-examples | [] [] [] [] [] [] [] | 34 - gettext-runtime | [] [] [] [] [] [] [] | 29 - gettext-tools | [] [] [] [] [] [] | 22 - gip | [] [] [] [] | 22 - gjay | [] | 3 - gliv | [] [] [] | 14 - glunarclock | [] [] [] [] [] | 19 - gnubiff | [] [] | 4 - gnucash | () [] () [] () | 10 - gnuedu | [] [] | 7 - gnulib | [] [] [] [] | 16 - gnunet | [] | 1 - gnunet-gtk | [] [] [] | 5 - gnutls | [] [] [] | 10 - gold | [] | 4 - gpe-aerial | [] [] [] | 18 - gpe-beam | [] [] [] | 19 - gpe-bluetooth | [] [] [] | 13 - gpe-calendar | [] [] [] [] | 12 - gpe-clock | [] [] [] [] [] | 28 - gpe-conf | [] [] [] [] | 20 - gpe-contacts | [] [] [] | 17 - gpe-edit | [] [] [] | 12 - gpe-filemanager | [] [] [] [] | 16 - gpe-go | [] [] [] [] [] | 25 - gpe-login | [] [] [] | 11 - gpe-ownerinfo | [] [] [] [] [] | 25 - gpe-package | [] [] [] | 13 - gpe-sketchbook | [] [] [] | 20 - gpe-su | [] [] [] [] [] | 30 - gpe-taskmanager | [] [] [] [] [] | 29 - gpe-timesheet | [] [] [] [] [] | 25 - gpe-today | [] [] [] [] [] [] | 30 - gpe-todo | [] [] [] [] | 17 - gphoto2 | [] [] [] [] [] | 24 - gprof | [] [] [] | 15 - gpsdrive | [] [] [] | 11 - gramadoir | [] [] [] | 11 - grep | [] [] [] | 10 - grub | [] [] [] | 14 - gsasl | [] [] [] [] | 14 - gss | [] [] [] | 11 - gst-plugins-bad | [] [] [] [] | 26 - gst-plugins-base | [] [] [] [] [] | 24 - gst-plugins-good | [] [] [] [] | 24 - gst-plugins-ugly | [] [] [] [] [] | 29 - gstreamer | [] [] [] [] | 22 - gtick | [] [] [] | 13 - gtkam | [] [] [] | 20 - gtkorphan | [] [] [] | 14 - gtkspell | [] [] [] [] [] [] [] [] [] | 45 - gutenprint | [] | 10 - hello | [] [] [] [] [] [] | 21 - help2man | [] [] | 7 - hylafax | [] | 5 - idutils | [] [] [] [] | 17 - indent | [] [] [] [] [] [] | 30 - iso_15924 | () [] () [] [] | 16 - iso_3166 | [] [] () [] [] () [] [] [] () | 53 - iso_3166_2 | () [] () [] | 9 - iso_4217 | [] () [] [] () [] [] | 26 - iso_639 | [] [] [] () [] () [] [] [] [] | 38 - iso_639_3 | [] () | 8 - jwhois | [] [] [] [] [] | 16 - kbd | [] [] [] [] [] | 15 - keytouch | [] [] [] | 16 - keytouch-editor | [] [] [] | 14 - keytouch-keyboa... | [] [] [] | 14 - klavaro | [] | 11 - latrine | [] [] [] | 10 - ld | [] [] [] [] | 11 - leafpad | [] [] [] [] [] [] | 33 - libc | [] [] [] [] [] | 21 - libexif | [] () | 7 - libextractor | [] | 1 - libgnutls | [] [] [] | 9 - libgpewidget | [] [] [] | 14 - libgpg-error | [] [] [] | 9 - libgphoto2 | [] [] | 8 - libgphoto2_port | [] [] [] [] | 14 - libgsasl | [] [] [] | 13 - libiconv | [] [] [] [] | 21 - libidn | () [] [] | 11 - lifelines | [] | 4 - liferea | [] [] [] | 21 - lilypond | [] | 7 - linkdr | [] [] [] [] [] | 17 - lordsawar | | 1 - lprng | [] | 3 - lynx | [] [] [] [] | 17 - m4 | [] [] [] [] | 19 - mailfromd | [] [] | 3 - mailutils | [] | 5 - make | [] [] [] [] | 21 - man-db | [] [] [] | 8 - man-db-manpages | | 4 - minicom | [] [] | 16 - mkisofs | [] [] | 9 - myserver | | 0 - nano | [] [] [] [] | 21 - opcodes | [] [] [] | 11 - parted | [] [] [] [] [] | 15 - pies | [] [] | 3 - popt | [] [] [] [] [] [] | 27 - psmisc | [] [] | 11 - pspp | | 4 - pwdutils | [] [] | 6 - radius | [] [] | 9 - recode | [] [] [] [] | 28 - rosegarden | () | 0 - rpm | [] [] [] | 11 - rush | [] [] | 4 - sarg | | 1 - screem | [] | 3 - scrollkeeper | [] [] [] [] [] | 27 - sed | [] [] [] [] [] | 30 - sharutils | [] [] [] [] [] | 22 - shishi | [] | 3 - skencil | [] [] | 7 - solfege | [] [] [] [] | 16 - solfege-manual | [] | 8 - soundtracker | [] [] [] | 9 - sp | [] | 3 - sysstat | [] [] | 15 - tar | [] [] [] [] [] [] | 23 - texinfo | [] [] [] [] [] | 17 - tin | | 4 - unicode-han-tra... | | 0 - unicode-transla... | | 2 - util-linux-ng | [] [] [] [] | 20 - vice | () () | 1 - vmm | [] | 4 - vorbis-tools | [] | 6 - wastesedge | | 2 - wdiff | [] [] | 7 - wget | [] [] [] [] [] | 26 - wyslij-po | [] [] | 8 - xchat | [] [] [] [] [] [] | 36 - xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 - xkeyboard-config | [] [] [] | 22 - +---------------------------------------------------+ - 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW - 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 - - Some counters in the preceding matrix are higher than the number of -visible blocks let us expect. This is because a few extra PO files are -used for implementing regional variants of languages, or language -dialects. - - For a PO file in the matrix above to be effective, the package to -which it applies should also have been internationalized and -distributed as such by its maintainer. There might be an observable -lag between the mere existence a PO file and its wide availability in a -distribution. - - If June 2010 seems to be old, you may fetch a more recent copy of -this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date -matrix with full percentage details can be found at -`http://translationproject.org/extra/matrix.html'. - -1.5 Using `gettext' in new packages -=================================== - -If you are writing a freely available program and want to -internationalize it you are welcome to use GNU `gettext' in your -package. Of course you have to respect the GNU Library General Public -License which covers the use of the GNU `gettext' library. This means -in particular that even non-free programs can use `libintl' as a shared -library, whereas only free software can use `libintl' as a static -library or use modified versions of `libintl'. - - Once the sources are changed appropriately and the setup can handle -the use of `gettext' the only thing missing are the translations. The -Free Translation Project is also available for packages which are not -developed inside the GNU project. Therefore the information given above -applies also for every other Free Software Project. Contact -`coordinator@translationproject.org' to make the `.pot' files available -to the translation teams. - + diff -Nru libbde-20190102/AUTHORS libbde-20240223/AUTHORS --- libbde-20190102/AUTHORS 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/AUTHORS 2024-02-23 02:47:18.000000000 +0000 @@ -1,4 +1,4 @@ Acknowledgements: libbde -Copyright (C) 2011-2019, Joachim Metz +Copyright (C) 2011-2024, Joachim Metz diff -Nru libbde-20190102/COPYING libbde-20240223/COPYING --- libbde-20190102/COPYING 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/COPYING 2024-02-23 02:47:17.000000000 +0000 @@ -1,166 +1,674 @@ - GNU LESSER GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + Preamble - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff -Nru libbde-20190102/COPYING.LESSER libbde-20240223/COPYING.LESSER --- libbde-20190102/COPYING.LESSER 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/COPYING.LESSER 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff -Nru libbde-20190102/ChangeLog libbde-20240223/ChangeLog --- libbde-20190102/ChangeLog 2018-09-19 05:50:24.000000000 +0000 +++ libbde-20240223/ChangeLog 2023-12-03 08:56:43.000000000 +0000 @@ -1,4 +1,9 @@ TODO +* libbde + - move keys into key chain structure + - determine if there is a more reliably way to get volume size without the unencrypted volume header + +* add profiler * sector data create encrypted_data on demand * tread safety - libbde_key_protector functions ? @@ -54,488 +59,8 @@ * what is entry type 0x000b ? * why does Windows hide the last 4096 bytes of the volume? -20161101 -* Worked on tests - -20160119 -* updated setup.py - -20160108 -* updated dependencies - -20160101 -* 2016 update - -20151227 -* updated dependencies - -20151216 -* worked on splitting encryption method and copy -* worked on AES-XTS support - -20150905 -* updated dependencies -* code clean up - -20150723 -* worked on tests - -20150721 -* worked on signature check - -20150720 -* worked on tests - -20150204 -* added correction for volume size being 1 sector short - -20150124 -* applied updates - -20150106 -* 2015 update - -20141226 -* changes for updated dependencies - -20141222 -* worked on Python 3 support -* worked on tests - -20141205 -* worked on test scripts -* worked on thread-safety - -20141130 -* code clean up - -20141120 -* code clean up -* removed libbde_volume_read_random -* fixed pybde open close test -* pybde added get encryption method functionality - -20141028 -* changes for deployment -* bug fix in Python-bindings - -20141023 -* changes for deployment - -20141017 -* changes for deployment - -20141013 -* worked on utility scripts - -20140928 -* removed README.macosx -* changes for project site move -* updated utility scripts -* updates for latest libfdata - -20140731 -* bug fix in Python bindings - -20140728 -* small change in bdemount for Dokan support - -20140727 -* updated dependencies -* updated msvscpp files -* fixes for FreeBSD 8 compilation -* worked on bdemount - -20140629 -* small improvements to error reporting -* compression method is now forced to effective 16-bits - -20140607 -* worked on tests -* updated msvscpp files - -20140531 -* updated dependencies -* worked on Python bindings -* added is locked function - -20140405 -* worked on setup.py - -20140404 -* worked on tests - -20140403 -* worked on exposing metadata -* worked on Python bindings - -20140401 -* worked on exposing metadata -* worked on Python bindings - -20140331 -* worked on exposing metadata - -20140330 -* worked on Python bindings -* worked on tests -* moved password hashes to password keep - -20140112 -* 2014 update -* updated dependencies - -20131211 -* worked on Python bindings -* worked on exposing metadata via bdeinfo -* updated msvscpp files - -20131205 -* updated dependencies - -20130908 -* updated dependencies -* added libcthreads build support -* updated msvscpp files -* bug fixes -* code clean up - -20130729 -* updated dependencies -* pybde fixes for >2G file objects in BFIO glue code - -20130716 -* worked on git support -* updated dependencies - -20130703 -* fixed some typos - -20130624 -* fix for dealing with padding in FVE metadata block - -20130422 -* updated dependencies -* updated pybde -* fix in dpkg files for python binding - -20130412 -* updated README files -* updated dependencies -* added tests directory - -20130331 -* updated dependencies -* code clean up -* pybde update - -20130310 -* updated dependencies -* added Package Maker files - -20130113 -* 2013 update -* update dependencies -* updated msvscpp files -* updated pybde - -20121123 -* pybde: code clean up - -20121110 -* worked on Python-bindings (pybde) - -20121109 -* worked on set keys - -20121108 -* updated dependencies -* worked on set keys - -20120915 -* added -X option to bdemount to pass sub system options -* updated bdemount man page - -20120912 -* updated dependecies -* changes for libcdata update - -20120807 -* updated dependecies - -20120721 -* added libcsplit -* updated dependecies -* updated msvscpp files -* switched library order in tools -* fixed issue in spec file - -20120520 -* libfdata update -* code clean up in bdetools - -20120518 -* updates for Windows 8 BDE volume - -20120511 -* fixes for dpkg files - -20120510 -* small changes -* worked on msvscpp files - -20120509 -* updated dependecies -* added bdemount destroy function -* remove + 1 from volume size calculation, does not add up for - volume-only storage media - -20120310 -* updated libnotify, libsystem - -20120225 -* fix for libfuse in spec file - -20120208 -* fix in dpkg/rules for include files - -20120116 -* 2012 update - -20111218 -* updated libcstring, libsystem, libfdata, libfvalue -* added libfcache - -20111124 -* updated libfdata - -20111118 -* code clean up - -20111117 -* code clean up -* updated libcstring, libsystem, libfdatetime, libfvalue, libhmac, libfguid, - libfdata - -20111102 -* updated m4 files -* updated libcstring, libsystem, libuna, libbfio, libfdatetime, libfvalue, - libhmac - -20111022 -* updated libfdatetime - -20111020 -* updated README.static -* combined recovery and user password iteration code - -20111012 -* update for Cygwin static executable support -* update for libfuse detection - -20111011 -* implemented OSXFuse support - -20111009 -* updated pc and spec file -* changes to libcaes for WINAPI build -* added password support - -20111008 -* updated common -* updated libhmac, libsystem, libuna, libfdatetime -* updated msvscpp files - -20111007 -* updated configure.ac and m4 files - -20111003 -* worked on libcaes - -20111002 -* updated configure -* added geteuid and getegid check - -20110925 -* updated msvscpp files -* fixes for WINAPI build - -20110921 -* preparations for release -* updated libbfio - added support for device file size -* updated libhmac - -20110918 -* preparations for release - -20110830 -* worked on support for startup key - -20110829 -* worked on support for startup key -* updated configure - -20110828 -* updated libbfio - -20110826 -* worked on support for partial encrypted volumes - -20110825 -* worked on clear key support -* worked on support for partial encrypted volumes - -20110824 -* worked on Vista support - -20110823 -* updated libbfio, libfvalue - -20110822 -* remove seek end volume size detection to rely on metadata -* small changes to configure for fuse - -20110821 -* worked on handling metadata blocks - - fix for BitLocker To Go -* fix for openssl EVP -* updated libhmac -* code clean up -* added codepage -* bdemount now daemonizes -* improved libfuse detection by configure -* worked on manuals -* open now distinguishes between failure and invalid keys -* the library no longer stores the binary recovery key but its SHA256 hash -* worked on password support -* updated msvscpp build files -* worked on WINAPI build - -20110819 -* worked on handling metadata blocks - -20110818 -* updated libbfio -* code clean up -* added msvscpp build files -* worked on WINAPI build - -20110817 -* worked on fuse mount - -20110816 -* updated libbfio -* worked on fuse mount - -20110812 -* worked on fuse mount - -20110811 -* worked on libbfio file range IO handle for bdemount -* libbfio code clean up -* added info handle - -20110810 -* worked on encryption functions - -20110807 -* worked on AES functions - -20110806 -* updated libhmac - bug fixes for Solaris -* updated libsystem, libfvalue, -* created work around for openssl EVP issues - - currently ignoring the output of Final function -* cleaned up some TODOs - -20110805 -* worked on reading sector data -* worked on BitLocker ToGo support - -20110804 -* worked on reading sector data - -20110803 -* added recovery password option to bdeinfo -* worked on reading sector data -* worked on AES functions -* added metadata entry type and value type debug functions -* worked on FVEK support -* worked on diffuser - -20110801 -* configure clean up -* updated libhmac -* worked on reading sector data -* worked on AES functions - -20110722 -* added bytes per sector support in volume header -* added microseconds to filetime output -* created metadata structure to store header and entries - -20110721 -* worked on encryption -* worked on sector vector and cache - -20110720 -* worked on encryption - -20110719 -* worked on encryption - -20110718 -* changes for: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body -* updated libsystem, libuna, libbfio, libfvalue, libhmac, libfdata, - libfdatetime, libfguid - -20110715 -* worked on initial version - -20110627 -* added libhmac -* updated configure.ac to support libhmac -* replaced libbde_sha.[ch] by libhmac - -20110624 -* worked on SHA256 functions - -20110623 -* worked on AES functions -* worked on SHA256 functions - -20110622 -* worked on AES functions - -20110620 -* worked on AES functions - -20110619 -* worked on initial version - -20110612 -* worked on initial version - -20110610 -* worked on initial version - -20110604 -* worked on initial version - -20110601 -* worked on storing metadata runtime - -20110531 -* worked on encryption - - recovery password support -* added SHA256 detection to configure - -20110530 -* added libfvalue -* worked on encryption - - recovery password support - 20110529 +* see `git log' for more recent change log * renamed to library to libbde * updated configure.ac * updated common, libcstring, liberror, libnotify, libsystem, libbfio, libuna diff -Nru libbde-20190102/INSTALL libbde-20240223/INSTALL --- libbde-20190102/INSTALL 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/INSTALL 2024-02-23 03:03:50.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* - Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software -Foundation, Inc. + Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free +Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -225,7 +225,7 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX 'make' updates targets which have the same time stamps as their + HP-UX 'make' updates targets which have the same timestamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. diff -Nru libbde-20190102/Makefile.am libbde-20240223/Makefile.am --- libbde-20190102/Makefile.am 2017-04-22 10:11:27.000000000 +0000 +++ libbde-20240223/Makefile.am 2023-12-04 16:58:09.000000000 +0000 @@ -14,7 +14,6 @@ libcpath \ libbfio \ libfcache \ - libfdata \ libfdatetime \ libfguid \ libfvalue \ @@ -23,11 +22,10 @@ libbde \ bdetools \ pybde \ - pybde-python2 \ - pybde-python3 \ po \ manuals \ tests \ + ossfuzz \ msvscpp DPKG_FILES = \ @@ -39,7 +37,6 @@ dpkg/rules \ dpkg/libbde.install \ dpkg/libbde-dev.install \ - dpkg/libbde-python.install \ dpkg/libbde-python3.install \ dpkg/libbde-tools.install \ dpkg/source/format @@ -52,6 +49,9 @@ libbde.pc.in SETUP_PY_FILES = \ + pyproject.toml \ + setup.cfg \ + setup.cfg.in \ setup.py SPEC_FILES = \ @@ -91,7 +91,6 @@ (cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libbfio && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfcache && $(MAKE) $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfdatetime && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfguid && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfvalue && $(MAKE) $(AM_MAKEFLAGS)) @@ -101,38 +100,14 @@ (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) distclean: clean - /bin/rm -f Makefile - /bin/rm -f config.status - /bin/rm -f config.cache - /bin/rm -f config.log - /bin/rm -f libbde.pc - /bin/rm -f libbde.spec + -rm -f Makefile + -rm -f config.status + -rm -f config.cache + -rm -f config.log + -rm -f libbde.pc + -rm -f libbde.spec @for dir in ${subdirs}; do \ (cd $$dir && $(MAKE) distclean) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" -splint: - (cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcthreads && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcdata && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcnotify && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcsplit && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libuna && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcfile && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcpath && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libbfio && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfcache && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfdata && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfdatetime && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfguid && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfvalue && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libhmac && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcaes && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libbde && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/bdetools && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/pybde && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/po && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS)) - diff -Nru libbde-20190102/Makefile.in libbde-20240223/Makefile.in --- libbde-20190102/Makefile.in 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -121,7 +121,7 @@ CONFIG_HEADER = $(top_builddir)/common/config.h CONFIG_CLEAN_FILES = include/libbde/definitions.h \ include/libbde/features.h include/libbde/types.h \ - dpkg/changelog libbde.pc libbde.spec + dpkg/changelog libbde.pc libbde.spec setup.cfg CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -187,6 +187,7 @@ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -204,17 +205,16 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libbde.pc.in \ - $(srcdir)/libbde.spec.in $(top_srcdir)/dpkg/changelog.in \ + $(srcdir)/libbde.spec.in $(srcdir)/setup.cfg.in \ + $(top_srcdir)/dpkg/changelog.in \ $(top_srcdir)/include/libbde/definitions.h.in \ $(top_srcdir)/include/libbde/features.h.in \ $(top_srcdir)/include/libbde/types.h.in ABOUT-NLS AUTHORS \ - COPYING ChangeLog INSTALL NEWS README compile config.guess \ - config.rpath config.sub install-sh ltmain.sh missing + COPYING COPYING.LESSER ChangeLog INSTALL NEWS README compile \ + config.guess config.rpath config.sub install-sh ltmain.sh \ + missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -253,6 +253,8 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -271,6 +273,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -282,8 +290,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -301,7 +311,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -319,7 +328,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -373,8 +381,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -393,6 +399,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -403,8 +410,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -427,26 +434,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -455,7 +442,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -474,6 +460,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -516,9 +503,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -587,8 +571,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -611,11 +593,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -639,7 +618,6 @@ libcpath \ libbfio \ libfcache \ - libfdata \ libfdatetime \ libfguid \ libfvalue \ @@ -648,11 +626,10 @@ libbde \ bdetools \ pybde \ - pybde-python2 \ - pybde-python3 \ po \ manuals \ tests \ + ossfuzz \ msvscpp DPKG_FILES = \ @@ -664,7 +641,6 @@ dpkg/rules \ dpkg/libbde.install \ dpkg/libbde-dev.install \ - dpkg/libbde-python.install \ dpkg/libbde-python3.install \ dpkg/libbde-tools.install \ dpkg/source/format @@ -677,6 +653,9 @@ libbde.pc.in SETUP_PY_FILES = \ + pyproject.toml \ + setup.cfg \ + setup.cfg.in \ setup.py SPEC_FILES = \ @@ -745,6 +724,8 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ libbde.spec: $(top_builddir)/config.status $(srcdir)/libbde.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ +setup.cfg: $(top_builddir)/config.status $(srcdir)/setup.cfg.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo @@ -809,6 +790,8 @@ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -881,7 +864,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -965,6 +947,10 @@ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -1007,6 +993,8 @@ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -1022,7 +1010,7 @@ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -1177,6 +1165,14 @@ ps-am: +sources: sources-recursive + +sources-am: sources-local + +splint: splint-recursive + +splint-am: splint-local + uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip @@ -1185,18 +1181,19 @@ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgconfigDATA install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-pkgconfigDATA + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-libtool distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile @@ -1219,7 +1216,6 @@ (cd $(srcdir)/libcpath && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libbfio && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfcache && $(MAKE) $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfdatetime && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfguid && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libfvalue && $(MAKE) $(AM_MAKEFLAGS)) @@ -1229,41 +1225,17 @@ (cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS)) distclean: clean - /bin/rm -f Makefile - /bin/rm -f config.status - /bin/rm -f config.cache - /bin/rm -f config.log - /bin/rm -f libbde.pc - /bin/rm -f libbde.spec + -rm -f Makefile + -rm -f config.status + -rm -f config.cache + -rm -f config.log + -rm -f libbde.pc + -rm -f libbde.spec @for dir in ${subdirs}; do \ (cd $$dir && $(MAKE) distclean) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" -splint: - (cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcthreads && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcdata && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcnotify && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcsplit && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libuna && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcfile && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcpath && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libbfio && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfcache && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfdata && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfdatetime && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfguid && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libfvalue && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libhmac && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcaes && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/libbde && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/bdetools && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/pybde && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/po && $(MAKE) splint $(AM_MAKEFLAGS)) - (cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS)) - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru libbde-20190102/README libbde-20240223/README --- libbde-20190102/README 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/README 2024-02-23 02:48:06.000000000 +0000 @@ -28,6 +28,10 @@ * start-up key * FKEV and/or TWEAK key data +Unsupported BDE formats: + +* Bitlocker Used Disk Space Only encryption + Unsupported protection methods: * Trusted Platform Module (TPM) diff -Nru libbde-20190102/acinclude.m4 libbde-20240223/acinclude.m4 --- libbde-20190102/acinclude.m4 2018-12-25 12:27:10.000000000 +0000 +++ libbde-20240223/acinclude.m4 2024-02-23 02:48:35.000000000 +0000 @@ -1,33 +1,11 @@ dnl Checks for required headers and functions dnl -dnl Version: 20181224 +dnl Version: 20230209 dnl Function to detect if libbde dependencies are available AC_DEFUN([AX_LIBBDE_CHECK_LOCAL], [dnl Check for internationalization functions in libbde/libbde_i18n.c AC_CHECK_FUNCS([bindtextdomain]) - - dnl Check if library should be build with verbose output - AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT - - dnl Check if library should be build with debug output - AX_COMMON_CHECK_ENABLE_DEBUG_OUTPUT - - dnl Check if DLL support is needed - AS_IF( - [test "x$enable_shared" = xyes], - [AS_CASE( - [$host], - [*cygwin* | *mingw*], - [AC_DEFINE( - [HAVE_DLLMAIN], - [1], - [Define to 1 to enable the DllMain function.]) - AC_SUBST( - [HAVE_DLLMAIN], - [1]) - ]) - ]) ]) dnl Function to detect if bdetools dependencies are available @@ -43,30 +21,47 @@ [1]) ]) - dnl Headers included in bdetools/bdemount.c - AC_CHECK_HEADERS([errno.h]) - - AC_HEADER_TIME + dnl Headers and functions included in bdetools/bdetools_input.c + AC_CHECK_HEADERS([termios.h]) - dnl Functions included in bdetools/bdemount.c AS_IF( [test "x$ac_cv_enable_winapi" = xno], - [AC_CHECK_FUNCS([clock_gettime getegid geteuid time]) + [AC_CHECK_FUNCS([getchar tcgetattr tcsetattr]) ]) - dnl Check if tools should be build as static executables - AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES + dnl Headers included in bdetools/bdemount.c + AC_CHECK_HEADERS([errno.h sys/time.h]) - dnl Check if DLL support is needed + dnl Functions included in bdetools/mount_file_system.c and bdetools/mount_file_entry.c AS_IF( + [test "x$ac_cv_enable_winapi" = xno], + [AC_CHECK_FUNCS([clock_gettime getegid geteuid time]) + ]) +]) + +dnl Function to check if DLL support is needed +AC_DEFUN([AX_LIBBDE_CHECK_DLL_SUPPORT], + [AS_IF( [test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno], [AS_CASE( [$host], - [*cygwin* | *mingw*], - [AC_SUBST( + [*cygwin* | *mingw* | *msys*], + [AC_DEFINE( + [HAVE_DLLMAIN], + [1], + [Define to 1 to enable the DllMain function.]) + AC_SUBST( + [HAVE_DLLMAIN], + [1]) + + AC_SUBST( + [LIBBDE_DLL_EXPORT], + ["-DLIBBDE_DLL_EXPORT"]) + + AC_SUBST( [LIBBDE_DLL_IMPORT], ["-DLIBBDE_DLL_IMPORT"]) + ]) ]) ]) -]) diff -Nru libbde-20190102/aclocal.m4 libbde-20240223/aclocal.m4 --- libbde-20190102/aclocal.m4 2019-01-02 15:57:47.000000000 +0000 +++ libbde-20240223/aclocal.m4 2024-02-23 03:03:47.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,14 +14,14 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 11 (pkg-config-0.29.1) +# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson @@ -63,7 +63,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -108,7 +108,7 @@ dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place +dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], @@ -164,7 +164,7 @@ AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -174,17 +174,17 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - m4_default([$4], [AC_MSG_ERROR( + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -195,8 +195,8 @@ _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -206,10 +206,10 @@ To get pkg-config, see .])[]dnl ]) else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - $3 + $3 fi[]dnl ])dnl PKG_CHECK_MODULES @@ -364,7 +364,7 @@ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -379,7 +379,7 @@ [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -395,14 +395,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -454,7 +454,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -485,7 +485,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -676,7 +676,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -715,7 +715,9 @@ done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -740,9 +742,26 @@ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) +# AM_EXTRA_RECURSIVE_TARGETS -*- Autoconf -*- + +# Copyright (C) 2012-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_EXTRA_RECURSIVE_TARGETS +# -------------------------- +# Define the list of user recursive targets. This macro exists only to +# be traced by Automake, which will ensure that a proper definition of +# user-defined recursive targets (and associated rules) is propagated +# into all the generated Makefiles. +# TODO: We should really reject non-literal arguments here... +AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], []) + # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -770,6 +789,10 @@ # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -806,7 +829,7 @@ [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -858,6 +881,20 @@ [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -939,7 +976,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -960,7 +997,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -981,7 +1018,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1024,7 +1061,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1045,12 +1082,7 @@ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -1061,41 +1093,9 @@ fi ]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check for 'mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl FIXME we are no longer going to remove this! adjust warning -dnl FIXME message accordingly. -AC_DIAGNOSE([obsolete], -[$0: this macro is deprecated, and will soon be removed. -You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead, -and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.]) -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1124,7 +1124,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1171,7 +1171,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1190,7 +1190,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1271,7 +1271,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1331,7 +1331,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1359,7 +1359,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1378,7 +1378,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1511,6 +1511,7 @@ m4_include([m4/common.m4]) m4_include([m4/gettext.m4]) +m4_include([m4/host-cpu-c-abi.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intlmacosx.m4]) m4_include([m4/lib-ld.m4]) @@ -1528,7 +1529,6 @@ m4_include([m4/libcsplit.m4]) m4_include([m4/libcthreads.m4]) m4_include([m4/libfcache.m4]) -m4_include([m4/libfdata.m4]) m4_include([m4/libfdatetime.m4]) m4_include([m4/libfguid.m4]) m4_include([m4/libfuse.m4]) diff -Nru libbde-20190102/bdetools/Makefile.am libbde-20240223/bdetools/Makefile.am --- libbde-20190102/bdetools/Makefile.am 2018-12-27 19:52:03.000000000 +0000 +++ libbde-20240223/bdetools/Makefile.am 2023-12-03 08:57:23.000000000 +0000 @@ -11,7 +11,6 @@ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ - @LIBFDATA_CPPFLAGS@ \ @LIBFDATETIME_CPPFLAGS@ \ @LIBFGUID_CPPFLAGS@ \ @LIBFUSE_CPPFLAGS@ \ @@ -24,9 +23,11 @@ bdemount bdeinfo_SOURCES = \ + byte_size_string.c byte_size_string.h \ bdeinfo.c \ bdetools_getopt.c bdetools_getopt.h \ bdetools_i18n.h \ + bdetools_input.c bdetools_input.h \ bdetools_libbde.h \ bdetools_libcerror.h \ bdetools_libclocale.h \ @@ -59,6 +60,7 @@ bdemount.c \ bdetools_getopt.c bdetools_getopt.h \ bdetools_i18n.h \ + bdetools_input.c bdetools_input.h \ bdetools_libbfio.h \ bdetools_libbde.h \ bdetools_libcdata.h \ @@ -94,9 +96,9 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +splint-local: @echo "Running splint on bdeinfo ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(bdeinfo_SOURCES) @echo "Running splint on bdemount ..." diff -Nru libbde-20190102/bdetools/Makefile.in libbde-20240223/bdetools/Makefile.in --- libbde-20190102/bdetools/Makefile.in 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/bdetools/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -92,16 +92,16 @@ subdir = bdetools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -121,7 +121,8 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am_bdeinfo_OBJECTS = bdeinfo.$(OBJEXT) bdetools_getopt.$(OBJEXT) \ +am_bdeinfo_OBJECTS = byte_size_string.$(OBJEXT) bdeinfo.$(OBJEXT) \ + bdetools_getopt.$(OBJEXT) bdetools_input.$(OBJEXT) \ bdetools_output.$(OBJEXT) bdetools_signal.$(OBJEXT) \ info_handle.$(OBJEXT) bdeinfo_OBJECTS = $(am_bdeinfo_OBJECTS) @@ -131,10 +132,10 @@ am__v_lt_0 = --silent am__v_lt_1 = am_bdemount_OBJECTS = bdemount.$(OBJEXT) bdetools_getopt.$(OBJEXT) \ - bdetools_output.$(OBJEXT) bdetools_signal.$(OBJEXT) \ - mount_dokan.$(OBJEXT) mount_file_entry.$(OBJEXT) \ - mount_file_system.$(OBJEXT) mount_fuse.$(OBJEXT) \ - mount_handle.$(OBJEXT) + bdetools_input.$(OBJEXT) bdetools_output.$(OBJEXT) \ + bdetools_signal.$(OBJEXT) mount_dokan.$(OBJEXT) \ + mount_file_entry.$(OBJEXT) mount_file_system.$(OBJEXT) \ + mount_fuse.$(OBJEXT) mount_handle.$(OBJEXT) bdemount_OBJECTS = $(am_bdemount_OBJECTS) bdemount_DEPENDENCIES = ../libbde/libbde.la AM_V_P = $(am__v_P_@AM_V@) @@ -153,8 +154,9 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/bdeinfo.Po ./$(DEPDIR)/bdemount.Po \ - ./$(DEPDIR)/bdetools_getopt.Po ./$(DEPDIR)/bdetools_output.Po \ - ./$(DEPDIR)/bdetools_signal.Po ./$(DEPDIR)/info_handle.Po \ + ./$(DEPDIR)/bdetools_getopt.Po ./$(DEPDIR)/bdetools_input.Po \ + ./$(DEPDIR)/bdetools_output.Po ./$(DEPDIR)/bdetools_signal.Po \ + ./$(DEPDIR)/byte_size_string.Po ./$(DEPDIR)/info_handle.Po \ ./$(DEPDIR)/mount_dokan.Po ./$(DEPDIR)/mount_file_entry.Po \ ./$(DEPDIR)/mount_file_system.Po ./$(DEPDIR)/mount_fuse.Po \ ./$(DEPDIR)/mount_handle.Po @@ -184,6 +186,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -201,8 +204,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -219,6 +220,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -230,8 +237,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -249,7 +258,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -267,7 +275,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -321,8 +328,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -341,6 +346,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -351,8 +357,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -375,26 +381,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -403,7 +389,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -422,6 +407,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -464,9 +450,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -535,8 +518,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -559,11 +540,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -585,7 +563,6 @@ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ - @LIBFDATA_CPPFLAGS@ \ @LIBFDATETIME_CPPFLAGS@ \ @LIBFGUID_CPPFLAGS@ \ @LIBFUSE_CPPFLAGS@ \ @@ -593,9 +570,11 @@ AM_LDFLAGS = @STATIC_LDFLAGS@ bdeinfo_SOURCES = \ + byte_size_string.c byte_size_string.h \ bdeinfo.c \ bdetools_getopt.c bdetools_getopt.h \ bdetools_i18n.h \ + bdetools_input.c bdetools_input.h \ bdetools_libbde.h \ bdetools_libcerror.h \ bdetools_libclocale.h \ @@ -628,6 +607,7 @@ bdemount.c \ bdetools_getopt.c bdetools_getopt.h \ bdetools_i18n.h \ + bdetools_input.c bdetools_input.h \ bdetools_libbfio.h \ bdetools_libbde.h \ bdetools_libcdata.h \ @@ -762,8 +742,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdeinfo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdemount.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdetools_getopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdetools_input.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdetools_output.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bdetools_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byte_size_string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_dokan.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_file_entry.Po@am__quote@ # am--include-marker @@ -803,6 +785,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -855,7 +839,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -978,8 +961,10 @@ -rm -f ./$(DEPDIR)/bdeinfo.Po -rm -f ./$(DEPDIR)/bdemount.Po -rm -f ./$(DEPDIR)/bdetools_getopt.Po + -rm -f ./$(DEPDIR)/bdetools_input.Po -rm -f ./$(DEPDIR)/bdetools_output.Po -rm -f ./$(DEPDIR)/bdetools_signal.Po + -rm -f ./$(DEPDIR)/byte_size_string.Po -rm -f ./$(DEPDIR)/info_handle.Po -rm -f ./$(DEPDIR)/mount_dokan.Po -rm -f ./$(DEPDIR)/mount_file_entry.Po @@ -1002,6 +987,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip @@ -1018,15 +1011,16 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +splint-local: @echo "Running splint on bdeinfo ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(bdeinfo_SOURCES) @echo "Running splint on bdemount ..." diff -Nru libbde-20190102/bdetools/bdeinfo.c libbde-20240223/bdetools/bdeinfo.c --- libbde-20190102/bdetools/bdeinfo.c 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/bdetools/bdeinfo.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Shows information obtained from a BitLocker Drive Encrypted (BDE) volume * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -60,7 +60,7 @@ " Encrypted (BDE) volume\n\n" ); fprintf( stream, "Usage: bdeinfo [ -k keys ] [ -o offset ] [ -p password ]\n" - " [ -r password ] [ -s filename ] [ -hvV ] source\n\n" ); + " [ -r password ] [ -s filename ] [ -huvV ] source\n\n" ); fprintf( stream, "\tsource: the source file or device\n\n" ); @@ -73,6 +73,7 @@ fprintf( stream, "\t-r: specify the recovery password\n" ); fprintf( stream, "\t-s: specify the file containing the startup key.\n" "\t typically this file has the extension .BEK\n" ); + fprintf( stream, "\t-u: unattended mode (disables user interaction)\n" ); fprintf( stream, "\t-v: verbose output to stderr\n" ); fprintf( stream, "\t-V: print version\n" ); } @@ -83,7 +84,7 @@ bdetools_signal_t signal BDETOOLS_ATTRIBUTE_UNUSED ) { libcerror_error_t *error = NULL; - static char *function = "bdeinfo_signal_handler"; + static char *function = "bdeinfo_signal_handler"; BDETOOLS_UNREFERENCED_PARAMETER( signal ) @@ -129,17 +130,18 @@ int main( int argc, char * const argv[] ) #endif { - libbde_error_t *error = NULL; - system_character_t *option_keys = NULL; - system_character_t *option_password = NULL; - system_character_t *option_recovery_password = NULL; - system_character_t *option_startup_key_filename = NULL; - system_character_t *option_volume_offset = NULL; - system_character_t *source = NULL; - char *program = "bdeinfo"; - system_integer_t option = 0; - int result = 0; - int verbose = 0; + libbde_error_t *error = NULL; + system_character_t *option_keys = NULL; + system_character_t *option_password = NULL; + system_character_t *option_recovery_password = NULL; + system_character_t *option_startup_key_path = NULL; + system_character_t *option_volume_offset = NULL; + system_character_t *source = NULL; + char *program = "bdeinfo"; + system_integer_t option = 0; + int result = 0; + int unattended_mode = 0; + int verbose = 0; libcnotify_stream_set( stderr, @@ -174,7 +176,7 @@ while( ( option = bdetools_getopt( argc, argv, - _SYSTEM_STRING( "hk:o:p:r:s:vV" ) ) ) != (system_integer_t) -1 ) + _SYSTEM_STRING( "hk:o:p:r:s:uvV" ) ) ) != (system_integer_t) -1 ) { switch( option ) { @@ -217,7 +219,12 @@ break; case (system_integer_t) 's': - option_startup_key_filename = optarg; + option_startup_key_path = optarg; + + break; + + case (system_integer_t) 'u': + unattended_mode = 1; break; @@ -256,6 +263,7 @@ if( info_handle_initialize( &bdeinfo_info_handle, + unattended_mode, &error ) != 1 ) { fprintf( @@ -306,16 +314,16 @@ goto on_error; } } - if( option_startup_key_filename != NULL ) + if( option_startup_key_path != NULL ) { - if( info_handle_read_startup_key( + if( info_handle_set_startup_key( bdeinfo_info_handle, - option_startup_key_filename, + option_startup_key_path, &error ) != 1 ) { fprintf( stderr, - "Unable to read startup key.\n" ); + "Unable to set startup key.\n" ); goto on_error; } @@ -334,7 +342,7 @@ goto on_error; } } - result = info_handle_open_input( + result = info_handle_open( bdeinfo_info_handle, source, &error ); @@ -358,19 +366,7 @@ goto on_error; } - result = info_handle_input_is_locked( - bdeinfo_info_handle, - &error ); - - if( result != 0 ) - { - fprintf( - stderr, - "Unable to unlock volume.\n" ); - - goto on_error; - } - if( info_handle_close_input( + if( info_handle_close( bdeinfo_info_handle, &error ) != 0 ) { diff -Nru libbde-20190102/bdetools/bdemount.c libbde-20240223/bdetools/bdemount.c --- libbde-20190102/bdetools/bdemount.c 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/bdemount.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mounts a BitLocker Drive Encrypted (BDE) volume * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -68,19 +68,20 @@ fprintf( stream, "Usage: bdemount [ -k keys ] [ -o offset ] [ -p password ]\n" " [ -r recovery_password ] [ -s startup_key_path ]\n" - " [ -X extended_options ] [ -hvV ] volume mount_point\n\n" ); + " [ -X extended_options ] [ -huvV ] volume mount_point\n\n" ); fprintf( stream, "\tvolume: a BitLocker Drive Encrypted (BDE) volume\n\n" ); fprintf( stream, "\tmount_point: the directory to serve as mount point\n\n" ); fprintf( stream, "\t-h: shows this help\n" ); - fprintf( stream, "\t-k: the full volume encryption key and tweak key formatted in base16 and\n" - "\t separated by a : character e.g. FVEK:TWEAK\n" ); + fprintf( stream, "\t-k: specify the full volume encryption key and tweak key formatted in\n" + "\t base16 and separated by a : character e.g. FVEK:TWEAK\n" ); fprintf( stream, "\t-o: specify the volume offset in bytes\n" ); fprintf( stream, "\t-p: specify the password/passphrase\n" ); fprintf( stream, "\t-r: specify the recovery password/passphrase\n" ); fprintf( stream, "\t-s: specify the path of the file containing the startup key. Typically\n" "\t this file has the extension .BEK\n" ); + fprintf( stream, "\t-u: unattended mode (disables user interaction)\n" ); fprintf( stream, "\t-v: verbose output to stderr, while bdemount will remain running in the\n" "\t foreground\n" ); fprintf( stream, "\t-V: print version\n" ); @@ -153,6 +154,7 @@ system_integer_t option = 0; size_t path_prefix_size = 0; int result = 0; + int unattended_mode = 0; int verbose = 0; #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) @@ -200,7 +202,7 @@ while( ( option = bdetools_getopt( argc, argv, - _SYSTEM_STRING( "hk:o:p:r:s:vVX:" ) ) ) != (system_integer_t) -1 ) + _SYSTEM_STRING( "hk:o:p:r:s:uvVX:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { @@ -247,6 +249,11 @@ break; + case (system_integer_t) 'u': + unattended_mode = 1; + + break; + case (system_integer_t) 'v': verbose = 1; @@ -300,6 +307,7 @@ if( mount_handle_initialize( &bdemount_mount_handle, + unattended_mode, &error ) != 1 ) { fprintf( @@ -689,7 +697,8 @@ "No sub system to mount BDE format.\n" ); return( EXIT_FAILURE ); -#endif + +#endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBOSXFUSE ) */ on_error: if( error != NULL ) diff -Nru libbde-20190102/bdetools/bdetools_getopt.c libbde-20240223/bdetools/bdetools_getopt.c --- libbde-20190102/bdetools/bdetools_getopt.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_getopt.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * GetOpt functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/bdetools/bdetools_getopt.h libbde-20240223/bdetools/bdetools_getopt.h --- libbde-20190102/bdetools/bdetools_getopt.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_getopt.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * GetOpt functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_GETOPT_H ) diff -Nru libbde-20190102/bdetools/bdetools_i18n.h libbde-20240223/bdetools/bdetools_i18n.h --- libbde-20190102/bdetools/bdetools_i18n.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_i18n.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Internationalization (i18n) functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_I18N_H ) diff -Nru libbde-20190102/bdetools/bdetools_input.c libbde-20240223/bdetools/bdetools_input.c --- libbde-20190102/bdetools/bdetools_input.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_input.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,285 @@ +/* + * Common input functions for the bdetools + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_TERMIOS_H ) +#include +#endif + +#if defined( HAVE_UNISTD_H ) +#include +#endif + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bdetools_libcerror.h" +#include "bdetools_input.h" + +/* Prompts the user for a password + * Returns 1 if successful or -1 on error + */ +int bdetools_prompt_for_password( + FILE *stream, + const system_character_t *request_string, + system_character_t *password, + size_t password_size, + libcerror_error_t **error ) +{ +#if !defined( WINAPI ) + struct termios echo_off_termios; + struct termios original_termios; +#endif + + static char *function = "bdetools_prompt_for_password"; + system_character_t character = 0; + size_t password_index = 0; + int result = 1; + +#if defined( WINAPI ) + DWORD echo_off_mode = 0; + HANDLE input_handle = INVALID_HANDLE_VALUE; + DWORD original_mode = 0; +#endif + + if( request_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid request string.", + function ); + + return( -1 ); + } + if( password == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid password.", + function ); + + return( -1 ); + } + if( ( password_size < 32 ) + || ( password_size > (size_t) SSIZE_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid password size value out of bounds.", + function ); + + return( -1 ); + } +#if defined( WINAPI ) + input_handle = GetStdHandle( + STD_INPUT_HANDLE ); + + if( input_handle == INVALID_HANDLE_VALUE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve input handle.", + function ); + + return( -1 ); + } + if( GetConsoleMode( + input_handle, + &original_mode ) == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve original console mode.", + function ); + + return( -1 ); + } +#else + if( tcgetattr( + STDIN_FILENO, + &original_termios ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve terminal IO settings.", + function ); + + return( -1 ); + } + if( memory_copy( + &echo_off_termios, + &original_termios, + sizeof( struct termios ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy terminal IO settings.", + function ); + + return( -1 ); + } +#endif /* defined( WINAPI ) */ + + fprintf( + stream, + "%" PRIs_SYSTEM ": ", + request_string ); + +#if defined( WINAPI ) + echo_off_mode = original_mode & ~( ENABLE_ECHO_INPUT ); + + if( SetConsoleMode( + input_handle, + echo_off_mode ) == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set echo-off console mode.", + function ); + + return( -1 ); + } +#else + echo_off_termios.c_lflag &= ~( ECHO | ICANON ); + + if( tcsetattr( + STDIN_FILENO, + TCSADRAIN, + &echo_off_termios ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set echo-off terminal IO settings.", + function ); + + return( -1 ); + } +#endif /* defined( WINAPI ) */ + + while( password_index < password_size ) + { +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) + character = (system_character_t) getchar(); +#elif defined( WINAPI ) + character = (system_character_t) _getwch(); +#else + character = (system_character_t) getwchar(); +#endif +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( character == (system_character_t) EOF ) +#else + if( character == (system_character_t) WEOF ) +#endif + { + break; + } + if( ( character == (system_character_t) '\n' ) + || ( character == (system_character_t) '\r' ) + || ( character == (system_character_t) 0 ) ) + { + break; + } + /* Handle backspace + */ + if( character == (system_character_t) 0x08 ) + { + if( password_index > 0 ) + { + password_index--; + } + } + else + { + password[ password_index++ ] = (system_character_t) character; + } + } + if( password_index >= password_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid password size value too small.", + function ); + + result = -1; + } + else + { + password[ password_index ] = (system_character_t) 0; + } +#if defined( WINAPI ) + if( SetConsoleMode( + input_handle, + echo_off_mode ) == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set original console mode.", + function ); + + return( -1 ); + } +#else + if( tcsetattr( + STDIN_FILENO, + TCSADRAIN, + &original_termios ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set original terminal IO settings.", + function ); + + return( -1 ); + } +#endif /* defined( WINAPI ) */ + + return( result ); +} + diff -Nru libbde-20190102/bdetools/bdetools_input.h libbde-20240223/bdetools/bdetools_input.h --- libbde-20190102/bdetools/bdetools_input.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_input.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * Common input functions for the bdetools + * + * Copyright (C) 2011-2024, Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _BDETOOLS_INPUT_H ) +#define _BDETOOLS_INPUT_H + +#include +#include +#include + +#include "bdetools_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int bdetools_prompt_for_password( + FILE *stream, + const system_character_t *request_string, + system_character_t *password, + size_t password_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _BDETOOLS_INPUT_H ) */ + diff -Nru libbde-20190102/bdetools/bdetools_libbde.h libbde-20240223/bdetools/bdetools_libbde.h --- libbde-20190102/bdetools/bdetools_libbde.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libbde.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libbde header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBBDE_H ) diff -Nru libbde-20190102/bdetools/bdetools_libbfio.h libbde-20240223/bdetools/bdetools_libbfio.h --- libbde-20190102/bdetools/bdetools_libbfio.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libbfio.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBBFIO_H ) diff -Nru libbde-20190102/bdetools/bdetools_libcdata.h libbde-20240223/bdetools/bdetools_libcdata.h --- libbde-20190102/bdetools/bdetools_libcdata.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libcdata.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcdata header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBCDATA_H ) diff -Nru libbde-20190102/bdetools/bdetools_libcerror.h libbde-20240223/bdetools/bdetools_libcerror.h --- libbde-20190102/bdetools/bdetools_libcerror.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libcerror.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBCERROR_H ) diff -Nru libbde-20190102/bdetools/bdetools_libclocale.h libbde-20240223/bdetools/bdetools_libclocale.h --- libbde-20190102/bdetools/bdetools_libclocale.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libclocale.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libclocale header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBCLOCALE_H ) diff -Nru libbde-20190102/bdetools/bdetools_libcnotify.h libbde-20240223/bdetools/bdetools_libcnotify.h --- libbde-20190102/bdetools/bdetools_libcnotify.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libcnotify.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcnotify header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBCNOTIFY_H ) diff -Nru libbde-20190102/bdetools/bdetools_libcpath.h libbde-20240223/bdetools/bdetools_libcpath.h --- libbde-20190102/bdetools/bdetools_libcpath.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libcpath.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcpath header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBCPATH_H ) diff -Nru libbde-20190102/bdetools/bdetools_libcsplit.h libbde-20240223/bdetools/bdetools_libcsplit.h --- libbde-20190102/bdetools/bdetools_libcsplit.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libcsplit.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcsplit header * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBCSPLIT_H ) diff -Nru libbde-20190102/bdetools/bdetools_libfdatetime.h libbde-20240223/bdetools/bdetools_libfdatetime.h --- libbde-20190102/bdetools/bdetools_libfdatetime.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libfdatetime.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfdatetime header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBFDATETIME_H ) diff -Nru libbde-20190102/bdetools/bdetools_libfguid.h libbde-20240223/bdetools/bdetools_libfguid.h --- libbde-20190102/bdetools/bdetools_libfguid.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libfguid.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfguid header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBFGUID_H ) diff -Nru libbde-20190102/bdetools/bdetools_libuna.h libbde-20240223/bdetools/bdetools_libuna.h --- libbde-20190102/bdetools/bdetools_libuna.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_libuna.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_LIBUNA_H ) diff -Nru libbde-20190102/bdetools/bdetools_output.c libbde-20240223/bdetools/bdetools_output.c --- libbde-20190102/bdetools/bdetools_output.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_output.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Common output functions for the bdetools * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -105,7 +105,7 @@ */ fprintf( stream, - _( "Copyright (C) 2011-2019, %s.\n" ), + _( "Copyright (C) 2011-2024, %s.\n" ), _( "Joachim Metz" ) ); fprintf( diff -Nru libbde-20190102/bdetools/bdetools_output.h libbde-20240223/bdetools/bdetools_output.h --- libbde-20190102/bdetools/bdetools_output.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_output.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Common output functions for the bdetools * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_OUTPUT_H ) diff -Nru libbde-20190102/bdetools/bdetools_signal.c libbde-20240223/bdetools/bdetools_signal.c --- libbde-20190102/bdetools/bdetools_signal.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_signal.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Signal handling functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -40,7 +40,7 @@ /* Signal handler for Ctrl+C or Ctrl+Break signals */ BOOL WINAPI bdetools_signal_handler( - unsigned long signal ) + bdetools_signal_t signal ) { static char *function = "bdetools_signal_handler"; @@ -112,7 +112,7 @@ bdetools_signal_signal_handler = signal_handler; if( SetConsoleCtrlHandler( - bdetools_signal_handler, + (PHANDLER_ROUTINE) bdetools_signal_handler, TRUE ) == 0 ) { libcerror_error_set( @@ -179,7 +179,7 @@ static char *function = "bdetools_signal_detach"; if( SetConsoleCtrlHandler( - bdetools_signal_handler, + (PHANDLER_ROUTINE) bdetools_signal_handler, FALSE ) == 0 ) { libcerror_error_set( diff -Nru libbde-20190102/bdetools/bdetools_signal.h libbde-20240223/bdetools/bdetools_signal.h --- libbde-20190102/bdetools/bdetools_signal.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_signal.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Signal handling functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_SIGNAL_H ) diff -Nru libbde-20190102/bdetools/bdetools_unused.h libbde-20240223/bdetools/bdetools_unused.h --- libbde-20190102/bdetools/bdetools_unused.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/bdetools_unused.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDETOOLS_UNUSED_H ) diff -Nru libbde-20190102/bdetools/byte_size_string.c libbde-20240223/bdetools/byte_size_string.c --- libbde-20190102/bdetools/byte_size_string.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/bdetools/byte_size_string.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,490 @@ +/* + * Byte size string functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#include "bdetools_libcerror.h" +#include "bdetools_libclocale.h" +#include "bdetools_libcnotify.h" +#include "byte_size_string.h" + +/* Creates a human readable byte size string + * Returns 1 if successful or -1 on error + */ +int byte_size_string_create( + system_character_t *byte_size_string, + size_t byte_size_string_length, + uint64_t size, + int units, + libcerror_error_t **error ) +{ + static char *function = "byte_size_string_create"; + int decimal_point = 0; + + if( libclocale_locale_get_decimal_point( + &decimal_point, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve locale decimal point.", + function ); + + return( -1 ); + } + if( byte_size_string_create_with_decimal_point( + byte_size_string, + byte_size_string_length, + size, + units, + decimal_point, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to create byte size string.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Creates a human readable byte size string + * Returns 1 if successful or -1 on error + */ +int byte_size_string_create_with_decimal_point( + system_character_t *byte_size_string, + size_t byte_size_string_length, + uint64_t size, + int units, + int decimal_point, + libcerror_error_t **error ) +{ + const system_character_t *factor_string = NULL; + const system_character_t *units_string = NULL; + static char *function = "byte_size_string_create_with_decimal_point"; + ssize_t print_count = 0; + uint64_t factored_size = 0; + uint64_t last_factored_size = 0; + int8_t factor = 0; + int8_t remainder = -1; + + if( byte_size_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte size string.", + function ); + + return( -1 ); + } + /* Minimum of 4 digits and separator, space, 3 letter unit, end of string + */ + if( byte_size_string_length < 9 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte size string too small.", + function ); + + return( -1 ); + } + if( ( size < 1024 ) + || ( units == BYTE_SIZE_STRING_UNIT_MEGABYTE ) ) + { + units_string = _SYSTEM_STRING( "B" ); + } + else if( units == BYTE_SIZE_STRING_UNIT_MEBIBYTE ) + { + units_string = _SYSTEM_STRING( "iB" ); + } + factored_size = size; + + if( factored_size >= (uint64_t) units ) + { + while( factored_size >= (uint64_t) units ) + { + last_factored_size = factored_size; + factored_size /= units; + + factor++; + } + if( factored_size < 10 ) + { + last_factored_size %= units; + remainder = (int8_t) ( last_factored_size / 100 ); + } + } + switch( factor ) + { + case 0: + factor_string = _SYSTEM_STRING( "" ); + break; + + case 1: + factor_string = _SYSTEM_STRING( "K" ); + break; + + case 2: + factor_string = _SYSTEM_STRING( "M" ); + break; + + case 3: + factor_string = _SYSTEM_STRING( "G" ); + break; + + case 4: + factor_string = _SYSTEM_STRING( "T" ); + break; + + case 5: + factor_string = _SYSTEM_STRING( "P" ); + break; + + case 6: + factor_string = _SYSTEM_STRING( "E" ); + break; + + case 7: + factor_string = _SYSTEM_STRING( "Z" ); + break; + + case 8: + factor_string = _SYSTEM_STRING( "Y" ); + break; + + default: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported size factor.", + function ); + + return( -1 ); + } + if( remainder > 9 ) + { + remainder = 9; + } + if( remainder >= 0 ) + { + print_count = system_string_sprintf( + byte_size_string, + byte_size_string_length, + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu64 ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIc_SYSTEM ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu8 ) + _SYSTEM_STRING( " %" ) _SYSTEM_STRING( PRIs_SYSTEM ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIs_SYSTEM ), + factored_size, + (system_character_t) decimal_point, + remainder, + factor_string, + units_string ); + } + else + { + print_count = system_string_sprintf( + byte_size_string, + byte_size_string_length, + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu64 ) + _SYSTEM_STRING( " %" ) _SYSTEM_STRING( PRIs_SYSTEM ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIs_SYSTEM ), + factored_size, + factor_string, + units_string ); + } + if( ( print_count < 0 ) + || ( (size_t) print_count > byte_size_string_length ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set byte size string.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Converts a human readable byte size string into a value + * Returns 1 if successful or -1 on error + */ +int byte_size_string_convert( + const system_character_t *byte_size_string, + size_t byte_size_string_length, + uint64_t *size, + libcerror_error_t **error ) +{ + static char *function = "byte_size_string_convert"; + int decimal_point = 0; + + if( libclocale_locale_get_decimal_point( + &decimal_point, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve locale decimal point.", + function ); + + return( -1 ); + } + if( byte_size_string_convert_with_decimal_point( + byte_size_string, + byte_size_string_length, + decimal_point, + size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve byte size from string.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Converts a human readable byte size string into a value + * Returns 1 if successful or -1 on error + */ +int byte_size_string_convert_with_decimal_point( + const system_character_t *byte_size_string, + size_t byte_size_string_length, + int decimal_point, + uint64_t *size, + libcerror_error_t **error ) +{ + static char *function = "byte_size_string_convert_with_decimal_point"; + size_t byte_size_string_iterator = 0; + uint64_t byte_size = 0; + int8_t factor = 0; + int8_t remainder = -1; + int units = 0; + + if( byte_size_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte size string.", + function ); + + return( -1 ); + } + if( size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid size.", + function ); + + return( -1 ); + } + while( byte_size_string_iterator < byte_size_string_length ) + { + if( ( byte_size_string[ byte_size_string_iterator ] < (system_character_t) '0' ) + || ( byte_size_string[ byte_size_string_iterator ] > (system_character_t) '9' ) ) + { + break; + } + byte_size *= 10; + byte_size += ( byte_size_string[ byte_size_string_iterator ] - (system_character_t) '0' ); + + byte_size_string_iterator++; + } + if( byte_size_string[ byte_size_string_iterator ] == (system_character_t) decimal_point ) + { + byte_size_string_iterator++; + + if( ( byte_size_string[ byte_size_string_iterator ] >= (system_character_t) '0' ) + && ( byte_size_string[ byte_size_string_iterator ] <= (system_character_t) '9' ) ) + { + remainder = (int8_t) ( byte_size_string[ byte_size_string_iterator ] - (system_character_t) '0' ); + + byte_size_string_iterator++; + } + remainder *= 10; + + if( ( byte_size_string[ byte_size_string_iterator ] >= (system_character_t) '0' ) + && ( byte_size_string[ byte_size_string_iterator ] <= (system_character_t) '9' ) ) + { + remainder += (int8_t) ( byte_size_string[ byte_size_string_iterator ] - (system_character_t) '0' ); + + byte_size_string_iterator++; + } + /* Ignore more than 2 digits after separator + */ + while( byte_size_string_iterator < byte_size_string_length ) + { + if( ( byte_size_string[ byte_size_string_iterator ] < (system_character_t) '0' ) + || ( byte_size_string[ byte_size_string_iterator ] > (system_character_t) '9' ) ) + { + break; + } + byte_size_string_iterator++; + } + } + if( byte_size_string[ byte_size_string_iterator ] == (system_character_t) ' ' ) + { + byte_size_string_iterator++; + } + switch( byte_size_string[ byte_size_string_iterator ] ) + { + case 'k': + case 'K': + factor = 1; + break; + + case 'm': + case 'M': + factor = 2; + break; + + case 'g': + case 'G': + factor = 3; + break; + + case 't': + case 'T': + factor = 4; + break; + + case 'p': + case 'P': + factor = 5; + break; + + case 'e': + case 'E': + factor = 6; + break; + + case 'z': + case 'Z': + factor = 7; + break; + + case 'y': + case 'Y': + factor = 8; + break; + + default: + break; + } + if( factor >= 1 ) + { + byte_size_string_iterator++; + } + if( byte_size_string_iterator >= byte_size_string_length ) + { + units = BYTE_SIZE_STRING_UNIT_MEBIBYTE; + } + else if( ( byte_size_string[ byte_size_string_iterator ] == (system_character_t) 'i' ) + && ( byte_size_string[ byte_size_string_iterator + 1 ] == (system_character_t) 'B' ) ) + { + units = BYTE_SIZE_STRING_UNIT_MEBIBYTE; + + byte_size_string_iterator += 2; + } + else if( byte_size_string[ byte_size_string_iterator ] == (system_character_t) 'B' ) + { + units = BYTE_SIZE_STRING_UNIT_MEGABYTE; + + byte_size_string_iterator++; + } + else + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid units.", + function ); + + return( -1 ); + } + if( factor > 0 ) + { + if( remainder > 0 ) + { + byte_size *= units; + + factor--; + + byte_size += ( remainder * 10 ); + } + for( ; factor > 0; factor-- ) + { + byte_size *= units; + } + } +#if defined( HAVE_VERBOSE_OUTPUT ) + else if( remainder >= 0 ) + { + libcnotify_printf( + "%s: ignoring byte value remainder.\n", + function ); + } +#endif +#if defined( HAVE_VERBOSE_OUTPUT ) + if( ( byte_size_string[ byte_size_string_iterator ] != 0 ) + && ( byte_size_string[ byte_size_string_iterator ] != (system_character_t) ' ' ) + && ( byte_size_string[ byte_size_string_iterator ] != (system_character_t) '\n' ) + && ( byte_size_string[ byte_size_string_iterator ] != (system_character_t) '\r' ) ) + { + libcnotify_printf( + "%s: trailing data in byte size string.\n", + function ); + } +#endif + *size = byte_size; + + return( 1 ); +} + diff -Nru libbde-20190102/bdetools/byte_size_string.h libbde-20240223/bdetools/byte_size_string.h --- libbde-20190102/bdetools/byte_size_string.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/bdetools/byte_size_string.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * Byte size string functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _BYTE_SIZE_STRING_H ) +#define _BYTE_SIZE_STRING_H + +#include +#include + +#include "bdetools_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +enum BYTE_SIZE_STRING_UNITS +{ + BYTE_SIZE_STRING_UNIT_MEGABYTE = 1000, + BYTE_SIZE_STRING_UNIT_MEBIBYTE = 1024 +}; + +int byte_size_string_create( + system_character_t *byte_size_string, + size_t byte_size_string_length, + uint64_t size, + int units, + libcerror_error_t **error ); + +int byte_size_string_create_with_decimal_point( + system_character_t *byte_size_string, + size_t byte_size_string_length, + uint64_t size, + int units, + int decimal_point, + libcerror_error_t **error ); + +int byte_size_string_convert( + const system_character_t *byte_size_string, + size_t byte_size_string_length, + uint64_t *size, + libcerror_error_t **error ); + +int byte_size_string_convert_with_decimal_point( + const system_character_t *byte_size_string, + size_t byte_size_string_length, + int decimal_point, + uint64_t *size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _BYTE_SIZE_STRING_H ) */ + diff -Nru libbde-20190102/bdetools/info_handle.c libbde-20240223/bdetools/info_handle.c --- libbde-20190102/bdetools/info_handle.c 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/bdetools/info_handle.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Info handle * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -28,6 +28,8 @@ #include #include +#include "byte_size_string.h" +#include "bdetools_input.h" #include "bdetools_libbde.h" #include "bdetools_libbfio.h" #include "bdetools_libcerror.h" @@ -166,6 +168,7 @@ */ int info_handle_initialize( info_handle_t **info_handle, + int unattended_mode, libcerror_error_t **error ) { static char *function = "info_handle_initialize"; @@ -225,43 +228,18 @@ return( -1 ); } - if( libbfio_file_range_initialize( - &( ( *info_handle )->input_file_io_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize input file IO handle.", - function ); - - goto on_error; - } - if( libbde_volume_initialize( - &( ( *info_handle )->input_volume ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize input volume.", - function ); - - goto on_error; - } - ( *info_handle )->notify_stream = INFO_HANDLE_NOTIFY_STREAM; + ( *info_handle )->notify_stream = INFO_HANDLE_NOTIFY_STREAM; + ( *info_handle )->unattended_mode = unattended_mode; return( 1 ); on_error: if( *info_handle != NULL ) { - if( ( *info_handle )->input_file_io_handle != NULL ) + if( ( *info_handle )->file_io_handle != NULL ) { libbfio_handle_free( - &( ( *info_handle )->input_file_io_handle ), + &( ( *info_handle )->file_io_handle ), NULL ); } memory_free( @@ -295,28 +273,32 @@ } if( *info_handle != NULL ) { - if( libbde_volume_free( - &( ( *info_handle )->input_volume ), - error ) != 1 ) + if( ( *info_handle )->file_io_handle != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free input volume.", - function ); + if( info_handle_close( + *info_handle, + error ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_CLOSE_FAILED, + "%s: unable to close info handle.", + function ); - result = -1; + result = -1; + } } - if( libbfio_handle_free( - &( ( *info_handle )->input_file_io_handle ), - error ) != 1 ) + if( memory_set( + ( *info_handle )->key_data, + 0, + 64 ) == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free input file IO handle.", + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear key data.", function ); result = -1; @@ -349,17 +331,17 @@ return( -1 ); } - if( info_handle->input_volume != NULL ) + if( info_handle->volume != NULL ) { if( libbde_volume_signal_abort( - info_handle->input_volume, + info_handle->volume, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to signal input volume to abort.", + "%s: unable to signal volume to abort.", function ); return( -1 ); @@ -376,16 +358,13 @@ const system_character_t *string, libcerror_error_t **error ) { - uint8_t key_data[ 64 ]; - system_character_t *string_segment = NULL; static char *function = "info_handle_set_keys"; - size_t full_volume_encryption_key_size = 0; size_t string_length = 0; size_t string_segment_size = 0; - size_t tweak_key_size = 0; uint32_t base16_variant = 0; int number_of_segments = 0; + int result = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; @@ -408,20 +387,21 @@ string ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcsplit_wide_string_split( - string, - string_length + 1, - (wchar_t) ':', - &string_elements, - error ) != 1 ) + result = libcsplit_wide_string_split( + string, + string_length + 1, + (wchar_t) ':', + &string_elements, + error ); #else - if( libcsplit_narrow_string_split( - string, - string_length + 1, - (char) ':', - &string_elements, - error ) != 1 ) + result = libcsplit_narrow_string_split( + string, + string_length + 1, + (char) ':', + &string_elements, + error ); #endif + if( result != 1 ) { libcerror_error_set( error, @@ -433,16 +413,17 @@ goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcsplit_wide_split_string_get_number_of_segments( - string_elements, - &number_of_segments, - error ) != 1 ) + result = libcsplit_wide_split_string_get_number_of_segments( + string_elements, + &number_of_segments, + error ); #else - if( libcsplit_narrow_split_string_get_number_of_segments( - string_elements, - &number_of_segments, - error ) != 1 ) + result = libcsplit_narrow_split_string_get_number_of_segments( + string_elements, + &number_of_segments, + error ); #endif + if( result != 1 ) { libcerror_error_set( error, @@ -466,7 +447,7 @@ goto on_error; } if( memory_set( - key_data, + info_handle->key_data, 0, 64 ) == NULL ) { @@ -490,22 +471,21 @@ { base16_variant |= LIBUNA_BASE16_VARIANT_ENCODING_UTF16_LITTLE_ENDIAN; } -#endif -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcsplit_wide_split_string_get_segment_by_index( - string_elements, - 0, - &string_segment, - &string_segment_size, - error ) != 1 ) + result = libcsplit_wide_split_string_get_segment_by_index( + string_elements, + 0, + &string_segment, + &string_segment_size, + error ); #else - if( libcsplit_narrow_split_string_get_segment_by_index( - string_elements, - 0, - &string_segment, - &string_segment_size, - error ) != 1 ) + result = libcsplit_narrow_split_string_get_segment_by_index( + string_elements, + 0, + &string_segment, + &string_segment_size, + error ); #endif + if( result != 1 ) { libcerror_error_set( error, @@ -558,7 +538,7 @@ if( libuna_base16_stream_copy_to_byte_stream( (uint8_t *) string_segment, string_segment_size - 1, - key_data, + info_handle->key_data, 64, base16_variant, 0, @@ -573,8 +553,8 @@ goto on_error; } - full_volume_encryption_key_size = 32; - tweak_key_size = 32; + info_handle->full_volume_encryption_key_size = 64; + info_handle->tweak_key_size = 0; } else if( ( string_segment_size == 33 ) || ( string_segment_size == 65 ) ) @@ -582,7 +562,7 @@ if( libuna_base16_stream_copy_to_byte_stream( (uint8_t *) string_segment, string_segment_size - 1, - key_data, + info_handle->key_data, 32, base16_variant, 0, @@ -599,30 +579,31 @@ } if( string_segment_size == 33 ) { - full_volume_encryption_key_size = 16; + info_handle->full_volume_encryption_key_size = 16; } else { - full_volume_encryption_key_size = 32; + info_handle->full_volume_encryption_key_size = 32; } } if( number_of_segments > 1 ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcsplit_wide_split_string_get_segment_by_index( - string_elements, - 1, - &string_segment, - &string_segment_size, - error ) != 1 ) + result = libcsplit_wide_split_string_get_segment_by_index( + string_elements, + 1, + &string_segment, + &string_segment_size, + error ); #else - if( libcsplit_narrow_split_string_get_segment_by_index( - string_elements, - 1, - &string_segment, - &string_segment_size, - error ) != 1 ) + result = libcsplit_narrow_split_string_get_segment_by_index( + string_elements, + 1, + &string_segment, + &string_segment_size, + error ); #endif + if( result != 1 ) { libcerror_error_set( error, @@ -659,7 +640,7 @@ if( libuna_base16_stream_copy_to_byte_stream( (uint8_t *) string_segment, string_segment_size - 1, - &( key_data[ 32 ] ), + &( info_handle->key_data[ 32 ] ), 32, base16_variant, 0, @@ -676,53 +657,23 @@ } if( string_segment_size == 33 ) { - tweak_key_size = 16; + info_handle->tweak_key_size = 16; } else { - tweak_key_size = 32; + info_handle->tweak_key_size = 32; } } - if( libbde_volume_set_keys( - info_handle->input_volume, - key_data, - full_volume_encryption_key_size, - &( key_data[ 32 ] ), - tweak_key_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set keys.", - function ); - - goto on_error; - } - if( memory_set( - key_data, - 0, - 64 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear key data.", - function ); - - goto on_error; - } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcsplit_wide_split_string_free( - &string_elements, - error ) != 1 ) + result = libcsplit_wide_split_string_free( + &string_elements, + error ); #else - if( libcsplit_narrow_split_string_free( - &string_elements, - error ) != 1 ) + result = libcsplit_narrow_split_string_free( + &string_elements, + error ); #endif + if( result != 1 ) { libcerror_error_set( error, @@ -749,10 +700,13 @@ #endif } memory_set( - key_data, + info_handle->key_data, 0, 64 ); + info_handle->full_volume_encryption_key_size = 0; + info_handle->tweak_key_size = 0; + return( -1 ); } @@ -778,32 +732,23 @@ return( -1 ); } - string_length = system_string_length( - string ); - -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libbde_volume_set_utf16_password( - info_handle->input_volume, - (uint16_t *) string, - string_length, - error ) != 1 ) -#else - if( libbde_volume_set_utf8_password( - info_handle->input_volume, - (uint8_t *) string, - string_length, - error ) != 1 ) -#endif + if( string == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set password.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid string.", function ); return( -1 ); } + string_length = system_string_length( + string ); + + info_handle->user_password = string; + info_handle->user_password_length = string_length; + return( 1 ); } @@ -829,44 +774,35 @@ return( -1 ); } - string_length = system_string_length( - string ); - -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libbde_volume_set_utf16_recovery_password( - info_handle->input_volume, - (uint16_t *) string, - string_length, - error ) != 1 ) -#else - if( libbde_volume_set_utf8_recovery_password( - info_handle->input_volume, - (uint8_t *) string, - string_length, - error ) != 1 ) -#endif + if( string == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set recovery password.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid string.", function ); return( -1 ); } + string_length = system_string_length( + string ); + + info_handle->recovery_password = string; + info_handle->recovery_password_length = string_length; + return( 1 ); } -/* Reads the startup key from a .BEK file +/* Sets the startup key (.BEK) file path * Returns 1 if successful or -1 on error */ -int info_handle_read_startup_key( +int info_handle_set_startup_key( info_handle_t *info_handle, - const system_character_t *filename, + const system_character_t *string, libcerror_error_t **error ) { - static char *function = "info_handle_read_startup_key"; + static char *function = "info_handle_set_startup_key"; if( info_handle == NULL ) { @@ -879,27 +815,19 @@ return( -1 ); } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libbde_volume_read_startup_key_wide( - info_handle->input_volume, - filename, - error ) != 1 ) -#else - if( libbde_volume_read_startup_key( - info_handle->input_volume, - filename, - error ) != 1 ) -#endif + if( string == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read startup key.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid string.", function ); return( -1 ); } + info_handle->startup_key_path = string; + return( 1 ); } @@ -952,13 +880,16 @@ /* Opens the info handle * Returns 1 if successful or -1 on error */ -int info_handle_open_input( +int info_handle_open( info_handle_t *info_handle, const system_character_t *filename, libcerror_error_t **error ) { - static char *function = "info_handle_open_input"; + system_character_t password[ 64 ]; + + static char *function = "info_handle_open"; size_t filename_length = 0; + size_t password_length = 0; int result = 0; if( info_handle == NULL ) @@ -972,18 +903,53 @@ return( -1 ); } + if( info_handle->file_io_handle != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid info handle - file IO handle value already set.", + function ); + + return( -1 ); + } + if( info_handle->volume != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid info handle - volume value already set.", + function ); + + return( -1 ); + } + if( libbfio_file_range_initialize( + &( info_handle->file_io_handle ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize file IO handle.", + function ); + + goto on_error; + } filename_length = system_string_length( filename ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbfio_file_range_set_name_wide( - info_handle->input_file_io_handle, + info_handle->file_io_handle, filename, filename_length, error ) != 1 ) #else if( libbfio_file_range_set_name( - info_handle->input_file_io_handle, + info_handle->file_io_handle, filename, filename_length, error ) != 1 ) @@ -996,10 +962,10 @@ "%s: unable to open set file name.", function ); - return( -1 ); + goto on_error; } if( libbfio_file_range_set( - info_handle->input_file_io_handle, + info_handle->file_io_handle, info_handle->volume_offset, 0, error ) != 1 ) @@ -1011,36 +977,258 @@ "%s: unable to open set volume offset.", function ); - return( -1 ); + goto on_error; } - result = libbde_volume_open_file_io_handle( - info_handle->input_volume, - info_handle->input_file_io_handle, - LIBBDE_OPEN_READ, - error ); + if( libbde_volume_initialize( + &( info_handle->volume ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize volume.", + function ); - if( result == -1 ) + goto on_error; + } + if( info_handle->full_volume_encryption_key_size > 0 ) + { + if( libbde_volume_set_keys( + info_handle->volume, + info_handle->key_data, + info_handle->full_volume_encryption_key_size, + &( info_handle->key_data[ 32 ] ), + info_handle->tweak_key_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set keys.", + function ); + + goto on_error; + } + } + if( info_handle->user_password != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libbde_volume_set_utf16_password( + info_handle->volume, + (uint16_t *) info_handle->user_password, + info_handle->user_password_length, + error ) != 1 ) +#else + if( libbde_volume_set_utf8_password( + info_handle->volume, + (uint8_t *) info_handle->user_password, + info_handle->user_password_length, + error ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set password.", + function ); + + goto on_error; + } + } + if( info_handle->recovery_password != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libbde_volume_set_utf16_recovery_password( + info_handle->volume, + (uint16_t *) info_handle->recovery_password, + info_handle->recovery_password_length, + error ) != 1 ) +#else + if( libbde_volume_set_utf8_recovery_password( + info_handle->volume, + (uint8_t *) info_handle->recovery_password, + info_handle->recovery_password_length, + error ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set recovery password.", + function ); + + goto on_error; + } + } + if( info_handle->startup_key_path != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libbde_volume_read_startup_key_wide( + info_handle->volume, + info_handle->startup_key_path, + error ) != 1 ) +#else + if( libbde_volume_read_startup_key( + info_handle->volume, + info_handle->startup_key_path, + error ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read startup key.", + function ); + + goto on_error; + } + } + if( libbde_volume_open_file_io_handle( + info_handle->volume, + info_handle->file_io_handle, + LIBBDE_OPEN_READ, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open input volume.", + "%s: unable to open volume.", function ); - return( -1 ); + goto on_error; + } + result = libbde_volume_is_locked( + info_handle->volume, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine if volume is locked.", + function ); + + goto on_error; + } + else if( ( result != 0 ) + && ( info_handle->unattended_mode == 0 ) ) + { + fprintf( + stdout, + "Volume is locked and a password is needed to unlock it.\n\n" ); + + if( bdetools_prompt_for_password( + stdout, + "Password", + password, + 64, + error ) != 1 ) + { + fprintf( + stderr, + "Unable to retrieve password.\n" ); + + goto on_error; + } + password_length = system_string_length( + password ); + + if( password_length > 0 ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libbde_volume_set_utf16_password( + info_handle->volume, + (uint16_t *) password, + password_length, + error ) != 1 ) +#else + if( libbde_volume_set_utf8_password( + info_handle->volume, + (uint8_t *) password, + password_length, + error ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set password.", + function ); + + goto on_error; + } + memory_set( + password, + 0, + 64 ); + } + fprintf( + stdout, + "\n\n" ); + + result = libbde_volume_unlock( + info_handle->volume, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to unlock volume.", + function ); + + goto on_error; + } + else if( result == 0 ) + { + fprintf( + stdout, + "Unable to unlock volume.\n\n" ); + } } return( 1 ); + +on_error: + if( info_handle->volume != NULL ) + { + libbde_volume_free( + &( info_handle->volume ), + NULL ); + } + if( info_handle->file_io_handle != NULL ) + { + libbfio_handle_free( + &( info_handle->file_io_handle ), + NULL ); + } + memory_set( + password, + 0, + 64 ); + + return( -1 ); } /* Closes the info handle * Returns the 0 if succesful or -1 on error */ -int info_handle_close_input( +int info_handle_close( info_handle_t *info_handle, libcerror_error_t **error ) { - static char *function = "info_handle_close_input"; + static char *function = "info_handle_close"; + int result = 0; if( info_handle == NULL ) { @@ -1054,56 +1242,43 @@ return( -1 ); } if( libbde_volume_close( - info_handle->input_volume, + info_handle->volume, error ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_CLOSE_FAILED, - "%s: unable to close input volume.", + "%s: unable to close volume.", function ); - return( -1 ); + result = -1; } - return( 0 ); -} - -/* Determine if the input is locked - * Returns 1 if locked, 0 if not or -1 on error - */ -int info_handle_input_is_locked( - info_handle_t *info_handle, - libcerror_error_t **error ) -{ - static char *function = "info_handle_input_is_locked"; - int result = 0; - - if( info_handle == NULL ) + if( libbde_volume_free( + &( info_handle->volume ), + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid info handle.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free volume.", function ); - return( -1 ); + result = -1; } - result = libbde_volume_is_locked( - info_handle->input_volume, - error ); - - if( result == -1 ) + if( libbfio_handle_free( + &( info_handle->file_io_handle ), + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if volume is locked.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free file IO handle.", function ); - return( -1 ); + result = -1; } return( result ); } @@ -1347,15 +1522,18 @@ info_handle_t *info_handle, libcerror_error_t **error ) { + system_character_t byte_size_string[ 16 ]; uint8_t guid_data[ 16 ]; libbde_key_protector_t *key_protector = NULL; system_character_t *value_string = NULL; static char *function = "bdeinfo_volume_info_fprint"; + size64_t volume_size = 0; size_t value_string_size = 0; uint64_t value_64bit = 0; uint16_t encryption_method = 0; uint16_t key_protector_type = 0; + int is_locked = 0; int key_protector_index = 0; int number_of_key_protectors = 0; int result = 0; @@ -1375,8 +1553,101 @@ info_handle->notify_stream, "BitLocker Drive Encryption information:\n" ); + result = libbde_volume_is_locked( + info_handle->volume, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine if volume is locked.", + function ); + + return( -1 ); + } + is_locked = result; + + if( libbde_volume_get_volume_identifier( + info_handle->volume, + guid_data, + 16, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve volume identifier.", + function ); + + goto on_error; + } + if( info_handle_guid_value_fprint( + info_handle, + "\tVolume identifier\t\t", + guid_data, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, + "%s: unable to print GUID value.", + function ); + + goto on_error; + } + if( is_locked == 0 ) + { + if( libbde_volume_get_size( + info_handle->volume, + &volume_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve volume size.", + function ); + + return( -1 ); + } + fprintf( + info_handle->notify_stream, + "\tSize\t\t\t\t: " ); + + result = byte_size_string_create( + byte_size_string, + 16, + volume_size, + BYTE_SIZE_STRING_UNIT_MEBIBYTE, + NULL ); + + if( result == 1 ) + { + fprintf( + info_handle->notify_stream, + "%" PRIs_SYSTEM " (%" PRIu64 " bytes)", + byte_size_string, + volume_size ); + } + else + { + fprintf( + info_handle->notify_stream, + "%" PRIu64 " bytes", + volume_size ); + } + fprintf( + info_handle->notify_stream, + "\n" ); + } if( libbde_volume_get_encryption_method( - info_handle->input_volume, + info_handle->volume, &encryption_method, error ) != 1 ) { @@ -1437,6 +1708,13 @@ break; + case LIBBDE_ENCRYPTION_METHOD_NONE: + fprintf( + info_handle->notify_stream, + "None" ); + + break; + default: fprintf( info_handle->notify_stream, @@ -1449,38 +1727,8 @@ info_handle->notify_stream, "\n" ); - if( libbde_volume_get_volume_identifier( - info_handle->input_volume, - guid_data, - 16, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve volume identifier.", - function ); - - goto on_error; - } - if( info_handle_guid_value_fprint( - info_handle, - "\tVolume identifier\t\t", - guid_data, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, - "%s: unable to print GUID value.", - function ); - - goto on_error; - } if( libbde_volume_get_creation_time( - info_handle->input_volume, + info_handle->volume, &value_64bit, error ) != 1 ) { @@ -1510,16 +1758,16 @@ } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libbde_volume_get_utf16_description_size( - info_handle->input_volume, + info_handle->volume, &value_string_size, error ); #else result = libbde_volume_get_utf8_description_size( - info_handle->input_volume, + info_handle->volume, &value_string_size, error ); #endif - if( result != 1 ) + if( result == -1 ) { libcerror_error_set( error, @@ -1530,7 +1778,8 @@ goto on_error; } - if( value_string_size > 0 ) + if( ( result != 0 ) + && ( value_string_size > 0 ) ) { if( value_string_size > (size_t) ( SSIZE_MAX / sizeof( system_character_t ) ) ) { @@ -1559,13 +1808,13 @@ } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libbde_volume_get_utf16_description( - info_handle->input_volume, + info_handle->volume, (uint16_t *) value_string, value_string_size, error ); #else result = libbde_volume_get_utf8_description( - info_handle->input_volume, + info_handle->volume, (uint8_t *) value_string, value_string_size, error ); @@ -1592,7 +1841,7 @@ value_string = NULL; } if( libbde_volume_get_number_of_key_protectors( - info_handle->input_volume, + info_handle->volume, &number_of_key_protectors, error ) != 1 ) { @@ -1610,6 +1859,12 @@ "\tNumber of key protectors\t: %d\n", number_of_key_protectors ); + if( is_locked != 0 ) + { + fprintf( + info_handle->notify_stream, + "\tIs locked\n" ); + } fprintf( info_handle->notify_stream, "\n" ); @@ -1625,8 +1880,8 @@ "Key protector %d:\n", key_protector_index ); - if( libbde_volume_get_key_protector( - info_handle->input_volume, + if( libbde_volume_get_key_protector_by_index( + info_handle->volume, key_protector_index, &key_protector, error ) != 1 ) @@ -1714,6 +1969,13 @@ break; + case LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN: + fprintf( + info_handle->notify_stream, + "TPM and PIN" ); + + break; + case LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD: fprintf( info_handle->notify_stream, diff -Nru libbde-20190102/bdetools/info_handle.h libbde-20240223/bdetools/info_handle.h --- libbde-20190102/bdetools/info_handle.h 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/bdetools/info_handle.h 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Info handle * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _INFO_HANDLE_H ) @@ -38,22 +38,58 @@ struct info_handle { + /* The key data + */ + uint8_t key_data[ 64 ]; + + /* The full volume encryption key size + */ + uint8_t full_volume_encryption_key_size; + + /* The tweak key size + */ + uint8_t tweak_key_size; + /* The volume offset */ off64_t volume_offset; - /* The libbfio input file IO handle + /* The recovery password */ - libbfio_handle_t *input_file_io_handle; + const system_character_t *recovery_password; - /* The libbde input volume + /* The recovery password length */ - libbde_volume_t *input_volume; + size_t recovery_password_length; + + /* The user password + */ + const system_character_t *user_password; + + /* The user password length + */ + size_t user_password_length; + + /* The path of the startup key (.BEK) file + */ + const system_character_t *startup_key_path; + + /* The libbfio file IO handle + */ + libbfio_handle_t *file_io_handle; + + /* The libbde volume + */ + libbde_volume_t *volume; /* The notification output stream */ FILE *notify_stream; + /* Value to indicate if user interaction is disabled + */ + int unattended_mode; + /* Value to indicate if abort was signalled */ int abort; @@ -67,6 +103,7 @@ int info_handle_initialize( info_handle_t **info_handle, + int unattended_mode, libcerror_error_t **error ); int info_handle_free( @@ -92,7 +129,7 @@ const system_character_t *string, libcerror_error_t **error ); -int info_handle_read_startup_key( +int info_handle_set_startup_key( info_handle_t *info_handle, const system_character_t *filename, libcerror_error_t **error ); @@ -102,16 +139,12 @@ const system_character_t *string, libcerror_error_t **error ); -int info_handle_open_input( +int info_handle_open( info_handle_t *info_handle, const system_character_t *filename, libcerror_error_t **error ); -int info_handle_close_input( - info_handle_t *info_handle, - libcerror_error_t **error ); - -int info_handle_input_is_locked( +int info_handle_close( info_handle_t *info_handle, libcerror_error_t **error ); diff -Nru libbde-20190102/bdetools/mount_dokan.c libbde-20240223/bdetools/mount_dokan.c --- libbde-20190102/bdetools/mount_dokan.c 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_dokan.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount tool dokan functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/bdetools/mount_dokan.h libbde-20240223/bdetools/mount_dokan.h --- libbde-20190102/bdetools/mount_dokan.h 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_dokan.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount tool dokan functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _MOUNT_DOKAN_H ) diff -Nru libbde-20190102/bdetools/mount_file_entry.c libbde-20240223/bdetools/mount_file_entry.c --- libbde-20190102/bdetools/mount_file_entry.c 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_file_entry.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount file entry * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -52,7 +52,7 @@ mount_file_system_t *file_system, const system_character_t *name, size_t name_length, - libbde_volume_t *volume, + libbde_volume_t *bde_volume, libcerror_error_t **error ) { static char *function = "mount_file_entry_initialize"; @@ -173,7 +173,7 @@ ( *file_entry )->name_size = name_length + 1; } - ( *file_entry )->volume = volume; + ( *file_entry )->bde_volume = bde_volume; return( 1 ); @@ -271,7 +271,7 @@ return( -1 ); } - if( file_entry->volume != NULL ) + if( file_entry->bde_volume != NULL ) { if( mount_file_entry_initialize( parent_file_entry, @@ -323,7 +323,7 @@ return( -1 ); } - if( file_entry->volume == NULL ) + if( file_entry->bde_volume == NULL ) { if( mount_file_system_get_mounted_timestamp( file_entry->file_system, @@ -354,7 +354,7 @@ return( -1 ); } if( libbde_volume_get_creation_time( - file_entry->volume, + file_entry->bde_volume, &filetime, error ) != 1 ) { @@ -534,7 +534,7 @@ return( -1 ); } - if( file_entry->volume == NULL ) + if( file_entry->bde_volume == NULL ) { *file_mode = S_IFDIR | 0555; } @@ -702,7 +702,7 @@ return( -1 ); } - if( file_entry->volume == NULL ) + if( file_entry->bde_volume == NULL ) { if( mount_file_system_get_number_of_volumes( file_entry->file_system, @@ -747,7 +747,7 @@ { system_character_t path[ 32 ]; - libbde_volume_t *volume = NULL; + libbde_volume_t *bde_volume = NULL; static char *function = "mount_file_entry_get_sub_file_entry_by_index"; size_t path_length = 0; int number_of_sub_file_entries = 0; @@ -831,7 +831,7 @@ if( mount_file_system_get_volume_by_index( file_entry->file_system, sub_file_entry_index, - &volume, + &bde_volume, error ) != 1 ) { libcerror_error_set( @@ -844,7 +844,7 @@ return( -1 ); } - if( volume == NULL ) + if( bde_volume == NULL ) { libcerror_error_set( error, @@ -864,7 +864,7 @@ file_entry->file_system, &( path[ 1 ] ), path_length - 1, - volume, + bde_volume, error ) != 1 ) { libcerror_error_set( @@ -905,7 +905,7 @@ return( -1 ); } read_count = libbde_volume_read_buffer_at_offset( - file_entry->volume, + file_entry->bde_volume, buffer, buffer_size, offset, @@ -948,7 +948,7 @@ return( -1 ); } - if( file_entry->volume == NULL ) + if( file_entry->bde_volume == NULL ) { if( size == NULL ) { @@ -966,7 +966,7 @@ else { if( libbde_volume_get_size( - file_entry->volume, + file_entry->bde_volume, size, error ) != 1 ) { diff -Nru libbde-20190102/bdetools/mount_file_entry.h libbde-20240223/bdetools/mount_file_entry.h --- libbde-20190102/bdetools/mount_file_entry.h 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_file_entry.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount file entry * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _MOUNT_FILE_ENTRY_H ) @@ -51,7 +51,7 @@ /* The volume */ - libbde_volume_t *volume; + libbde_volume_t *bde_volume; }; int mount_file_entry_initialize( @@ -59,7 +59,7 @@ mount_file_system_t *file_system, const system_character_t *name, size_t name_length, - libbde_volume_t *volume, + libbde_volume_t *bde_volume, libcerror_error_t **error ); int mount_file_entry_free( diff -Nru libbde-20190102/bdetools/mount_file_system.c libbde-20240223/bdetools/mount_file_system.c --- libbde-20190102/bdetools/mount_file_system.c 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_file_system.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount file system * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -30,15 +30,12 @@ #include #endif -#if defined( TIME_WITH_SYS_TIME ) +#if defined( HAVE_SYS_TIME_H ) #include -#include -#elif defined( HAVE_SYS_TIME_H ) -#include -#else -#include #endif +#include + #include "bdetools_libbde.h" #include "bdetools_libcdata.h" #include "bdetools_libcerror.h" @@ -281,10 +278,10 @@ mount_file_system_t *file_system, libcerror_error_t **error ) { - libbde_volume_t *volume = NULL; - static char *function = "mount_file_system_signal_abort"; - int number_of_volumes = 0; - int volume_index = 0; + libbde_volume_t *bde_volume = NULL; + static char *function = "mount_file_system_signal_abort"; + int number_of_volumes = 0; + int volume_index = 0; if( file_system == NULL ) { @@ -318,7 +315,7 @@ if( libcdata_array_get_entry_by_index( file_system->volumes_array, volume_index, - (intptr_t **) &volume, + (intptr_t **) &bde_volume, error ) != 1 ) { libcerror_error_set( @@ -332,7 +329,7 @@ return( -1 ); } if( libbde_volume_signal_abort( - volume, + bde_volume, error ) != 1 ) { libcerror_error_set( @@ -545,7 +542,7 @@ int mount_file_system_get_volume_by_index( mount_file_system_t *file_system, int volume_index, - libbde_volume_t **volume, + libbde_volume_t **bde_volume, libcerror_error_t **error ) { static char *function = "mount_file_system_get_volume_by_index"; @@ -564,7 +561,7 @@ if( libcdata_array_get_entry_by_index( file_system->volumes_array, volume_index, - (intptr_t **) volume, + (intptr_t **) bde_volume, error ) != 1 ) { libcerror_error_set( @@ -587,7 +584,7 @@ mount_file_system_t *file_system, const system_character_t *path, size_t path_length, - libbde_volume_t **volume, + libbde_volume_t **bde_volume, libcerror_error_t **error ) { static char *function = "mount_file_system_get_volume_by_path"; @@ -640,7 +637,7 @@ return( -1 ); } - if( volume == NULL ) + if( bde_volume == NULL ) { libcerror_error_set( error, @@ -657,7 +654,7 @@ if( ( path_length == 1 ) && ( path[ 0 ] == file_system->path_prefix[ 0 ] ) ) { - *volume = NULL; + *bde_volume = NULL; return( 1 ); } @@ -702,7 +699,7 @@ if( libcdata_array_get_entry_by_index( file_system->volumes_array, volume_index, - (intptr_t **) volume, + (intptr_t **) bde_volume, error ) != 1 ) { libcerror_error_set( @@ -723,7 +720,7 @@ */ int mount_file_system_append_volume( mount_file_system_t *file_system, - libbde_volume_t *volume, + libbde_volume_t *bde_volume, libcerror_error_t **error ) { static char *function = "mount_file_system_append_volume"; @@ -743,7 +740,7 @@ if( libcdata_array_append_entry( file_system->volumes_array, &entry_index, - (intptr_t *) volume, + (intptr_t *) bde_volume, error ) != 1 ) { libcerror_error_set( diff -Nru libbde-20190102/bdetools/mount_file_system.h libbde-20240223/bdetools/mount_file_system.h --- libbde-20190102/bdetools/mount_file_system.h 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_file_system.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount file system * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _MOUNT_FILE_SYSTEM_H ) @@ -84,19 +84,19 @@ int mount_file_system_get_volume_by_index( mount_file_system_t *file_system, int volume_index, - libbde_volume_t **volume, + libbde_volume_t **bde_volume, libcerror_error_t **error ); int mount_file_system_get_volume_by_path( mount_file_system_t *file_system, const system_character_t *path, size_t path_length, - libbde_volume_t **volume, + libbde_volume_t **bde_volume, libcerror_error_t **error ); int mount_file_system_append_volume( mount_file_system_t *file_system, - libbde_volume_t *volume, + libbde_volume_t *bde_volume, libcerror_error_t **error ); int mount_file_system_get_path_from_volume_index( diff -Nru libbde-20190102/bdetools/mount_fuse.c libbde-20240223/bdetools/mount_fuse.c --- libbde-20190102/bdetools/mount_fuse.c 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_fuse.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount tool fuse functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/bdetools/mount_fuse.h libbde-20240223/bdetools/mount_fuse.h --- libbde-20190102/bdetools/mount_fuse.h 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_fuse.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount tool fuse functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _MOUNT_FUSE_H ) diff -Nru libbde-20190102/bdetools/mount_handle.c libbde-20240223/bdetools/mount_handle.c --- libbde-20190102/bdetools/mount_handle.c 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/bdetools/mount_handle.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount handle * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -26,6 +26,7 @@ #include #include +#include "bdetools_input.h" #include "bdetools_libbde.h" #include "bdetools_libbfio.h" #include "bdetools_libcerror.h" @@ -47,6 +48,8 @@ #endif /* !defined( LIBBDE_HAVE_BFIO ) */ +#define MOUNT_HANDLE_NOTIFY_STREAM stdout + /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error */ @@ -163,6 +166,7 @@ */ int mount_handle_initialize( mount_handle_t **mount_handle, + int unattended_mode, libcerror_error_t **error ) { static char *function = "mount_handle_initialize"; @@ -215,7 +219,12 @@ "%s: unable to clear mount handle.", function ); - goto on_error; + memory_free( + *mount_handle ); + + *mount_handle = NULL; + + return( -1 ); } if( mount_file_system_initialize( &( ( *mount_handle )->file_system ), @@ -230,6 +239,9 @@ goto on_error; } + ( *mount_handle )->notify_stream = MOUNT_HANDLE_NOTIFY_STREAM; + ( *mount_handle )->unattended_mode = unattended_mode; + return( 1 ); on_error: @@ -266,6 +278,22 @@ } if( *mount_handle != NULL ) { + if( ( *mount_handle )->file_io_handle != NULL ) + { + if( mount_handle_close( + *mount_handle, + error ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_CLOSE_FAILED, + "%s: unable to close mount handle.", + function ); + + result = -1; + } + } if( mount_file_system_free( &( ( *mount_handle )->file_system ), error ) != 1 ) @@ -282,7 +310,7 @@ if( memory_set( ( *mount_handle )->key_data, 0, - 16 ) == NULL ) + 64 ) == NULL ) { libcerror_error_set( error, @@ -540,8 +568,8 @@ goto on_error; } - mount_handle->full_volume_encryption_key_size = 32; - mount_handle->tweak_key_size = 32; + mount_handle->full_volume_encryption_key_size = 64; + mount_handle->tweak_key_size = 0; } else if( ( string_segment_size == 33 ) || ( string_segment_size == 65 ) ) @@ -827,7 +855,7 @@ return( 1 ); } -/* Sets the startup key (.BEK) filename +/* Sets the startup key (.BEK) file path * Returns 1 if successful or -1 on error */ int mount_handle_set_startup_key( @@ -912,10 +940,13 @@ const system_character_t *filename, libcerror_error_t **error ) { - libbde_volume_t *volume = NULL; + system_character_t password[ 64 ]; + + libbde_volume_t *bde_volume = NULL; libbfio_handle_t *file_io_handle = NULL; static char *function = "mount_handle_open"; size_t filename_length = 0; + size_t password_length = 0; int result = 0; if( mount_handle == NULL ) @@ -995,7 +1026,7 @@ goto on_error; } if( libbde_volume_initialize( - &volume, + &bde_volume, error ) != 1 ) { libcerror_error_set( @@ -1010,7 +1041,7 @@ if( mount_handle->full_volume_encryption_key_size > 0 ) { if( libbde_volume_set_keys( - volume, + bde_volume, mount_handle->key_data, mount_handle->full_volume_encryption_key_size, &( mount_handle->key_data[ 32 ] ), @@ -1031,13 +1062,13 @@ { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbde_volume_set_utf16_password( - volume, + bde_volume, (uint16_t *) mount_handle->password, mount_handle->password_length, error ) != 1 ) #else if( libbde_volume_set_utf8_password( - volume, + bde_volume, (uint8_t *) mount_handle->password, mount_handle->password_length, error ) != 1 ) @@ -1057,13 +1088,13 @@ { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbde_volume_set_utf16_recovery_password( - volume, + bde_volume, (uint16_t *) mount_handle->recovery_password, mount_handle->recovery_password_length, error ) != 1 ) #else if( libbde_volume_set_utf8_recovery_password( - volume, + bde_volume, (uint8_t *) mount_handle->recovery_password, mount_handle->recovery_password_length, error ) != 1 ) @@ -1083,12 +1114,12 @@ { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbde_volume_read_startup_key_wide( - volume, + bde_volume, mount_handle->startup_key_path, error ) != 1 ) #else if( libbde_volume_read_startup_key( - volume, + bde_volume, mount_handle->startup_key_path, error ) != 1 ) #endif @@ -1103,13 +1134,11 @@ goto on_error; } } - result = libbde_volume_open_file_io_handle( - volume, - file_io_handle, - LIBBDE_OPEN_READ, - error ); - - if( result == -1 ) + if( libbde_volume_open_file_io_handle( + bde_volume, + file_io_handle, + LIBBDE_OPEN_READ, + error ) != 1 ) { libcerror_error_set( error, @@ -1121,7 +1150,7 @@ goto on_error; } result = libbde_volume_is_locked( - volume, + bde_volume, error ); if( result == -1 ) @@ -1135,11 +1164,101 @@ goto on_error; } - mount_handle->is_locked = result; + else if( ( result != 0 ) + && ( mount_handle->unattended_mode == 0 ) ) + { + fprintf( + stdout, + "Volume is locked and a password is needed to unlock it.\n\n" ); + + if( bdetools_prompt_for_password( + stdout, + "Password", + password, + 64, + error ) != 1 ) + { + fprintf( + stderr, + "Unable to retrieve password.\n" ); + + goto on_error; + } + password_length = system_string_length( + password ); + + if( password_length > 0 ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libbde_volume_set_utf16_password( + bde_volume, + (uint16_t *) password, + password_length, + error ) != 1 ) +#else + if( libbde_volume_set_utf8_password( + bde_volume, + (uint8_t *) password, + password_length, + error ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set password.", + function ); + + goto on_error; + } + memory_set( + password, + 0, + 64 ); + } + fprintf( + stdout, + "\n\n" ); + + result = libbde_volume_unlock( + bde_volume, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to unlock volume.", + function ); + + goto on_error; + } + else if( result == 0 ) + { + fprintf( + stdout, + "Unable to unlock volume.\n\n" ); + } + result = ( result == 0 ); + } + if( result != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable unlock volume.", + function ); + + goto on_error; + } if( mount_file_system_append_volume( mount_handle->file_system, - volume, + bde_volume, error ) != 1 ) { libcerror_error_set( @@ -1156,10 +1275,10 @@ return( 1 ); on_error: - if( volume != NULL ) + if( bde_volume != NULL ) { libbde_volume_free( - &volume, + &bde_volume, NULL ); } if( file_io_handle != NULL ) @@ -1178,10 +1297,10 @@ mount_handle_t *mount_handle, libcerror_error_t **error ) { - libbde_volume_t *volume = NULL; - static char *function = "mount_handle_close"; - int number_of_volumes = 0; - int volume_index = 0; + libbde_volume_t *bde_volume = NULL; + static char *function = "mount_handle_close"; + int number_of_volumes = 0; + int volume_index = 0; if( mount_handle == NULL ) { @@ -1215,7 +1334,7 @@ if( mount_file_system_get_volume_by_index( mount_handle->file_system, volume_index, - &volume, + &bde_volume, error ) != 1 ) { libcerror_error_set( @@ -1228,10 +1347,10 @@ goto on_error; } -/* TODO remove volume from file system */ +/* TODO remove bde_volume from file system */ if( libbde_volume_close( - volume, + bde_volume, error ) != 0 ) { libcerror_error_set( @@ -1245,7 +1364,7 @@ goto on_error; } if( libbde_volume_free( - &volume, + &bde_volume, error ) != 1 ) { libcerror_error_set( @@ -1288,10 +1407,10 @@ return( 0 ); on_error: - if( volume != NULL ) + if( bde_volume != NULL ) { libbde_volume_free( - &volume, + &bde_volume, NULL ); } return( -1 ); @@ -1329,7 +1448,7 @@ mount_file_entry_t **file_entry, libcerror_error_t **error ) { - libbde_volume_t *volume = NULL; + libbde_volume_t *bde_volume = NULL; const system_character_t *filename = NULL; static char *function = "mount_handle_get_file_entry_by_path"; size_t filename_length = 0; @@ -1404,7 +1523,7 @@ mount_handle->file_system, path, path_length, - &volume, + &bde_volume, error ); if( result == -1 ) @@ -1425,7 +1544,7 @@ mount_handle->file_system, filename, filename_length, - volume, + bde_volume, error ) != 1 ) { libcerror_error_set( diff -Nru libbde-20190102/bdetools/mount_handle.h libbde-20240223/bdetools/mount_handle.h --- libbde-20190102/bdetools/mount_handle.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/bdetools/mount_handle.h 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mount handle * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _MOUNT_HANDLE_H ) @@ -91,6 +91,10 @@ /* The notification output stream */ FILE *notify_stream; + + /* Value to indicate if user interaction is disabled + */ + int unattended_mode; }; int mount_handle_system_string_copy_from_64_bit_in_decimal( @@ -101,6 +105,7 @@ int mount_handle_initialize( mount_handle_t **mount_handle, + int unattended_mode, libcerror_error_t **error ); int mount_handle_free( diff -Nru libbde-20190102/common/Makefile.am libbde-20240223/common/Makefile.am --- libbde-20190102/common/Makefile.am 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/common/Makefile.am 2024-02-23 02:47:17.000000000 +0000 @@ -19,7 +19,7 @@ Makefile.in distclean: clean - /bin/rm -f config.h - /bin/rm -f types.h - /bin/rm -f Makefile + -rm -f config.h + -rm -f types.h + -rm -f Makefile diff -Nru libbde-20190102/common/Makefile.in libbde-20240223/common/Makefile.in --- libbde-20190102/common/Makefile.in 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/common/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -90,16 +90,16 @@ subdir = common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -136,8 +136,9 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in +am__extra_recursive_targets = sources-recursive splint-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -154,8 +155,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/types.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -173,6 +172,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -184,8 +189,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -203,7 +210,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -221,7 +227,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -275,8 +280,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -295,6 +298,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -305,8 +309,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -329,26 +333,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -357,7 +341,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -376,6 +359,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -418,9 +402,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -489,8 +470,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -513,11 +492,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -601,6 +577,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -653,7 +631,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -784,6 +761,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: all install-am install-strip @@ -799,15 +784,16 @@ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f config.h - /bin/rm -f types.h - /bin/rm -f Makefile + -rm -f config.h + -rm -f types.h + -rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libbde-20190102/common/byte_stream.h libbde-20240223/common/byte_stream.h --- libbde-20190102/common/byte_stream.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/byte_stream.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Byte stream functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BYTE_STREAM_H ) diff -Nru libbde-20190102/common/common.h libbde-20240223/common/common.h --- libbde-20190102/common/common.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/common.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Common include file * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _COMMON_H ) diff -Nru libbde-20190102/common/config.h libbde-20240223/common/config.h --- libbde-20190102/common/config.h 2019-01-02 15:58:07.000000000 +0000 +++ libbde-20240223/common/config.h 2024-02-23 03:04:01.000000000 +0000 @@ -14,11 +14,11 @@ /* Define to 1 if you have the `bindtextdomain' function. */ #define HAVE_BINDTEXTDOMAIN 1 -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -/* #undef HAVE_CFLOCALECOPYCURRENT */ +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ @@ -58,6 +58,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 +/* Define to 1 if you have the `EVP_CipherInit_ex2' function". */ +#define HAVE_EVP_CIPHERINIT_EX2 1 + /* Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function". */ /* #undef HAVE_EVP_CIPHER_CTX_CLEANUP */ @@ -76,6 +79,9 @@ functions". */ #define HAVE_EVP_CRYPTO_AES_XTS 1 +/* Define to 1 if you have the `EVP_DigestInit_ex2' function". */ +#define HAVE_EVP_DIGESTINIT_EX2 1 + /* Define to 1 if you have the `EVP_md5' function". */ #define HAVE_EVP_MD5 1 @@ -142,6 +148,9 @@ /* Define to 1 if you have the `fwrite' function. */ #define HAVE_FWRITE 1 +/* Define to 1 if you have the `getchar' function. */ +#define HAVE_GETCHAR 1 + /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 @@ -160,7 +169,7 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ #define HAVE_GETTEXT 1 -/* Define to 1 if dlsym funtion is available in GNU dl. */ +/* Define to 1 if dlsym function is available in GNU dl. */ #define HAVE_GNU_DL_DLSYM 1 /* Define if you have the iconv() function and it works. */ @@ -250,12 +259,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBFCACHE_H */ -/* Define to 1 if you have the `fdata' library (-lfdata). */ -/* #undef HAVE_LIBFDATA */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBFDATA_H */ - /* Define to 1 if you have the `fdatetime' library (-lfdatetime). */ /* #undef HAVE_LIBFDATETIME */ @@ -340,9 +343,6 @@ /* Define to 1 if the local version of libfcache is used. */ #define HAVE_LOCAL_LIBFCACHE 1 -/* Define to 1 if the local version of libfdata is used. */ -#define HAVE_LOCAL_LIBFDATA 1 - /* Define to 1 if the local version of libfdatetime is used. */ #define HAVE_LOCAL_LIBFDATETIME 1 @@ -373,9 +373,6 @@ /* Define to 1 if you have the `memcpy' function. */ #define HAVE_MEMCPY 1 -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - /* Define to 1 if you have the `memrchr' function. */ #define HAVE_MEMRCHR 1 @@ -442,6 +439,9 @@ /* Define to 1 if you have the `realloc' function. */ #define HAVE_REALLOC 1 +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 @@ -481,7 +481,7 @@ /* Define to 1 if you have the `strerror' function. */ /* #undef HAVE_STRERROR */ -/* Define to 1 if you have the `strerror_r' function. */ +/* Define if you have `strerror_r'. */ #define HAVE_STRERROR_R 1 /* Define to 1 if you have the header file. */ @@ -532,15 +532,30 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SYSLIMITS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 +/* Define to 1 if you have the `tcgetattr' function. */ +#define HAVE_TCGETATTR 1 + +/* Define to 1 if you have the `tcsetattr' function. */ +#define HAVE_TCSETATTR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + /* Define to 1 if you have the `time' function. */ #define HAVE_TIME 1 /* Define to 1 if you have the `towlower' function. */ /* #undef HAVE_TOWLOWER */ +/* Define to 1 if you have the `tzset' function. */ +#define HAVE_TZSET 1 + /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 @@ -629,7 +644,7 @@ #define PACKAGE_NAME "libbde" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libbde 20190102" +#define PACKAGE_STRING "libbde 20240223" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libbde" @@ -638,7 +653,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20190102" +#define PACKAGE_VERSION "20240223" /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -655,25 +670,19 @@ /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T 4 -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 /* Define to 1 if strerror_r returns char *. */ /* #undef STRERROR_R_CHAR_P */ -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - /* Define to 1 if your declares `struct tm'. */ /* #undef TM_IN_SYS_TIME */ /* Version number of package */ -#define VERSION "20190102" - -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif +#define VERSION "20240223" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff -Nru libbde-20190102/common/config.h.in libbde-20240223/common/config.h.in --- libbde-20190102/common/config.h.in 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/common/config.h.in 2024-02-23 03:03:50.000000000 +0000 @@ -13,11 +13,11 @@ /* Define to 1 if you have the `bindtextdomain' function. */ #undef HAVE_BINDTEXTDOMAIN -/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the - CoreFoundation framework. */ -#undef HAVE_CFLOCALECOPYCURRENT +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES -/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE @@ -57,6 +57,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H +/* Define to 1 if you have the `EVP_CipherInit_ex2' function". */ +#undef HAVE_EVP_CIPHERINIT_EX2 + /* Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function". */ #undef HAVE_EVP_CIPHER_CTX_CLEANUP @@ -75,6 +78,9 @@ functions". */ #undef HAVE_EVP_CRYPTO_AES_XTS +/* Define to 1 if you have the `EVP_DigestInit_ex2' function". */ +#undef HAVE_EVP_DIGESTINIT_EX2 + /* Define to 1 if you have the `EVP_md5' function". */ #undef HAVE_EVP_MD5 @@ -141,6 +147,9 @@ /* Define to 1 if you have the `fwrite' function. */ #undef HAVE_FWRITE +/* Define to 1 if you have the `getchar' function. */ +#undef HAVE_GETCHAR + /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD @@ -159,7 +168,7 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT -/* Define to 1 if dlsym funtion is available in GNU dl. */ +/* Define to 1 if dlsym function is available in GNU dl. */ #undef HAVE_GNU_DL_DLSYM /* Define if you have the iconv() function and it works. */ @@ -249,12 +258,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBFCACHE_H -/* Define to 1 if you have the `fdata' library (-lfdata). */ -#undef HAVE_LIBFDATA - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBFDATA_H - /* Define to 1 if you have the `fdatetime' library (-lfdatetime). */ #undef HAVE_LIBFDATETIME @@ -339,9 +342,6 @@ /* Define to 1 if the local version of libfcache is used. */ #undef HAVE_LOCAL_LIBFCACHE -/* Define to 1 if the local version of libfdata is used. */ -#undef HAVE_LOCAL_LIBFDATA - /* Define to 1 if the local version of libfdatetime is used. */ #undef HAVE_LOCAL_LIBFDATETIME @@ -372,9 +372,6 @@ /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the `memrchr' function. */ #undef HAVE_MEMRCHR @@ -441,6 +438,9 @@ /* Define to 1 if you have the `realloc' function. */ #undef HAVE_REALLOC +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE @@ -480,7 +480,7 @@ /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define to 1 if you have the `strerror_r' function. */ +/* Define if you have `strerror_r'. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ @@ -531,15 +531,30 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSLIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the `tcgetattr' function. */ +#undef HAVE_TCGETATTR + +/* Define to 1 if you have the `tcsetattr' function. */ +#undef HAVE_TCSETATTR + +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIOS_H + /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define to 1 if you have the `towlower' function. */ #undef HAVE_TOWLOWER +/* Define to 1 if you have the `tzset' function. */ +#undef HAVE_TZSET + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -654,26 +669,20 @@ /* The size of `wchar_t', as computed by sizeof. */ #undef SIZEOF_WCHAR_T -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION -/* Enable large inode numbers on Mac OS X 10.5. */ -#ifndef _DARWIN_USE_64_BIT_INODE -# define _DARWIN_USE_64_BIT_INODE 1 -#endif - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff -Nru libbde-20190102/common/config_borlandc.h libbde-20240223/common/config_borlandc.h --- libbde-20190102/common/config_borlandc.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/config_borlandc.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Configuration for the Borland/CodeGear C++ Builder compiler * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _CONFIG_BORLANDC_H ) diff -Nru libbde-20190102/common/config_msc.h libbde-20240223/common/config_msc.h --- libbde-20190102/common/config_msc.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/config_msc.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Configuration for the Microsoft Visual Studio C++ compiler * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _CONFIG_MSC_H ) diff -Nru libbde-20190102/common/config_winapi.h libbde-20240223/common/config_winapi.h --- libbde-20190102/common/config_winapi.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/config_winapi.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Configuration file for WINAPI * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _CONFIG_WINAPI_H ) @@ -38,6 +38,27 @@ */ #define PACKAGE_BUGREPORT "joachim.metz@gmail.com" +/* Define the size of the integer for WINAPI + */ +#if !defined( SIZEOF_INT ) +#define SIZEOF_INT 4 +#endif + +/* Define the size of size_t for WINAPI + * Do not define when pyconfig.h has been included via python.h + */ +#if !defined( HAVE_PYCONFIG_H ) + +#if !defined( SIZEOF_SIZE_T ) +#if __WORDSIZE == 64 +#define SIZEOF_SIZE_T 8 +#else +#define SIZEOF_SIZE_T 4 +#endif +#endif + +#endif /* !defined( HAVE_PYCONFIG_H ) */ + /* Define the size of the wide character for WINAPI */ #if !defined( SIZEOF_WCHAR_T ) diff -Nru libbde-20190102/common/file_stream.h libbde-20240223/common/file_stream.h --- libbde-20190102/common/file_stream.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/file_stream.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * FILE stream functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _FILE_STREAM_H ) diff -Nru libbde-20190102/common/memory.h libbde-20240223/common/memory.h --- libbde-20190102/common/memory.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/memory.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _MEMORY_H ) @@ -40,6 +40,11 @@ extern "C" { #endif +/* Note that 128 MiB is an arbitrary selected upper limit here + */ +#define MEMORY_MAXIMUM_ALLOCATION_SIZE \ + ( 128 * 1024 * 1024 ) + /* Memory allocation */ #if defined( HAVE_GLIB_H ) diff -Nru libbde-20190102/common/narrow_string.h libbde-20240223/common/narrow_string.h --- libbde-20190102/common/narrow_string.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/narrow_string.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Narrow character string functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _NARROW_STRING_H ) @@ -122,8 +122,9 @@ (char *) memrchr( (void *) string, (int) character, size ) #elif defined( HAVE_STRRCHR ) || defined( WINAPI ) +/* (void)(size) is used to suppress unused variable warnings */ #define narrow_string_search_character_reverse( string, character, size ) \ - strrchr( string, (int) character ) + strrchr( string, (int) character ); (void)(size) #endif /* String sub-string search diff -Nru libbde-20190102/common/system_string.h libbde-20240223/common/system_string.h --- libbde-20190102/common/system_string.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/system_string.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * System character string functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _SYSTEM_STRING_H ) diff -Nru libbde-20190102/common/types.h libbde-20240223/common/types.h --- libbde-20190102/common/types.h 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/common/types.h 2024-02-23 03:04:01.000000000 +0000 @@ -1,22 +1,22 @@ /* - * Type and type-support defintions + * Type and type-support definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _TYPES_H ) @@ -60,7 +60,10 @@ #endif /* defined( WINAPI ) && ( defined( _UNICODE ) || defined( UNICODE ) ) */ /* Fallback for systems without PRI definitions + * Do not define when pyconfig.h has been included via python.h */ +#if !defined( HAVE_PYCONFIG_H ) + #if !defined( PRId8 ) #define PRId8 "d" #endif @@ -214,7 +217,9 @@ #define PRIx64 "llx" #endif -#endif /*!defined( PRIx64 ) */ +#endif /* !defined( PRIx64 ) */ + +#endif /* !defined( HAVE_PYCONFIG_H ) */ /* Fallback for systems without printf %jd definition */ @@ -305,6 +310,16 @@ #define UINT32_MAX (0xffffffffUL) #endif +/* The minimum signed 64-bit integer is -9223372036854775808 (0x8000000000000000) + */ +#if !defined( INT64_MIN ) +#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) +#define INT64_MIN (0x8000000000000000UL) +#else +#define INT64_MIN (0x8000000000000000ULL) +#endif +#endif /* !defined( INT64_MIN ) */ + /* The maximum signed 64-bit integer is 9223372036854775807 (0x7fffffffffffffff) */ #if !defined( INT64_MAX ) diff -Nru libbde-20190102/common/types.h.in libbde-20240223/common/types.h.in --- libbde-20190102/common/types.h.in 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/types.h.in 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* - * Type and type-support defintions + * Type and type-support definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _TYPES_H ) @@ -60,7 +60,10 @@ #endif /* defined( WINAPI ) && ( defined( _UNICODE ) || defined( UNICODE ) ) */ /* Fallback for systems without PRI definitions + * Do not define when pyconfig.h has been included via python.h */ +#if !defined( HAVE_PYCONFIG_H ) + #if !defined( PRId8 ) #define PRId8 "d" #endif @@ -214,7 +217,9 @@ #define PRIx64 "llx" #endif -#endif /*!defined( PRIx64 ) */ +#endif /* !defined( PRIx64 ) */ + +#endif /* !defined( HAVE_PYCONFIG_H ) */ /* Fallback for systems without printf %jd definition */ @@ -305,6 +310,16 @@ #define UINT32_MAX (0xffffffffUL) #endif +/* The minimum signed 64-bit integer is -9223372036854775808 (0x8000000000000000) + */ +#if !defined( INT64_MIN ) +#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) +#define INT64_MIN (0x8000000000000000UL) +#else +#define INT64_MIN (0x8000000000000000ULL) +#endif +#endif /* !defined( INT64_MIN ) */ + /* The maximum signed 64-bit integer is 9223372036854775807 (0x7fffffffffffffff) */ #if !defined( INT64_MAX ) diff -Nru libbde-20190102/common/wide_string.h libbde-20240223/common/wide_string.h --- libbde-20190102/common/wide_string.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/common/wide_string.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Wide character string functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _WIDE_STRING_H ) @@ -120,8 +120,9 @@ (wchar_t *) wmemrchr( (void *) string, (wchar_t) character, size ) #elif defined( HAVE_WCSRCHR ) || defined( WINAPI ) +/* (void)(size) is used to suppress unused variable warnings */ #define wide_string_search_character_reverse( string, character, size ) \ - wcsrchr( string, (wchar_t) character ) + wcsrchr( string, (wchar_t) character ); (void)(size) #endif /* String sub-string search diff -Nru libbde-20190102/compile libbde-20240223/compile --- libbde-20190102/compile 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/compile 2024-02-23 03:03:50.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -Nru libbde-20190102/config.guess libbde-20240223/config.guess --- libbde-20190102/config.guess 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/config.guess 2024-02-23 03:03:50.000000000 +0000 @@ -1,12 +1,14 @@ -#! /bin/sh +#!/usr/bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2023 Free Software Foundation, Inc. -timestamp='2018-03-08' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2023-06-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -27,17 +29,25 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -50,13 +60,13 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -84,85 +94,103 @@ exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > "$dummy.c" ; - for c in cc gcc c89 c99 ; do - if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval "$set_cc_for_build" + set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -174,12 +202,12 @@ # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; @@ -188,18 +216,18 @@ earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval "$set_cc_for_build" + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -215,7 +243,7 @@ ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` @@ -226,7 +254,7 @@ # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; @@ -237,45 +265,57 @@ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS=$UNAME_MACHINE-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -289,7 +329,7 @@ # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -326,117 +366,121 @@ # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval "$set_cc_for_build" + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; + # Japanese Language versions have a version number like '4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + case `/bin/arch` in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -446,43 +490,43 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval "$set_cc_for_build" + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ @@ -508,78 +552,79 @@ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval "$set_cc_for_build" + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include @@ -593,16 +638,16 @@ EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then @@ -610,57 +655,57 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then - eval "$set_cc_for_build" + if test "$HP_ARCH" = ""; then + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE @@ -698,9 +743,9 @@ test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then - eval "$set_cc_for_build" + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -719,14 +764,14 @@ HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval "$set_cc_for_build" + set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int @@ -754,36 +799,36 @@ EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -791,17 +836,18 @@ fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -809,103 +855,135 @@ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; - i*86:Minix:*:*) - echo "$UNAME_MACHINE"-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -916,183 +994,236 @@ esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval "$set_cc_for_build" + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval "$set_cc_for_build" + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" - test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac + fi + GUESS=$CPU-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1100,12 +1231,12 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1115,11 +1246,11 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1127,31 +1258,31 @@ # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1176,249 +1307,407 @@ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=i586-pc-haiku + ;; + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval "$set_cc_for_build" - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + echo "$0: unable to guess system type" >&2 -case "$UNAME_MACHINE:$UNAME_SYSTEM" in +case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <, 1996 # @@ -25,7 +25,7 @@ # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so @@ -57,13 +57,6 @@ aix*) wl='-Wl,' ;; - darwin*) - case $cc_basename in - xlc*) - wl='-Wl,' - ;; - esac - ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) @@ -72,9 +65,7 @@ irix5* | irix6* | nonstopux*) wl='-Wl,' ;; - newsos6) - ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' @@ -85,17 +76,26 @@ lf95*) wl='-Wl,' ;; - pgcc | pgf77 | pgf90) + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; *Sun\ C*) wl='-Wl,' ;; @@ -103,13 +103,24 @@ ;; esac ;; + newsos6) + ;; + *nto* | *qnx*) + ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) - wl='-Wl,' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac ;; sunos4*) wl='-Qoption ld ' @@ -171,15 +182,14 @@ fi ;; amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we cannot use - # them. - ld_shlibs=no + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then @@ -198,11 +208,13 @@ ld_shlibs=no fi ;; + haiku*) + ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; - gnu* | linux* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else @@ -325,10 +337,14 @@ fi ;; amigaos*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac ;; bsdi[45]*) ;; @@ -342,29 +358,16 @@ ;; darwin* | rhapsody*) hardcode_direct=no - if test "$GCC" = yes ; then + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else - case $cc_basename in - xlc*) - ;; - *) - ld_shlibs=no - ;; - esac + ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; - freebsd1*) - ld_shlibs=no - ;; - freebsd2.2*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - freebsd2*) + freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; @@ -420,6 +423,8 @@ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; + *nto* | *qnx*) + ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes @@ -515,7 +520,12 @@ library_names_spec='$libname$shrext' ;; amigaos*) - library_names_spec='$libname.a' + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac ;; beos*) library_names_spec='$libname$shrext' @@ -534,19 +544,18 @@ dgux*) library_names_spec='$libname$shrext' ;; - freebsd1*) + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) - case "$host_os" in - freebsd[123]*) - library_names_spec='$libname$shrext$versuffix' ;; - *) - library_names_spec='$libname$shrext' ;; - esac + library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; + haiku*) + library_names_spec='$libname$shrext' + ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) @@ -582,7 +591,7 @@ ;; linux*oldld* | linux*aout* | linux*coff*) ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) @@ -594,7 +603,7 @@ newsos6) library_names_spec='$libname$shrext' ;; - nto-qnx*) + *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) @@ -625,6 +634,9 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; + tpf*) + library_names_spec='$libname$shrext' + ;; uts4*) library_names_spec='$libname$shrext' ;; diff -Nru libbde-20190102/config.sub libbde-20240223/config.sub --- libbde-20190102/config.sub 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/config.sub 2024-02-23 03:03:50.000000000 +0000 @@ -1,12 +1,14 @@ -#! /bin/sh +#!/usr/bin/sh # Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. +# Copyright 1992-2023 Free Software Foundation, Inc. -timestamp='2018-05-05' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2023-06-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -33,7 +35,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -67,13 +76,13 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 1992-2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -89,7 +98,7 @@ - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) @@ -110,1249 +119,1186 @@ exit 1;; esac -# Spilt fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 + ;; *-*-*-*) basic_machine=$field1-$field2 - os=-$field3-$field4 + basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) basic_machine=$field1 - os=-$maybe_os + basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown - os=-linux-android + basic_os=linux-android ;; *) basic_machine=$field1-$field2 - os=-$field3 + basic_os=$field3 ;; esac ;; *-*) - basic_machine=$field1 - os=-$field2 + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; *) - basic_machine=$1 - os= - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper | csky \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nfp \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m9s12z | m68hcs12z | hcs12z | s12z) - basic_machine=s12z-unknown - os=-none + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nfp-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-pc - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + basic_os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + basic_os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx + cpu=m68k + vendor=motorola ;; dpx2*) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + cpu=m68k + vendor=bull + basic_os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 ;; i*86v4*) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 ;; i*86v) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv ;; i*86sol2) - basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - vsta) - basic_machine=i386-unknown - os=-vsta + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) + cpu=mips + vendor=sgi + case $basic_os in + irix*) ;; *) - os=-irix4 + basic_os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent + cpu=m68000 + vendor=convergent ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv + cpu=mips + vendor=sony + basic_os=newsos ;; next | m*-next) - basic_machine=m68k-next - case $os in - -nextstep* ) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + basic_os=nextstep2 ;; *) - os=-nextstep3 + basic_os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsv-tandem) - basic_machine=nsv-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + basic_os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti + cpu=m68k + vendor=tti ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 + pc532) + cpu=ns32k + vendor=pc532 ;; - pc98) - basic_machine=i386-pc + pn) + cpu=pn + vendor=gould ;; - pc98-*) - basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc + ps2) + cpu=i386 + vendor=ibm ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc + rm[46]00) + cpu=mips + vendor=siemens ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc + rtpc | rtpc-*) + cpu=romp + vendor=ibm ;; - pentium4) - basic_machine=i786-pc + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + tower | tower-32) + cpu=m68k + vendor=ncr ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - pentium4-*) - basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + w65) + cpu=w65 + vendor=wdc ;; - pn) - basic_machine=pn-gould + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf ;; - power) basic_machine=power-ibm + none) + cpu=none + vendor=none ;; - ppc | ppcbe) basic_machine=powerpc-unknown + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1360,209 +1306,219 @@ # Decode manufacturer-specific aliases for certain operating systems. -if [ x$os != x ] +if test x$basic_os != x then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1575,254 +1531,372 @@ # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; pru-*) - os=-elf + os=elf ;; *-be) - os=-beos + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; *-next) - os=-nextstep + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* | mlibc* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + kernel* ) + # Restricted further below + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) + ;; + uclinux-uclibc* ) + ;; + managarm-mlibc* | managarm-kernel* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + -kernel* ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel* ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - -os400*) + s390-* | s390x-*) vendor=ibm ;; - -ptx*) + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo "$basic_machine$os" +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: diff -Nru libbde-20190102/configure libbde-20240223/configure --- libbde-20190102/configure 2019-01-02 15:57:49.000000000 +0000 +++ libbde-20240223/configure 2024-02-23 03:03:49.000000000 +0000 @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libbde 20190102. +# Generated by GNU Autoconf 2.71 for libbde 20240223. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,18 +169,20 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -206,31 +190,40 @@ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,18 +263,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: joachim.metz@gmail.com about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a @@ -302,6 +303,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -590,48 +621,44 @@ # Identity of this package. PACKAGE_NAME='libbde' PACKAGE_TARNAME='libbde' -PACKAGE_VERSION='20190102' -PACKAGE_STRING='libbde 20190102' +PACKAGE_VERSION='20240223' +PACKAGE_STRING='libbde 20240223' PACKAGE_BUGREPORT='joachim.metz@gmail.com' PACKAGE_URL='' ac_unique_file="include/libbde.h.in" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE @@ -641,9 +668,12 @@ DPKG_DATE libbde_spec_tools_build_requires libbde_spec_requires -LIBBDE_DLL_EXPORT +LIB_FUZZING_ENGINE +HAVE_LIB_FUZZING_ENGINE_FALSE +HAVE_LIB_FUZZING_ENGINE_TRUE LIBBDE_DLL_IMPORT -STATIC_LDFLAGS +LIBBDE_DLL_EXPORT +HAVE_DLLMAIN ax_libfuse_spec_build_requires ax_libfuse_spec_requires ax_libfuse_pc_libs_private @@ -654,36 +684,8 @@ fuse_CFLAGS HAVE_PYTHON_TESTS_FALSE HAVE_PYTHON_TESTS_TRUE -HAVE_PYTHON3_FALSE -HAVE_PYTHON3_TRUE -HAVE_PYTHON2_FALSE -HAVE_PYTHON2_TRUE HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE -PYTHON3_PACKAGE_DIR -PYTHON3_LIBRARY_DIR -pyexecdir3 -pythondir3 -PYTHON3_EXEC_PREFIX -PYTHON3_PREFIX -PYTHON3_LDFLAGS -PYTHON3_CPPFLAGS -PYTHON3_CONFIG -PYTHON3_PLATFORM -PYTHON3_VERSION -PYTHON3 -PYTHON2_PACKAGE_DIR -PYTHON2_LIBRARY_DIR -pyexecdir2 -pythondir2 -PYTHON2_EXEC_PREFIX -PYTHON2_PREFIX -PYTHON2_LDFLAGS -PYTHON2_CPPFLAGS -PYTHON2_CONFIG -PYTHON2_PLATFORM -PYTHON2_VERSION -PYTHON2 PYTHON_PACKAGE_DIR PYTHON_LIBRARY_DIR pyexecdir @@ -694,9 +696,7 @@ PYTHON_CPPFLAGS PYTHON_CONFIG PYTHON_PLATFORM -PYTHON_VERSION PYTHON -HAVE_DLLMAIN ax_libcaes_spec_build_requires ax_libcaes_spec_requires ax_libcaes_pc_libs_private @@ -761,17 +761,6 @@ HAVE_LIBFDATETIME libfdatetime_LIBS libfdatetime_CFLAGS -ax_libfdata_spec_build_requires -ax_libfdata_spec_requires -ax_libfdata_pc_libs_private -LIBFDATA_LIBADD -LIBFDATA_CPPFLAGS -HAVE_LOCAL_LIBFDATA_FALSE -HAVE_LOCAL_LIBFDATA_TRUE -HAVE_LOCAL_LIBFDATA -HAVE_LIBFDATA -libfdata_LIBS -libfdata_CFLAGS ax_libfcache_spec_build_requires ax_libfcache_spec_requires ax_libfcache_pc_libs_private @@ -911,6 +900,7 @@ HAVE_INTTYPES_H HAVE_SYS_TYPES_H HAVE_WIDE_CHARACTER_TYPE +STATIC_LDFLAGS POSUB LTLIBINTL LIBINTL @@ -919,17 +909,25 @@ LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS +MSGMERGE_FOR_MSGFMT_OPTION MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 -MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS PKGCONFIG LIBTOOL_DEPS +CXXCPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL @@ -940,17 +938,16 @@ RANLIB ac_ct_AR AR +FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP -SED -LIBTOOL EGREP GREP -CPP +SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -967,6 +964,7 @@ LDFLAGS CFLAGS CC +LIBTOOL OBJDUMP DLLTOOL AS @@ -982,6 +980,9 @@ AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -1024,6 +1025,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -1048,12 +1050,12 @@ ac_user_opts=' enable_option_checking enable_silent_rules -enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname +enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock @@ -1063,6 +1065,7 @@ with_libintl_prefix enable_largefile enable_shared_libs +enable_static_executables enable_winapi enable_wide_character_type enable_verbose_output @@ -1080,7 +1083,6 @@ with_libcpath with_libbfio with_libfcache -with_libfdata with_libfdatetime with_libfguid with_libfvalue @@ -1092,12 +1094,7 @@ with_pyprefix enable_python with_pythondir -enable_python2 -with_pythondir2 -enable_python3 -with_pythondir3 with_libfuse -enable_static_executables ' ac_precious_vars='build_alias host_alias @@ -1107,8 +1104,12 @@ LDFLAGS LIBS CPPFLAGS -CPP LT_SYS_LIBRARY_PATH +CPP +CXX +CXXFLAGS +CCC +CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR @@ -1134,8 +1135,6 @@ libbfio_LIBS libfcache_CFLAGS libfcache_LIBS -libfdata_CFLAGS -libfdata_LIBS libfdatetime_CFLAGS libfdatetime_LIBS libfguid_CFLAGS @@ -1188,6 +1187,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1217,8 +1217,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -1259,9 +1257,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1285,9 +1283,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1440,6 +1438,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1489,9 +1496,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1505,9 +1512,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1551,9 +1558,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1569,7 +1576,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1577,7 +1584,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1633,7 +1640,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1690,7 +1697,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libbde 20190102 to adapt to many kinds of systems. +\`configure' configures libbde 20240223 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1730,6 +1737,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1760,7 +1768,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libbde 20190102:";; + short | recursive ) echo "Configuration of libbde 20240223:";; esac cat <<\_ACEOF @@ -1770,19 +1778,21 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --disable-largefile omit support for large files --disable-shared-libs disable shared library support + --enable-static-executables + build static executables (binaries) [default=no] --enable-winapi enable WINAPI support for cross-compilation [default=auto-detect] --enable-wide-character-type @@ -1797,10 +1807,6 @@ --enable-openssl-evp-md enable OpenSSL EVP MD support, or no to disable [default=auto-detect] --enable-python build Python bindings [default=no] - --enable-python2 build Python 2 bindings [default=no] - --enable-python3 build Python 3 bindings [default=no] - --enable-static-executables - build static executables (binaries) [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1813,7 +1819,7 @@ --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib @@ -1855,9 +1861,6 @@ --with-libfcache[=DIR] search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version [default=auto-detect] - --with-libfdata[=DIR] search for libfdata in includedir and libdir or in - the specified DIR, or no if to use local version - [default=auto-detect] --with-libfdatetime[=DIR] search for libfdatetime in includedir and libdir or in the specified DIR, or no if to use local version @@ -1881,10 +1884,6 @@ of pythondir instead of --prefix [default=no] --with-pythondir[=no] use to specify the Python directory (pythondir) [default=no] - --with-pythondir2[=no] use to specify the Python 2 directory (pythondir2) - [default=no] - --with-pythondir3[=no] use to specify the Python 3 directory (pythondir3) - [default=no] --with-libfuse[=DIR] search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse [default=auto-detect] @@ -1897,9 +1896,12 @@ LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory - CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path @@ -1948,10 +1950,6 @@ C compiler flags for libfcache, overriding pkg-config libfcache_LIBS linker flags for libfcache, overriding pkg-config - libfdata_CFLAGS - C compiler flags for libfdata, overriding pkg-config - libfdata_LIBS - linker flags for libfdata, overriding pkg-config libfdatetime_CFLAGS C compiler flags for libfdatetime, overriding pkg-config libfdatetime_LIBS @@ -1998,9 +1996,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -2028,7 +2026,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -2036,7 +2035,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -2045,10 +2044,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libbde configure 20190102 -generated by GNU Autoconf 2.69 +libbde configure 20240223 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -2065,14 +2064,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2080,14 +2079,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2097,57 +2097,20 @@ } # ac_fn_c_try_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -2155,17 +2118,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -2187,83 +2151,44 @@ ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -2271,16 +2196,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2298,118 +2216,233 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------- ## -## Report this to joachim.metz@gmail.com ## -## ------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -} # ac_fn_c_check_header_mongrel +} # ac_fn_c_try_run # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- @@ -2418,17 +2451,18 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2436,12 +2470,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2449,18 +2484,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -2479,7 +2515,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -2489,14 +2525,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2506,9 +2543,10 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break -else +else $as_nop as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -2516,14 +2554,14 @@ fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -2533,14 +2571,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -2550,9 +2589,10 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break -else +else $as_nop as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -2560,14 +2600,14 @@ fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -2575,7 +2615,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2585,12 +2625,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid -else +else $as_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -2600,12 +2641,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -2633,9 +2674,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 &5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { #ifndef $as_decl_name #ifdef __cplusplus @@ -2680,27 +2725,50 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_check_decl +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libbde $as_me 20190102, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by libbde $as_me 20240223, which was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2733,8 +2801,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2769,7 +2841,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2804,11 +2876,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2819,8 +2893,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2844,7 +2918,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2852,14 +2926,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2867,15 +2941,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2883,8 +2957,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2898,63 +2972,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2964,20 +3023,651 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + gt_needs="$gt_needs " + +# Auxiliary files required by this configure script. +ac_aux_files="config.rpath compile ltmain.sh config.guess config.sub missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2988,12 +3678,12 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -3002,24 +3692,24 @@ ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -3029,11 +3719,12 @@ fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -3051,36 +3742,9 @@ am__api_version='1.16' -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Find a good install program. We prefer a C program (faster), + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -3094,20 +3758,25 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -3117,13 +3786,13 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -3131,12 +3800,12 @@ echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -3152,7 +3821,7 @@ rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -3162,8 +3831,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -3173,8 +3842,8 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -3228,8 +3897,8 @@ as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -3248,26 +3917,23 @@ # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -3287,11 +3953,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -3299,11 +3966,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3314,11 +3985,11 @@ fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3327,11 +3998,12 @@ ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -3339,11 +4011,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3354,11 +4030,11 @@ fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -3366,8 +4042,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -3379,25 +4055,31 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -3408,7 +4090,7 @@ fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -3418,18 +4100,19 @@ MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -3437,11 +4120,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3452,24 +4139,25 @@ fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -3485,12 +4173,12 @@ rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3504,7 +4192,8 @@ rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3514,12 +4203,13 @@ *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3531,8 +4221,8 @@ am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3564,17 +4254,13 @@ # Define the identity of the package. PACKAGE='libbde' - VERSION='20190102' + VERSION='20240223' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3620,29 +4306,29 @@ # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 -$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } _am_tools=none fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 -$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } _am_tools=none fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -$as_echo_n "checking how to create a ustar tar archive... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. @@ -3717,17 +4403,32 @@ done rm -rf conftest.dir - if ${am_cv_prog_tar_ustar+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else $as_nop am_cv_prog_tar_ustar=$_am_tool fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 -$as_echo "$am_cv_prog_tar_ustar" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi @@ -3776,26 +4477,30 @@ -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -3814,21 +4519,22 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -3848,302 +4554,98 @@ -enable_win32_dll=yes +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +macro_version='2.4.7' +macro_revision='2.4.7' -fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +ltmain=$ac_aux_dir/ltmain.sh - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - OBJDUMP="$ac_cv_prog_OBJDUMP" + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi - ;; +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac -test -z "$AS" && AS=as -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$OBJDUMP" && OBJDUMP=objdump @@ -4152,6 +4654,74 @@ + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4160,11 +4730,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4172,11 +4743,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4187,11 +4762,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4200,11 +4775,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4212,11 +4788,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4227,11 +4807,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -4239,8 +4819,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4253,11 +4833,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4265,11 +4846,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4280,11 +4865,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4293,11 +4878,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4306,15 +4892,19 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4330,18 +4920,18 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4352,11 +4942,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -4364,11 +4955,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4379,11 +4974,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4396,11 +4991,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -4408,11 +5004,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4423,11 +5023,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4439,34 +5039,138 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi +else + CC="$ac_cv_prog_CC" fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4476,7 +5180,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -4484,7 +5188,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -4496,9 +5200,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -4519,11 +5223,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -4540,7 +5245,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -4556,44 +5261,46 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -4607,15 +5314,15 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -4624,7 +5331,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -4636,8 +5343,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -4645,10 +5352,10 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4656,39 +5363,40 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4702,11 +5410,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -4715,31 +5424,32 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -4749,29 +5459,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4780,57 +5494,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4845,94 +5562,144 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4941,21 +5708,23 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4983,8 +5752,8 @@ rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4999,77 +5768,15 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -5176,8 +5883,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -5191,150 +5898,100 @@ fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi else - # Broken: fails on valid input. -continue + ac_cv_path_SED=$SED fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break fi -rm -f conftest.err conftest.i conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" - done - ac_cv_prog_CPP=$CPP -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -5342,10 +5999,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -5354,13 +6016,13 @@ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5388,16 +6050,17 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -5408,10 +6071,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -5420,13 +6088,13 @@ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5455,267 +6123,17 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -if test $ac_cv_c_compiler_gnu = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -$as_echo_n "checking whether $CC needs -traditional... " >&6; } -if ${ac_cv_prog_gcc_traditional+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then : - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -$as_echo "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.6' -macro_revision='2.4.6' - - - - - - - - - - - - - -ltmain=$ac_aux_dir/ltmain.sh - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -5726,10 +6144,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -5738,13 +6161,13 @@ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5773,8 +6196,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -5799,17 +6222,18 @@ # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -5838,15 +6262,16 @@ ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -5875,18 +6300,19 @@ LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -5909,11 +6335,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -5938,13 +6365,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5963,8 +6390,8 @@ : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -5977,11 +6404,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -5989,11 +6417,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6004,11 +6436,11 @@ fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6021,11 +6453,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -6033,11 +6466,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6048,11 +6485,11 @@ fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6064,15 +6501,15 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -6093,11 +6530,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -6113,26 +6551,27 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -6174,7 +6613,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -6217,7 +6656,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -6259,11 +6698,11 @@ fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -6307,11 +6746,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in @@ -6347,18 +6787,19 @@ fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in @@ -6374,22 +6815,23 @@ fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -6420,13 +6862,122 @@ if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + +if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -6434,11 +6985,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6449,11 +7004,11 @@ fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6462,11 +7017,12 @@ ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -6474,11 +7030,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6489,11 +7049,11 @@ fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -6501,8 +7061,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -6518,11 +7078,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -6548,7 +7109,7 @@ bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -6582,14 +7143,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -6603,7 +7164,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -6650,7 +7211,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -6718,8 +7279,8 @@ esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no @@ -6763,11 +7324,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -6775,11 +7337,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6790,11 +7356,11 @@ fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6803,11 +7369,12 @@ ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -6815,11 +7382,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6830,11 +7401,11 @@ fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -6842,8 +7413,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -6860,11 +7431,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in @@ -6887,8 +7459,8 @@ esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -6898,16 +7470,18 @@ + if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6915,11 +7489,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6930,11 +7508,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6947,11 +7525,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -6959,11 +7538,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6974,11 +7557,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6990,8 +7573,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6999,42 +7582,60 @@ fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -7042,7 +7643,7 @@ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -7051,11 +7652,11 @@ rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= @@ -7072,11 +7673,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -7084,11 +7686,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7099,11 +7705,11 @@ fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7112,11 +7718,12 @@ ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -7124,11 +7731,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7139,11 +7750,11 @@ fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -7151,8 +7762,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -7171,11 +7782,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -7183,11 +7795,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7198,11 +7814,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7211,11 +7827,12 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -7223,11 +7840,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7238,11 +7859,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -7250,8 +7871,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -7340,11 +7961,12 @@ # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -7399,7 +8021,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -7417,20 +8039,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -7454,7 +8076,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -7472,9 +8094,9 @@ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7496,14 +8118,14 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -7572,7 +8194,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -7607,11 +8229,11 @@ lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -7657,13 +8279,14 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -7676,29 +8299,30 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -7709,10 +8333,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -7732,15 +8361,16 @@ rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -7751,8 +8381,8 @@ rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -7775,7 +8405,8 @@ } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -7791,9 +8422,9 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -7811,10 +8442,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -7826,7 +8457,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -7849,10 +8480,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -7860,7 +8491,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -7868,7 +8499,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -7890,16 +8521,16 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -7953,11 +8584,12 @@ # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7968,19 +8600,20 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7989,8 +8622,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -8003,9 +8636,9 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -8040,11 +8673,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -8052,11 +8686,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8067,11 +8705,11 @@ fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8080,11 +8718,12 @@ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -8092,11 +8731,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8107,11 +8750,11 @@ fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -8119,8 +8762,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -8130,11 +8773,12 @@ fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out @@ -8144,8 +8788,8 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -8160,11 +8804,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -8172,11 +8817,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8187,11 +8836,11 @@ fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8200,11 +8849,12 @@ ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -8212,11 +8862,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8227,11 +8881,11 @@ fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -8239,8 +8893,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -8252,11 +8906,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -8264,11 +8919,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8279,11 +8938,11 @@ fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8292,11 +8951,12 @@ ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -8304,11 +8964,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8319,11 +8983,11 @@ fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -8331,8 +8995,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -8344,11 +9008,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -8356,11 +9021,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8371,11 +9040,11 @@ fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8384,11 +9053,12 @@ ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -8396,11 +9066,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8411,11 +9085,11 @@ fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -8423,8 +9097,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -8436,11 +9110,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -8448,11 +9123,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8463,11 +9142,11 @@ fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8476,11 +9155,12 @@ ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -8488,11 +9168,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8503,11 +9187,11 @@ fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -8515,8 +9199,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -8528,11 +9212,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -8540,11 +9225,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8555,11 +9244,11 @@ fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8568,11 +9257,12 @@ ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -8580,11 +9270,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8595,11 +9289,11 @@ fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -8607,8 +9301,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -8643,11 +9337,12 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -8676,14 +9371,15 @@ rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -8692,39 +9388,41 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -8744,24 +9442,19 @@ rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -8816,153 +9509,378 @@ esac } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +fi -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : + + + +# Set options +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. else - ac_cv_header_stdc=no -fi -rm -f conftest* +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } else - ac_cv_header_stdc=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f conftest* + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - ac_cv_header_stdc=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" fi -done + ;; +esac +test -z "$AS" && AS=as -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF -fi -done +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + -# Set options @@ -8971,7 +9889,8 @@ # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -8989,7 +9908,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -9002,7 +9921,8 @@ # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -9020,7 +9940,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -9034,7 +9954,8 @@ # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; @@ -9051,7 +9972,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop pic_mode=default fi @@ -9063,7 +9984,8 @@ # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -9081,7 +10003,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -9095,11 +10017,12 @@ shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; @@ -9108,18 +10031,19 @@ ;; esac lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -9201,11 +10125,12 @@ setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -9216,17 +10141,15 @@ fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -9247,8 +10170,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9272,11 +10195,12 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -9325,11 +10249,11 @@ MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9338,11 +10262,12 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -9391,11 +10316,11 @@ MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9480,11 +10405,12 @@ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -9515,8 +10441,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -9757,7 +10683,7 @@ lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9873,26 +10799,28 @@ ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -9923,8 +10851,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -9952,11 +10880,12 @@ # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -9980,8 +10909,8 @@ LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -9995,11 +10924,12 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -10042,19 +10972,20 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -10097,8 +11028,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -10106,19 +11037,19 @@ hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -10130,8 +11061,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -10175,15 +11106,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -10235,7 +11166,7 @@ whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10347,6 +11278,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -10361,7 +11293,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -10404,7 +11336,7 @@ compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -10416,7 +11348,7 @@ if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -10432,7 +11364,7 @@ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10564,7 +11496,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10686,21 +11618,23 @@ if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10715,7 +11649,7 @@ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10739,21 +11673,23 @@ if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10768,7 +11704,7 @@ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10831,12 +11767,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10877,7 +11813,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10918,8 +11854,8 @@ output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10953,7 +11889,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -11019,11 +11955,12 @@ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -11047,8 +11984,8 @@ LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -11088,28 +12025,30 @@ # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -11201,6 +12140,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11389,8 +12329,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -11426,18 +12366,19 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -11455,7 +12396,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -11469,8 +12410,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -11629,8 +12570,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -11892,7 +12833,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -11902,14 +12843,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11928,7 +12869,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11965,7 +12906,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11998,7 +12939,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -12191,9 +13132,10 @@ shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -12203,19 +13145,21 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -12450,8 +13394,8 @@ dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -12572,8 +13516,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -12597,8 +13541,8 @@ # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -12642,11 +13586,12 @@ darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12655,32 +13600,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -12700,14 +13644,16 @@ *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12716,41 +13662,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shl_load (); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12759,37 +13706,37 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12798,37 +13745,37 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12837,30 +13784,29 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dld_link (); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12899,11 +13845,12 @@ save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -12982,7 +13929,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -13000,16 +13947,17 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -13088,7 +14036,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -13106,8 +14054,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -13145,32 +14093,43 @@ striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi fi @@ -13185,13 +14144,13 @@ # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -13215,15 +14174,15 @@ fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -13260,1488 +14219,6997 @@ - -# Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKGCONFIG+:} false; then : - $as_echo_n "(cached) " >&6 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else - case $PKGCONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKGCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS - ;; -esac fi -PKGCONFIG=$ac_cv_path_PKGCONFIG -if test -n "$PKGCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 -$as_echo "$PKGCONFIG" >&6; } +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 -$as_echo_n "checking whether NLS is requested... " >&6; } - # Check whether --enable-nls was given. -if test "${enable_nls+set}" = set; then : - enableval=$enable_nls; USE_NLS=$enableval + CC=$ac_ct_CC + fi else - USE_NLS=yes + CC="$ac_cv_prog_CC" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 -$as_echo "$USE_NLS" >&6; } - - - - - GETTEXT_MACRO_VERSION=0.18 - +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: fi - rm -f conf$$.sh fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else - ac_executable_p="test -f" -fi -rm -f conf$$.file + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGFMT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$MSGFMT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; -esac +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi fi -MSGFMT="$ac_cv_path_MSGFMT" -if test "$MSGFMT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 -$as_echo "$MSGFMT" >&6; } +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GMSGFMT+:} false; then : - $as_echo_n "(cached) " >&6 + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac fi -GMSGFMT=$ac_cv_path_GMSGFMT -if test -n "$GMSGFMT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 -$as_echo "$GMSGFMT" >&6; } +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; - *) GMSGFMT_015=$GMSGFMT ;; - esac +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + test -n "$ac_ct_CC" && break +done -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' + if test "x$ac_ct_CC" = x; then + CC="" else - PATH_SEPARATOR=: + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC fi - rm -f conf$$.sh fi -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" fi -rm -f conf$$.file - -# Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XGETTEXT+:} false; then : - $as_echo_n "(cached) " >&6 +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else - case "$XGETTEXT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test "$XGETTEXT" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 -$as_echo "$XGETTEXT" >&6; } +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - rm -f messages.po - case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; - *) XGETTEXT_015=$XGETTEXT ;; +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' + if test "x$ac_ct_CC" = x; then + CC="" else - PATH_SEPARATOR=: + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC fi - rm -f conf$$.sh +else + CC="$ac_cv_prog_CC" fi -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" fi -rm -f conf$$.file -# Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MSGMERGE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$MSGMERGE" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then - ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no fi -MSGMERGE="$ac_cv_path_MSGMERGE" -if test "$MSGMERGE" != ":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 -$as_echo "$MSGMERGE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu - test -n "$localedir" || localedir='${datadir}/locale' +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ - test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ - ac_config_commands="$ac_config_commands po-directories" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" else - acl_final_prefix="$prefix" + CFLAGS="-g" fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' +else + if test "$GCC" = yes; then + CFLAGS="-O2" else - acl_final_exec_prefix="$exec_prefix" + CFLAGS= fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC fi -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 fi -if ${acl_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break fi done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. + rm -f core conftest* + unset am_i fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -LD="$acl_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + am_cv_CC_dependencies_compiler_type=none fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${acl_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 -$as_echo_n "checking for shared library run path origin... " >&6; } -if ${acl_cv_rpath+:} false; then : - $as_echo_n "(cached) " >&6 -else +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done + done + ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 -$as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; : + CPP=$ac_cv_prog_CPP else - enable_rpath=yes + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 -$as_echo_n "checking for 64-bit host... " >&6; } -if ${gl_cv_solaris_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test $ac_cv_c_compiler_gnu = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +printf %s "checking whether $CC needs -traditional... " >&6; } +if test ${ac_cv_prog_gcc_traditional+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : + ac_cv_prog_gcc_traditional=yes +else $as_nop + ac_cv_prog_gcc_traditional=no +fi +rm -rf conftest* -#ifdef _LP64 -sixtyfour bits -#endif + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sixtyfour bits" >/dev/null 2>&1; then : - gl_cv_solaris_64bit=yes + $EGREP "$ac_pattern" >/dev/null 2>&1 +then : + ac_cv_prog_gcc_traditional=yes +fi +rm -rf conftest* + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - gl_cv_solaris_64bit=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f conftest* + test -n "$CXX" && break + done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 -$as_echo "$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main (void) +{ - use_additional=yes + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +int +main (void) +{ - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi -# Check whether --with-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then : - withval=$with_libiconv_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +depcc="$CXX" am_compiler_list= - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break fi fi + done + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none fi - LIBICONV= - LTLIBICONV= - INCICONV= - LIBICONV_PREFIX= - HAVE_LIBICONV= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='iconv ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBICONV; do +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBICONV; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCICONV; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBICONV; do + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBICONV; do + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" - ;; - esac - done - fi - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done - fi + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +else + _lt_caught_CXX_error=yes +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no +# Source file extension for C++ test sources. +ac_ext=cpp +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + # ltmain only uses $CC for tagged configurations so make sure $CC is set. +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + if test yes = "$GXX"; then + # Set up default GNU C++ configuration +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 -$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } -if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : - $as_echo_n "(cached) " >&6 +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -CFPreferencesCopyAppValue(NULL, NULL) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gt_cv_func_CFPreferencesCopyAppValue=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } - if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - -$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 -$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } -if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : - $as_echo_n "(cached) " >&6 -else - gt_save_LIBS="$LIBS" - LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -CFLocaleCopyCurrent(); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gt_cv_func_CFLocaleCopyCurrent=yes +LD=$lt_cv_path_LD +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - gt_cv_func_CFLocaleCopyCurrent=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$gt_save_LIBS" +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 -$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - -$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld - fi - INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then - INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" - fi - LIBINTL= - LTLIBINTL= - POSUB= + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= - case " $gt_needs " in - *" need-formatstring-macros "*) gt_api_version=3 ;; - *" need-ngettext "*) gt_api_version=2 ;; - *) gt_api_version=1 ;; - esac - gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" - gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + GXX=no + with_gnu_ld=no + wlarc= + fi - if test $gt_api_version -ge 3; then - gt_revision_test_code=' -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -' + # PORTME: fill in a description of your system's C++ link characteristics + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= else - gt_revision_test_code= + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' fi - if test $gt_api_version -ge 2; then - gt_expression_test_code=' + * ngettext ("", "", 0)' + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' else - gt_expression_test_code= + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 -$as_echo_n "checking for GNU gettext in libc... " >&6; } -if eval \${$gt_func_gnugettext_libc+:} false; then : - $as_echo_n "(cached) " >&6 + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; + int -main () +main (void) { -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$gt_func_gnugettext_libc=yes" -else - eval "$gt_func_gnugettext_libc=no" +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$gt_func_gnugettext_libc - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then - - - - - - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +fi - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done + aix_libpath=$lt_cv_aix_libpath__CXX +fi + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } -if ${am_cv_func_iconv+:} false; then : - $as_echo_n "(cached) " >&6 + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + int -main () +main (void) { -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_func_iconv=yes +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_lib_iconv=yes - am_cv_func_iconv=yes + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi + aix_libpath=$lt_cv_aix_libpath__CXX fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 -$as_echo "$am_cv_func_iconv" >&6; } - if test "$am_cv_func_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 -$as_echo_n "checking for working iconv... " >&6; } -if ${am_cv_func_iconv_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - am_save_LIBS="$LIBS" - if test $am_cv_lib_iconv = yes; then - LIBS="$LIBS $LIBICONV" - fi - if test "$cross_compiling" = yes; then : - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; -#include -#include -int main () -{ - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ - { - iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); - if (cd_utf8_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\342\202\254"; /* EURO SIGN */ - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } - /* Test against Solaris 10 bug: Failures are not distinguishable from - successful returns. */ - { - iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); - if (cd_ascii_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\263"; - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } -#if 0 /* This bug could be worked around by the caller. */ - /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ - { - iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); - if (cd_88591_to_utf8 != (iconv_t)(-1)) - { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; - char buf[50]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if ((int)res > 0) - return 1; - } - } -#endif - /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is - provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - am_cv_func_iconv_works=yes -else - am_cv_func_iconv_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; - LIBS="$am_save_LIBS" + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 -$as_echo "$am_cv_func_iconv_works" >&6; } - case "$am_cv_func_iconv_works" in - *no) am_func_iconv=no am_cv_lib_iconv=no ;; - *) am_func_iconv=yes ;; - esac - else - am_func_iconv=no am_cv_lib_iconv=no - fi - if test "$am_func_iconv" = yes; then -$as_echo "#define HAVE_ICONV 1" >>confdefs.h + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec_CXX='' fi - if test "$am_cv_lib_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 -$as_echo_n "checking how to link with libiconv... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 -$as_echo "$LIBICONV" >&6; } + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= + ld_shlibs_CXX=no fi + ;; + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' + ;; + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac - use_additional=yes + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -# Check whether --with-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then : - withval=$with_libintl_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; -fi + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl* | icl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl* | *,icl*) + # Native MSVC or ICC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC and ICC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly* | midnightbsd*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + + +# Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKGCONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKGCONFIG="$PKGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKGCONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKGCONFIG=$ac_cv_path_PKGCONFIG +if test -n "$PKGCONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5 +printf "%s\n" "$PKGCONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 +printf %s "checking whether NLS is requested... " >&6; } + # Check whether --enable-nls was given. +if test ${enable_nls+y} +then : + enableval=$enable_nls; USE_NLS=$enableval +else $as_nop + USE_NLS=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } + + + + + GETTEXT_MACRO_VERSION=0.20 + + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGFMT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case "$MSGFMT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 +printf "%s\n" "$MSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GMSGFMT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT +if test -n "$GMSGFMT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 +printf "%s\n" "$GMSGFMT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_XGETTEXT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case "$XGETTEXT" in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 +printf "%s\n" "$XGETTEXT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + rm -f messages.po + + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac + + + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_MSGMERGE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case "$MSGMERGE" in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$ac_save_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&5 + if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$ac_save_IFS" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; +esac +fi +MSGMERGE="$ac_cv_path_MSGMERGE" +if test "$MSGMERGE" != ":"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 +printf "%s\n" "$MSGMERGE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' + else + if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' + else + MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' + fi + fi + + + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + + + ac_config_commands="$ac_config_commands po-directories" + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +printf %s "checking for ld... " >&6; } +elif test "$GCC" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } +elif test "$with_gnu_ld" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if test ${acl_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + sparc64-*-netbsd*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # The compiler produces 32-bit code. Add option '-m elf32_sparc' + # so that the linker groks 32-bit object files. + case "$acl_cv_path_LD " in + *" -m elf32_sparc "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; + esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + esac + +fi + + LD="$acl_cv_path_LD" +fi +if test -n "$LD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${acl_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +printf %s "checking for shared library run path origin... " >&6; } +if test ${acl_cv_rpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +printf "%s\n" "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test ${enable_rpath+y} +then : + enableval=$enable_rpath; : +else $as_nop + enable_rpath=yes +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5 +printf %s "checking 32-bit host C ABI... " >&6; } +if test ${gl_cv_host_cpu_c_abi_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$gl_cv_host_cpu_c_abi"; then + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; + x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; + esac + else + case "$host_cpu" in + + # CPUs that only support a 32-bit ABI. + arc \ + | bfin \ + | cris* \ + | csky \ + | epiphany \ + | ft32 \ + | h8300 \ + | m68k \ + | microblaze | microblazeel \ + | nds32 | nds32le | nds32be \ + | nios2 | nios2eb | nios2el \ + | or1k* \ + | or32 \ + | sh | sh1234 | sh1234elb \ + | tic6x \ + | xtensa* ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + # CPUs that only support a 64-bit ABI. + alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ + | mmix ) + gl_cv_host_cpu_c_abi_32bit=no + ;; + + i[34567]86 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) \ + && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=yes +else $as_nop + gl_cv_host_cpu_c_abi_32bit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + riscv32 | riscv64 ) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + gl_cv_host_cpu_c_abi_32bit=no +else $as_nop + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + + *) + gl_cv_host_cpu_c_abi_32bit=unknown + ;; + esac + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5 +printf "%s\n" "$gl_cv_host_cpu_c_abi_32bit" >&6; } + + HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5 +printf %s "checking for ELF binary format... " >&6; } +if test ${gl_cv_elf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __ELF__ + Extensible Linking Format + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Extensible Linking Format" >/dev/null 2>&1 +then : + gl_cv_elf=yes +else $as_nop + gl_cv_elf=no +fi +rm -rf conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5 +printf "%s\n" "$gl_cv_elf" >&6; } + if test $gl_cv_elf; then + # Extract the ELF class of a file (5th byte) in decimal. + # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header + if od -A x < /dev/null >/dev/null 2>/dev/null; then + # Use POSIX od. + func_elfclass () + { + od -A n -t d1 -j 4 -N 1 + } + else + # Use BSD hexdump. + func_elfclass () + { + dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' + echo + } + fi + case $HOST_CPU_C_ABI_32BIT in + yes) + # 32-bit ABI. + acl_is_expected_elfclass () + { + test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 + } + ;; + no) + # 64-bit ABI. + acl_is_expected_elfclass () + { + test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 + } + ;; + *) + # Unknown. + acl_is_expected_elfclass () + { + : + } + ;; + esac + else + acl_is_expected_elfclass () + { + : + } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +printf %s "checking for the common suffixes of directories in the library search path... " >&6; } +if test ${acl_cv_libdirstems+y} +then : + printf %s "(cached) " >&6 +else $as_nop + acl_libdirstem=lib + acl_libdirstem2= + acl_libdirstem3= + case "$host_os" in + solaris*) + if test $HOST_CPU_C_ABI_32BIT = no; then + acl_libdirstem2=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem3=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test $HOST_CPU_C_ABI_32BIT != no; then + # 32-bit or unknown ABI. + if test -d /usr/lib32; then + acl_libdirstem2=lib32 + fi + fi + if test $HOST_CPU_C_ABI_32BIT != yes; then + # 64-bit or unknown ABI. + if test -d /usr/lib64; then + acl_libdirstem3=lib64 + fi + fi + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; + */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib32 ) acl_libdirstem2=lib32 ;; + */lib64 ) acl_libdirstem3=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + if test $HOST_CPU_C_ABI_32BIT = yes; then + # 32-bit ABI. + acl_libdirstem3= + fi + if test $HOST_CPU_C_ABI_32BIT = no; then + # 64-bit ABI. + acl_libdirstem2= + fi + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +printf "%s\n" "$acl_cv_libdirstems" >&6; } + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` + acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` + + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix was given. +if test ${with_libiconv_prefix+y} +then : + withval=$with_libiconv_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" + fi + fi + +fi + + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi + LIBICONV= + LTLIBICONV= + INCICONV= + LIBICONV_PREFIX= + HAVE_LIBICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + fi + done + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then + haveit= + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +printf %s "checking for CFPreferencesCopyAppValue... " >&6; } +if test ${gt_cv_func_CFPreferencesCopyAppValue+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else $as_nop + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 +printf %s "checking for CFLocaleCopyPreferredLanguages... " >&6; } +if test ${gt_cv_func_CFLocaleCopyPreferredLanguages+y} +then : + printf %s "(cached) " >&6 +else $as_nop + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +CFLocaleCopyPreferredLanguages(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + gt_cv_func_CFLocaleCopyPreferredLanguages=yes +else $as_nop + gt_cv_func_CFLocaleCopyPreferredLanguages=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 +printf "%s\n" "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + +printf "%s\n" "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + + + + + LIBINTL= + LTLIBINTL= + POSUB= + + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 +printf %s "checking for GNU gettext in libc... " >&6; } +if eval test \${$gt_func_gnugettext_libc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + +int +main (void) +{ + +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$gt_func_gnugettext_libc=yes" +else $as_nop + eval "$gt_func_gnugettext_libc=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$gt_func_gnugettext_libc + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +printf %s "checking for iconv... " >&6; } +if test ${am_cv_func_iconv+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +printf "%s\n" "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 +printf %s "checking for working iconv... " >&6; } +if test ${am_cv_func_iconv_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + am_save_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + if test "$cross_compiling" = yes +then : + case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + +int +main (void) +{ +int result = 0; + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful + returns. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + am_cv_func_iconv_works=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$am_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 +printf "%s\n" "$am_cv_func_iconv_works" >&6; } + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +printf %s "checking how to link with libiconv... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +printf "%s\n" "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libintl-prefix was given. +if test ${with_libintl_prefix+y} +then : + withval=$with_libintl_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" + fi + fi + +fi + + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi LIBINTL= LTLIBINTL= INCINTL= @@ -14764,7 +21232,7 @@ done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -14787,45 +21255,51 @@ shrext= fi if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" - found_so="$dir/$f" - break + found_a="$dir/$libname.$acl_libext" fi - done + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi fi fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi + done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do @@ -14842,7 +21316,7 @@ -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else @@ -14852,14 +21326,14 @@ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do - if test -f "$dir/$f"; then + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break @@ -14869,7 +21343,7 @@ fi fi if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi @@ -14891,7 +21365,8 @@ if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= @@ -14970,6 +21445,13 @@ fi additional_includedir="$basedir/include" ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then @@ -15015,12 +21497,14 @@ for dep in $dependency_libs; do case "$dep" in -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -15039,14 +21523,14 @@ exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir" fi fi haveit= @@ -15060,14 +21544,14 @@ exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir" fi fi fi @@ -15150,78 +21634,98 @@ - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 -$as_echo_n "checking for GNU gettext in libintl... " >&6; } -if eval \${$gt_func_gnugettext_libintl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 +printf %s "checking for GNU gettext in libintl... " >&6; } +if eval test \${$gt_func_gnugettext_libintl+y} +then : + printf %s "(cached) " >&6 +else $as_nop gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + int -main () +main (void) { + bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$gt_func_gnugettext_libintl=yes" -else +else $as_nop eval "$gt_func_gnugettext_libintl=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + int -main () +main (void) { + bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ @@ -15248,20 +21752,20 @@ if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then -$as_echo "#define ENABLE_NLS 1" >>confdefs.h +printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 -$as_echo_n "checking whether to use NLS... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 -$as_echo "$USE_NLS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 +printf %s "checking whether to use NLS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 +printf "%s\n" "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 -$as_echo_n "checking where the gettext function comes from... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 +printf %s "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" @@ -15271,18 +21775,18 @@ else gt_source="included intl directory" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 -$as_echo "$gt_source" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 +printf "%s\n" "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 -$as_echo_n "checking how to link with libintl... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 -$as_echo "$LIBINTL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 +printf %s "checking how to link with libintl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 +printf "%s\n" "$LIBINTL" >&6; } for element in $INCINTL; do haveit= @@ -15309,10 +21813,10 @@ fi -$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h -$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h +printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h fi @@ -15330,16 +21834,17 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __cplusplus @@ -15352,7 +21857,7 @@ /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -15380,7 +21885,7 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -15396,31 +21901,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } -if ${ac_cv_c_volatile+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +printf %s "checking for working volatile... " >&6; } +if test ${ac_cv_c_volatile+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { volatile int x; @@ -15430,34 +21937,37 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_volatile=yes -else +else $as_nop ac_cv_c_volatile=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 -$as_echo "$ac_cv_c_volatile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +printf "%s\n" "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then -$as_echo "#define volatile /**/" >>confdefs.h +printf "%s\n" "#define volatile /**/" >>confdefs.h fi # Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : +if test ${enable_largefile+y} +then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if ${ac_cv_sys_largefile_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC @@ -15471,44 +21981,47 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_largefile_CC=' -n32'; break fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if ${ac_cv_sys_file_offset_bits+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15517,22 +22030,23 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 @@ -15541,43 +22055,43 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_file_offset_bits=64; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if ${ac_cv_sys_large_files+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15586,22 +22100,23 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 @@ -15610,97 +22125,132 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_sys_large_files=1; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi - - fi # Check whether --enable-shared-libs was given. -if test "${enable_shared_libs+set}" = set; then : +if test ${enable_shared_libs+y} +then : enableval=$enable_shared_libs; ac_cv_enable_shared_libs=$enableval -else +else $as_nop ac_cv_enable_shared_libs="yes" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable disable shared library support" >&5 -$as_echo_n "checking whether to disable disable shared library support... " >&6; } -if ${ac_cv_enable_shared_libs+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to disable disable shared library support" >&5 +printf %s "checking whether to disable disable shared library support... " >&6; } +if test ${ac_cv_enable_shared_libs+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_shared_libs="yes" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_shared_libs" >&5 -$as_echo "$ac_cv_enable_shared_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_shared_libs" >&5 +printf "%s\n" "$ac_cv_enable_shared_libs" >&6; } + + + + + # Check whether --enable-static-executables was given. +if test ${enable_static_executables+y} +then : + enableval=$enable_static_executables; ac_cv_enable_static_executables=$enableval +else $as_nop + ac_cv_enable_static_executables=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable build static executables (binaries)" >&5 +printf %s "checking whether to enable build static executables (binaries)... " >&6; } +if test ${ac_cv_enable_static_executables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_enable_static_executables=no +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_static_executables" >&5 +printf "%s\n" "$ac_cv_enable_static_executables" >&6; } + + if test "x$ac_cv_enable_static_executables" != xno +then : + STATIC_LDFLAGS="-all-static"; + + + + ac_cv_enable_static_executables=yes + enable_shared=no +fi # Check whether --enable-winapi was given. -if test "${enable_winapi+set}" = set; then : +if test ${enable_winapi+y} +then : enableval=$enable_winapi; ac_cv_enable_winapi=$enableval -else +else $as_nop ac_cv_enable_winapi=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable WINAPI support for cross-compilation" >&5 -$as_echo_n "checking whether to enable enable WINAPI support for cross-compilation... " >&6; } -if ${ac_cv_enable_winapi+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable WINAPI support for cross-compilation" >&5 +printf %s "checking whether to enable enable WINAPI support for cross-compilation... " >&6; } +if test ${ac_cv_enable_winapi+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_winapi=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_winapi" >&5 -$as_echo "$ac_cv_enable_winapi" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_winapi" >&5 +printf "%s\n" "$ac_cv_enable_winapi" >&6; } - if test "x$ac_cv_enable_winapi" = xauto-detect; then : + if test "x$ac_cv_enable_winapi" = xauto-detect +then : ac_common_check_winapi_target_string="$target" - if test "x$ac_common_check_winapi_target_string" = x; then : + if test "x$ac_common_check_winapi_target_string" = x +then : ac_common_check_winapi_target_string="$host" fi case $ac_common_check_winapi_target_string in #( *mingw*) : - { $as_echo "$as_me:${as_lineno-$LINENO}: detected MinGW enabling WINAPI support for cross-compilation" >&5 -$as_echo "$as_me: detected MinGW enabling WINAPI support for cross-compilation" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected MinGW enabling WINAPI support for cross-compilation" >&5 +printf "%s\n" "$as_me: detected MinGW enabling WINAPI support for cross-compilation" >&6;} ac_cv_enable_winapi=yes ;; #( *msys*) : - { $as_echo "$as_me:${as_lineno-$LINENO}: detected MSYS enabling WINAPI support for cross-compilation" >&5 -$as_echo "$as_me: detected MSYS enabling WINAPI support for cross-compilation" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected MSYS enabling WINAPI support for cross-compilation" >&5 +printf "%s\n" "$as_me: detected MSYS enabling WINAPI support for cross-compilation" >&6;} ac_cv_enable_winapi=yes ;; #( *) : ac_cv_enable_winapi=no ;; #( @@ -15714,45 +22264,50 @@ # Check whether --enable-wide-character-type was given. -if test "${enable_wide_character_type+set}" = set; then : +if test ${enable_wide_character_type+y} +then : enableval=$enable_wide_character_type; ac_cv_enable_wide_character_type=$enableval -else +else $as_nop ac_cv_enable_wide_character_type=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable wide character type support" >&5 -$as_echo_n "checking whether to enable enable wide character type support... " >&6; } -if ${ac_cv_enable_wide_character_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable wide character type support" >&5 +printf %s "checking whether to enable enable wide character type support... " >&6; } +if test ${ac_cv_enable_wide_character_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_wide_character_type=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_wide_character_type" >&5 -$as_echo "$ac_cv_enable_wide_character_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_wide_character_type" >&5 +printf "%s\n" "$ac_cv_enable_wide_character_type" >&6; } # Check whether --enable-verbose-output was given. -if test "${enable_verbose_output+set}" = set; then : +if test ${enable_verbose_output+y} +then : enableval=$enable_verbose_output; ac_cv_enable_verbose_output=$enableval -else +else $as_nop ac_cv_enable_verbose_output=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable verbose output" >&5 -$as_echo_n "checking whether to enable enable verbose output... " >&6; } -if ${ac_cv_enable_verbose_output+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable verbose output" >&5 +printf %s "checking whether to enable enable verbose output... " >&6; } +if test ${ac_cv_enable_verbose_output+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_verbose_output=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_verbose_output" >&5 -$as_echo "$ac_cv_enable_verbose_output" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_verbose_output" >&5 +printf "%s\n" "$ac_cv_enable_verbose_output" >&6; } - if test "x$ac_cv_enable_verbose_output" != xno ; then : + if test "x$ac_cv_enable_verbose_output" != xno +then : -$as_echo "#define HAVE_VERBOSE_OUTPUT 1" >>confdefs.h +printf "%s\n" "#define HAVE_VERBOSE_OUTPUT 1" >>confdefs.h ac_cv_enable_verbose_output=yes @@ -15762,136 +22317,155 @@ # Check whether --enable-debug-output was given. -if test "${enable_debug_output+set}" = set; then : +if test ${enable_debug_output+y} +then : enableval=$enable_debug_output; ac_cv_enable_debug_output=$enableval -else +else $as_nop ac_cv_enable_debug_output=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable debug output" >&5 -$as_echo_n "checking whether to enable enable debug output... " >&6; } -if ${ac_cv_enable_debug_output+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable debug output" >&5 +printf %s "checking whether to enable enable debug output... " >&6; } +if test ${ac_cv_enable_debug_output+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_debug_output=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_debug_output" >&5 -$as_echo "$ac_cv_enable_debug_output" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_debug_output" >&5 +printf "%s\n" "$ac_cv_enable_debug_output" >&6; } - if test "x$ac_cv_enable_debug_output" != xno ; then : + if test "x$ac_cv_enable_debug_output" != xno +then : -$as_echo "#define HAVE_DEBUG_OUTPUT 1" >>confdefs.h +printf "%s\n" "#define HAVE_DEBUG_OUTPUT 1" >>confdefs.h ac_cv_enable_debug_output=yes fi -if test "x$ac_cv_enable_winapi" = xyes; then : +if test "x$ac_cv_enable_winapi" = xyes +then : ac_cv_enable_wide_character_type=yes fi - if test "x$ac_cv_enable_wide_character_type" = xyes; then : + if test "x$ac_cv_enable_wide_character_type" = xyes +then : -$as_echo "#define HAVE_WIDE_CHARACTER_TYPE 1" >>confdefs.h +printf "%s\n" "#define HAVE_WIDE_CHARACTER_TYPE 1" >>confdefs.h HAVE_WIDE_CHARACTER_TYPE=1 -else +else $as_nop HAVE_WIDE_CHARACTER_TYPE=0 fi - for ac_header in sys/types.h inttypes.h stdint.h wchar.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" +if test "x$ac_cv_header_inttypes_h" = xyes +then : + printf "%s\n" "#define HAVE_INTTYPES_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes +then : + printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes +then : + printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h + +fi - if test "x$ac_cv_header_sys_types_h" = xyes; then : + if test "x$ac_cv_header_sys_types_h" = xyes +then : HAVE_SYS_TYPES_H=1 -else +else $as_nop HAVE_SYS_TYPES_H=0 fi - if test "x$ac_cv_header_inttypes_h" = xyes; then : + if test "x$ac_cv_header_inttypes_h" = xyes +then : HAVE_INTTYPES_H=1 -else +else $as_nop HAVE_INTTYPES_H=0 fi - if test "x$ac_cv_header_stdint_h" = xyes; then : + if test "x$ac_cv_header_stdint_h" = xyes +then : HAVE_STDINT_H=1 -else +else $as_nop HAVE_STDINT_H=0 fi - if test "x$ac_cv_header_wchar_h" = xyes; then : + if test "x$ac_cv_header_wchar_h" = xyes +then : HAVE_WCHAR_H=1 -else +else $as_nop HAVE_WCHAR_H=0 fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : +if test "x$ac_cv_type_mode_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF +printf "%s\n" "#define mode_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : +if test "x$ac_cv_type_off_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +printf "%s\n" "#define off_t long int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size32_t" "ac_cv_type_size32_t" "$ac_includes_default" -if test "x$ac_cv_type_size32_t" = xyes; then : +if test "x$ac_cv_type_size32_t" = xyes +then : HAVE_SIZE32_T=1 -else +else $as_nop HAVE_SIZE32_T=0 @@ -15899,10 +22473,11 @@ ac_fn_c_check_type "$LINENO" "ssize32_t" "ac_cv_type_ssize32_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize32_t" = xyes; then : +if test "x$ac_cv_type_ssize32_t" = xyes +then : HAVE_SSIZE32_T=1 -else +else $as_nop HAVE_SSIZE32_T=0 @@ -15910,10 +22485,11 @@ ac_fn_c_check_type "$LINENO" "size64_t" "ac_cv_type_size64_t" "$ac_includes_default" -if test "x$ac_cv_type_size64_t" = xyes; then : +if test "x$ac_cv_type_size64_t" = xyes +then : HAVE_SIZE64_T=1 -else +else $as_nop HAVE_SIZE64_T=0 @@ -15921,10 +22497,11 @@ ac_fn_c_check_type "$LINENO" "ssize64_t" "ac_cv_type_ssize64_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize64_t" = xyes; then : +if test "x$ac_cv_type_ssize64_t" = xyes +then : HAVE_SSIZE64_T=1 -else +else $as_nop HAVE_SSIZE64_T=0 @@ -15932,10 +22509,11 @@ ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default" -if test "x$ac_cv_type_off64_t" = xyes; then : +if test "x$ac_cv_type_off64_t" = xyes +then : HAVE_OFF64_T=1 -else +else $as_nop HAVE_OFF64_T=0 @@ -15943,12 +22521,14 @@ ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes; then : +if test "x$ac_cv_type_ssize_t" = xyes +then : fi ac_fn_c_check_type "$LINENO" "u64" "ac_cv_type_u64" "$ac_includes_default" -if test "x$ac_cv_type_u64" = xyes; then : +if test "x$ac_cv_type_u64" = xyes +then : fi @@ -15957,17 +22537,19 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } +if test ${ac_cv_sizeof_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else @@ -15976,31 +22558,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +printf "%s\n" "$ac_cv_sizeof_int" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -16009,31 +22591,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 -$as_echo_n "checking size of off_t... " >&6; } -if ${ac_cv_sizeof_off_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +printf %s "checking size of off_t... " >&6; } +if test ${ac_cv_sizeof_off_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_off_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -16042,31 +22624,31 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 -$as_echo "$ac_cv_sizeof_off_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t -_ACEOF +printf "%s\n" "#define SIZEOF_OFF_T $ac_cv_sizeof_off_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } -if ${ac_cv_sizeof_size_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } +if test ${ac_cv_sizeof_size_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -16075,33 +22657,34 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF +printf "%s\n" "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h - if test "x$ac_cv_header_wchar_h" = xyes; then : + if test "x$ac_cv_header_wchar_h" = xyes +then : # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 -$as_echo_n "checking size of wchar_t... " >&6; } -if ${ac_cv_sizeof_wchar_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 +printf %s "checking size of wchar_t... " >&6; } +if test ${ac_cv_sizeof_wchar_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_wchar_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -16110,37 +22693,112 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 -$as_echo "$ac_cv_sizeof_wchar_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 +printf "%s\n" "$ac_cv_sizeof_wchar_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t -_ACEOF +printf "%s\n" "#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t" >>confdefs.h fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - if test "x$ac_cv_enable_winapi" = xyes; then : - for ac_header in windows.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" -if test "x$ac_cv_header_windows_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_WINDOWS_H 1 +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac -done + + if test "x$ac_cv_enable_winapi" = xyes +then : + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes +then : + printf "%s\n" "#define HAVE_WINDOWS_H 1" >>confdefs.h + +fi - if test "x$ac_cv_header_windows_h" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_header_windows_h" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing header: windows.h header is required to compile with winapi support See \`config.log' for more details" "$LINENO" 5; } @@ -16148,156 +22806,196 @@ fi - if test "x$ac_cv_enable_winapi" = xno; then : - for ac_header in libintl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" -if test "x$ac_cv_header_libintl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBINTL_H 1 -_ACEOF + if test "x$ac_cv_enable_winapi" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h fi -done +fi + + ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes +then : + printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h fi - for ac_header in limits.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF + + ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h -done +fi - for ac_header in stdlib.h string.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes +then : + printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" +if test "x$ac_cv_header_wctype_h" = xyes +then : + printf "%s\n" "#define HAVE_WCTYPE_H 1" >>confdefs.h -done +fi - for ac_header in wchar.h wctype.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "fclose" "ac_cv_func_fclose" +if test "x$ac_cv_func_fclose" = xyes +then : + printf "%s\n" "#define HAVE_FCLOSE 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "feof" "ac_cv_func_feof" +if test "x$ac_cv_func_feof" = xyes +then : + printf "%s\n" "#define HAVE_FEOF 1" >>confdefs.h -done +fi +ac_fn_c_check_func "$LINENO" "fgets" "ac_cv_func_fgets" +if test "x$ac_cv_func_fgets" = xyes +then : + printf "%s\n" "#define HAVE_FGETS 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "fopen" "ac_cv_func_fopen" +if test "x$ac_cv_func_fopen" = xyes +then : + printf "%s\n" "#define HAVE_FOPEN 1" >>confdefs.h - for ac_func in fclose feof fgets fopen fread fseeko fseeko64 fwrite vfprintf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "fread" "ac_cv_func_fread" +if test "x$ac_cv_func_fread" = xyes +then : + printf "%s\n" "#define HAVE_FREAD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko" +if test "x$ac_cv_func_fseeko" = xyes +then : + printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fseeko64" "ac_cv_func_fseeko64" +if test "x$ac_cv_func_fseeko64" = xyes +then : + printf "%s\n" "#define HAVE_FSEEKO64 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fwrite" "ac_cv_func_fwrite" +if test "x$ac_cv_func_fwrite" = xyes +then : + printf "%s\n" "#define HAVE_FWRITE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vfprintf" "ac_cv_func_vfprintf" +if test "x$ac_cv_func_vfprintf" = xyes +then : + printf "%s\n" "#define HAVE_VFPRINTF 1" >>confdefs.h fi -done - if test "x$ac_cv_func_fclose" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fclose" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fclose See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_feof" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_feof" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: feof See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_fgets" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fgets" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fgets See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_fopen" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fopen" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fopen See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_fread" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fread" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fread See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_fseeko" != xyes && test "x$ac_cv_func_fseeko64" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fseeko" != xyes && test "x$ac_cv_func_fseeko64" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fseeko and fseeko64 See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_fwrite" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fwrite" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fwrite See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_vfprintf" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_vfprintf" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: vfprintf See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - for ac_func in fgetws -do : + if test "x$ac_cv_enable_wide_character_type" != xno +then : ac_fn_c_check_func "$LINENO" "fgetws" "ac_cv_func_fgetws" -if test "x$ac_cv_func_fgetws" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FGETWS 1 -_ACEOF +if test "x$ac_cv_func_fgetws" = xyes +then : + printf "%s\n" "#define HAVE_FGETWS 1" >>confdefs.h fi -done - if test "x$ac_cv_func_fgetws" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fgetws" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fgetws See \`config.log' for more details" "$LINENO" 5; } @@ -16305,252 +23003,454 @@ fi - for ac_func in free malloc memcmp memcpy memset realloc -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "free" "ac_cv_func_free" +if test "x$ac_cv_func_free" = xyes +then : + printf "%s\n" "#define HAVE_FREE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "malloc" "ac_cv_func_malloc" +if test "x$ac_cv_func_malloc" = xyes +then : + printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memcmp" "ac_cv_func_memcmp" +if test "x$ac_cv_func_memcmp" = xyes +then : + printf "%s\n" "#define HAVE_MEMCMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy" +if test "x$ac_cv_func_memcpy" = xyes +then : + printf "%s\n" "#define HAVE_MEMCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "realloc" "ac_cv_func_realloc" +if test "x$ac_cv_func_realloc" = xyes +then : + printf "%s\n" "#define HAVE_REALLOC 1" >>confdefs.h fi -done - if test "x$ac_cv_func_free" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_free" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: free See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_malloc" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_malloc" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: malloc See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_memcmp" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memcmp" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: memcmp See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_memcpy" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memcpy" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: memcpy See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_memset" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memset" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: memset See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_realloc" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_realloc" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: realloc See \`config.log' for more details" "$LINENO" 5; } fi - for ac_func in memchr memrchr snprintf sscanf strcasecmp strchr strlen strncasecmp strncmp strncpy strnicmp strrchr strstr vsnprintf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "memchr" "ac_cv_func_memchr" +if test "x$ac_cv_func_memchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" +if test "x$ac_cv_func_memrchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sscanf" "ac_cv_func_sscanf" +if test "x$ac_cv_func_sscanf" = xyes +then : + printf "%s\n" "#define HAVE_SSCANF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" +if test "x$ac_cv_func_strchr" = xyes +then : + printf "%s\n" "#define HAVE_STRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlen" "ac_cv_func_strlen" +if test "x$ac_cv_func_strlen" = xyes +then : + printf "%s\n" "#define HAVE_STRLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strncmp" "ac_cv_func_strncmp" +if test "x$ac_cv_func_strncmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNCMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strncpy" "ac_cv_func_strncpy" +if test "x$ac_cv_func_strncpy" = xyes +then : + printf "%s\n" "#define HAVE_STRNCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strnicmp" "ac_cv_func_strnicmp" +if test "x$ac_cv_func_strnicmp" = xyes +then : + printf "%s\n" "#define HAVE_STRNICMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strrchr" "ac_cv_func_strrchr" +if test "x$ac_cv_func_strrchr" = xyes +then : + printf "%s\n" "#define HAVE_STRRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" +if test "x$ac_cv_func_strstr" = xyes +then : + printf "%s\n" "#define HAVE_STRSTR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes +then : + printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h fi -done - if test "x$ac_cv_func_memchr" != xyes && test "x$ac_cv_func_strchr" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memchr" != xyes && test "x$ac_cv_func_strchr" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: memchr and strchr See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_memcmp" != xyes && test "x$ac_cv_func_strncmp" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memcmp" != xyes && test "x$ac_cv_func_strncmp" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: memcmp and strncmp See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_memcpy" != xyes && test "x$ac_cv_func_strncpy" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memcpy" != xyes && test "x$ac_cv_func_strncpy" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: memcpy and strncpy See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_memrchr" = xyes; then : - ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" -if test "x$ac_cv_have_decl_memrchr" = xyes; then : + if test "x$ac_cv_func_memrchr" = xyes +then : + ac_fn_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_memrchr" = xyes +then : ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MEMRCHR $ac_have_decl -_ACEOF +printf "%s\n" "#define HAVE_DECL_MEMRCHR $ac_have_decl" >>confdefs.h - if test "x$ac_cv_decl_memrchr" != xyes; then : + if test "x$ac_cv_decl_memrchr" != xyes +then : ac_cv_func_memrchr=no fi fi - if test "x$ac_cv_func_memrchr" != xyes && test "x$ac_cv_func_strrchr" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_memrchr" != xyes && test "x$ac_cv_func_strrchr" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strrchr and memrchr See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_snprintf" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_snprintf" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: snprintf See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_sscanf" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_sscanf" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: sscanf See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_strlen" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_strlen" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: strlen See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_strcasecmp" != xyes && test "x$ac_cv_func_strncasecmp" != xyes && test "x$ac_cv_func_strnicmp" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_strcasecmp" != xyes && test "x$ac_cv_func_strncasecmp" != xyes && test "x$ac_cv_func_strnicmp" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strncasecmp, strcasecmp and strnicmp See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_strstr" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_strstr" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: strstr See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_vsnprintf" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_vsnprintf" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: vsnprintf See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - for ac_func in swprintf towlower wcscasecmp wcschr wcslen wcsncasecmp wcsncmp wcsncpy wcsnicmp wcsrchr wcsstr wmemchr wmemcmp wmemcpy wmemrchr -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_cv_enable_wide_character_type" != xno +then : + ac_fn_c_check_func "$LINENO" "swprintf" "ac_cv_func_swprintf" +if test "x$ac_cv_func_swprintf" = xyes +then : + printf "%s\n" "#define HAVE_SWPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes +then : + printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcscasecmp" "ac_cv_func_wcscasecmp" +if test "x$ac_cv_func_wcscasecmp" = xyes +then : + printf "%s\n" "#define HAVE_WCSCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcschr" "ac_cv_func_wcschr" +if test "x$ac_cv_func_wcschr" = xyes +then : + printf "%s\n" "#define HAVE_WCSCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen" +if test "x$ac_cv_func_wcslen" = xyes +then : + printf "%s\n" "#define HAVE_WCSLEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsncasecmp" "ac_cv_func_wcsncasecmp" +if test "x$ac_cv_func_wcsncasecmp" = xyes +then : + printf "%s\n" "#define HAVE_WCSNCASECMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsncmp" "ac_cv_func_wcsncmp" +if test "x$ac_cv_func_wcsncmp" = xyes +then : + printf "%s\n" "#define HAVE_WCSNCMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsncpy" "ac_cv_func_wcsncpy" +if test "x$ac_cv_func_wcsncpy" = xyes +then : + printf "%s\n" "#define HAVE_WCSNCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsnicmp" "ac_cv_func_wcsnicmp" +if test "x$ac_cv_func_wcsnicmp" = xyes +then : + printf "%s\n" "#define HAVE_WCSNICMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsrchr" "ac_cv_func_wcsrchr" +if test "x$ac_cv_func_wcsrchr" = xyes +then : + printf "%s\n" "#define HAVE_WCSRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsstr" "ac_cv_func_wcsstr" +if test "x$ac_cv_func_wcsstr" = xyes +then : + printf "%s\n" "#define HAVE_WCSSTR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wmemchr" "ac_cv_func_wmemchr" +if test "x$ac_cv_func_wmemchr" = xyes +then : + printf "%s\n" "#define HAVE_WMEMCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wmemcmp" "ac_cv_func_wmemcmp" +if test "x$ac_cv_func_wmemcmp" = xyes +then : + printf "%s\n" "#define HAVE_WMEMCMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wmemcpy" "ac_cv_func_wmemcpy" +if test "x$ac_cv_func_wmemcpy" = xyes +then : + printf "%s\n" "#define HAVE_WMEMCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wmemrchr" "ac_cv_func_wmemrchr" +if test "x$ac_cv_func_wmemrchr" = xyes +then : + printf "%s\n" "#define HAVE_WMEMRCHR 1" >>confdefs.h fi -done - if test "x$ac_cv_func_swprintf" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_swprintf" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: swprintf See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wmemchr" != xyes && test "x$ac_cv_func_wcschr" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wmemchr" != xyes && test "x$ac_cv_func_wcschr" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemchr and wcschr See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wmemcmp" != xyes && test "x$ac_cv_func_wcsncmp" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wmemcmp" != xyes && test "x$ac_cv_func_wcsncmp" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemcmp and wcsncmp See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wmemcpy" != xyes && test "x$ac_cv_func_wcsncpy" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wmemcpy" != xyes && test "x$ac_cv_func_wcsncpy" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemcpy and wcsncpy See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wmemrchr" != xyes && test "x$ac_cv_func_wcsrchr" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wmemrchr" != xyes && test "x$ac_cv_func_wcsrchr" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wmemrchr and wcsrchr See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wcslen" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wcslen" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: wcslen See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wcsncasecmp" != xyes && test "x$ac_cv_func_wcscasecmp" != xyes && test "x$ac_cv_func_wcsnicmp" != xyes && test "x$ac_cv_func_towlower" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wcsncasecmp" != xyes && test "x$ac_cv_func_wcscasecmp" != xyes && test "x$ac_cv_func_wcsnicmp" != xyes && test "x$ac_cv_func_towlower" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: wcsncasecmp, wcscasecmp, wcsnicmp and towlower See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_wcsstr" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wcsstr" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: wcsstr See \`config.log' for more details" "$LINENO" 5; } @@ -16559,8 +23459,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the conversion specifier \"%jd\"" >&5 -$as_echo_n "checking whether printf supports the conversion specifier \"%jd\"... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the conversion specifier \"%jd\"" >&5 +printf %s "checking whether printf supports the conversion specifier \"%jd\"... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" @@ -16575,54 +23475,59 @@ /* end confdefs.h. */ #include int -main () +main (void) { printf( "%jd" ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_cv_have_printf_jd=no -else +else $as_nop ac_cv_cv_have_printf_jd=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "x$ac_cv_cv_have_printf_jd" = xyes; then : + if test "x$ac_cv_cv_have_printf_jd" = xyes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { printf( "%jd", (off_t) 10 ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_cv_have_printf_jd=yes -else +else $as_nop ac_cv_cv_have_printf_jd=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi - if test "x$ac_cv_cv_have_printf_jd" = xyes; then : - if test "$cross_compiling" = yes; then : + if test "x$ac_cv_cv_have_printf_jd" = xyes +then : + if test "$cross_compiling" = yes +then : ac_cv_cv_have_printf_jd=undetermined -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { char string[ 3 ]; if( snprintf( string, 3, "%jd", (off_t) 10 ) < 0 ) return( 1 ); @@ -16631,9 +23536,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_cv_have_printf_jd=yes -else +else $as_nop ac_cv_cv_have_printf_jd=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16651,21 +23557,22 @@ CFLAGS="$SAVE_CFLAGS" - if test "x$ac_cv_cv_have_printf_jd" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "x$ac_cv_cv_have_printf_jd" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_PRINTF_JD 1" >>confdefs.h +printf "%s\n" "#define HAVE_PRINTF_JD 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_have_printf_jd" >&5 -$as_echo "$ac_cv_cv_have_printf_jd" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_have_printf_jd" >&5 +printf "%s\n" "$ac_cv_cv_have_printf_jd" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the conversion specifier \"%zd\"" >&5 -$as_echo_n "checking whether printf supports the conversion specifier \"%zd\"... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the conversion specifier \"%zd\"" >&5 +printf %s "checking whether printf supports the conversion specifier \"%zd\"... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" @@ -16680,54 +23587,59 @@ /* end confdefs.h. */ #include int -main () +main (void) { printf( "%zd" ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_cv_have_printf_zd=no -else +else $as_nop ac_cv_cv_have_printf_zd=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "x$ac_cv_cv_have_printf_zd" = xyes; then : + if test "x$ac_cv_cv_have_printf_zd" = xyes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { printf( "%zd", (size_t) 10 ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_cv_have_printf_zd=yes -else +else $as_nop ac_cv_cv_have_printf_zd=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi - if test "x$ac_cv_cv_have_printf_zd" = xyes; then : - if test "$cross_compiling" = yes; then : + if test "x$ac_cv_cv_have_printf_zd" = xyes +then : + if test "$cross_compiling" = yes +then : ac_cv_cv_have_printf_zd=undetermined -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int -main () +main (void) { char string[ 3 ]; if( snprintf( string, 3, "%zd", (size_t) 10 ) < 0 ) return( 1 ); @@ -16736,9 +23648,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_cv_have_printf_zd=yes -else +else $as_nop ac_cv_cv_have_printf_zd=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16756,15 +23669,16 @@ CFLAGS="$SAVE_CFLAGS" - if test "x$ac_cv_cv_have_printf_zd" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_PRINTF_ZD 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_have_printf_zd" >&5 -$as_echo "$ac_cv_cv_have_printf_zd" >&6; } + if test "x$ac_cv_cv_have_printf_zd" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_PRINTF_ZD 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_have_printf_zd" >&5 +printf "%s\n" "$ac_cv_cv_have_printf_zd" >&6; } fi @@ -16781,11 +23695,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -16795,11 +23710,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16811,11 +23730,11 @@ fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -16824,11 +23743,12 @@ ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. @@ -16838,11 +23758,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16854,11 +23778,11 @@ fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -16866,8 +23790,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -16879,66 +23803,82 @@ fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi +ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strerror_r" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h + # Check whether --with-libcerror was given. -if test "${with_libcerror+set}" = set; then : +if test ${with_libcerror+y} +then : withval=$with_libcerror; ac_cv_with_libcerror=$withval -else +else $as_nop ac_cv_with_libcerror=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcerror+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcerror in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcerror+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcerror=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcerror" >&5 -$as_echo "$ac_cv_with_libcerror" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcerror" >&5 +printf "%s\n" "$ac_cv_with_libcerror" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcerror" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcerror" = xno +then : ac_cv_libcerror=no -else - if test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect; then : - if test -d "$ac_cv_with_libcerror"; then : +else $as_nop + ac_cv_libcerror=check + if test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect +then : + if test -d "$ac_cv_with_libcerror" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcerror}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcerror}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcerror See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcerror=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror" >&5 -$as_echo_n "checking for libcerror... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror >= 20120425" >&5 +printf %s "checking for libcerror >= 20120425... " >&6; } if test -n "$libcerror_CFLAGS"; then pkg_cv_libcerror_CFLAGS="$libcerror_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcerror >= 20120425\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcerror >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcerror >= 20120425") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcerror_CFLAGS=`$PKG_CONFIG --cflags "libcerror >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -16952,10 +23892,10 @@ pkg_cv_libcerror_LIBS="$libcerror_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcerror >= 20120425\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcerror >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcerror >= 20120425") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcerror_LIBS=`$PKG_CONFIG --libs "libcerror >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -16969,8 +23909,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -16978,58 +23918,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcerror_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcerror >= 20120425" 2>&1` + libcerror_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcerror >= 20120425" 2>&1` else - libcerror_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcerror >= 20120425" 2>&1` + libcerror_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcerror >= 20120425" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcerror_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcerror_PKG_ERRORS" >&5 - ac_cv_libcerror=check + ac_cv_libcerror=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcerror=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcerror=check else - libcerror_CFLAGS=$pkg_cv_libcerror_CFLAGS - libcerror_LIBS=$pkg_cv_libcerror_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcerror=yes + libcerror_CFLAGS=$pkg_cv_libcerror_CFLAGS + libcerror_LIBS=$pkg_cv_libcerror_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcerror=yes fi fi - if test "x$ac_cv_libcerror" = xyes; then : + if test "x$ac_cv_libcerror" = xyes +then : ac_cv_libcerror_CPPFLAGS="$pkg_cv_libcerror_CFLAGS" ac_cv_libcerror_LIBADD="$pkg_cv_libcerror_LIBS" fi fi - if test "x$ac_cv_libcerror" = xcheck; then : - for ac_header in libcerror.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcerror.h" "ac_cv_header_libcerror_h" "$ac_includes_default" -if test "x$ac_cv_header_libcerror_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCERROR_H 1 -_ACEOF + if test "x$ac_cv_libcerror" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcerror.h" "ac_cv_header_libcerror_h" "$ac_includes_default" +if test "x$ac_cv_header_libcerror_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCERROR_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcerror_h" = xno; then : + if test "x$ac_cv_header_libcerror_h" = xno +then : ac_cv_libcerror=no -else +else $as_nop ac_cv_libcerror=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_get_version in -lcerror" >&5 -$as_echo_n "checking for libcerror_get_version in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_get_version in -lcerror" >&5 +printf %s "checking for libcerror_get_version in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17038,41 +23977,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_get_version (); int -main () +main (void) { return libcerror_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_get_version=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_get_version" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_get_version" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_get_version" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_get_version" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_get_version" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_free in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_free in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_free in -lcerror" >&5 +printf %s "checking for libcerror_error_free in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17081,40 +24020,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_free (); int -main () +main (void) { return libcerror_error_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_free=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_free" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_free" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_free" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_free" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_free" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_set in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_set in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_set+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_set in -lcerror" >&5 +printf %s "checking for libcerror_error_set in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17123,40 +24062,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_set (); int -main () +main (void) { return libcerror_error_set (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_set=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_set=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_set" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_set" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_set" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_set" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_set" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_set" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_matches in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_matches in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_matches+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_matches in -lcerror" >&5 +printf %s "checking for libcerror_error_matches in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_matches+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17165,40 +24104,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_matches (); int -main () +main (void) { return libcerror_error_matches (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_matches=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_matches=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_matches" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_matches" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_matches" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_matches" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_matches" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_matches" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_fprint in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_fprint in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_fprint+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_fprint in -lcerror" >&5 +printf %s "checking for libcerror_error_fprint in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_fprint+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17207,40 +24146,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_fprint (); int -main () +main (void) { return libcerror_error_fprint (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_fprint=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_fprint=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_fprint" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_fprint" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_fprint" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_fprint" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_fprint" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_fprint" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_sprint in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_sprint in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_sprint+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_sprint in -lcerror" >&5 +printf %s "checking for libcerror_error_sprint in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_sprint+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17249,40 +24188,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_sprint (); int -main () +main (void) { return libcerror_error_sprint (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_sprint=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_sprint=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_sprint" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_sprint" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_sprint" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_sprint" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_sprint" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_sprint" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_backtrace_fprint in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_backtrace_fprint in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_backtrace_fprint+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_backtrace_fprint in -lcerror" >&5 +printf %s "checking for libcerror_error_backtrace_fprint in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_backtrace_fprint+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17291,40 +24230,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_backtrace_fprint (); int -main () +main (void) { return libcerror_error_backtrace_fprint (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_backtrace_fprint=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_backtrace_fprint=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_backtrace_fprint" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_backtrace_fprint" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_backtrace_fprint" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_backtrace_fprint" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_backtrace_fprint" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_backtrace_fprint" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_backtrace_sprint in -lcerror" >&5 -$as_echo_n "checking for libcerror_error_backtrace_sprint in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_error_backtrace_sprint+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_error_backtrace_sprint in -lcerror" >&5 +printf %s "checking for libcerror_error_backtrace_sprint in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_error_backtrace_sprint+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17333,41 +24272,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_error_backtrace_sprint (); int -main () +main (void) { return libcerror_error_backtrace_sprint (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_error_backtrace_sprint=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_error_backtrace_sprint=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_backtrace_sprint" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_error_backtrace_sprint" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_error_backtrace_sprint" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_error_backtrace_sprint" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_error_backtrace_sprint" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_error_backtrace_sprint" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcerror_system_set_error in -lcerror" >&5 -$as_echo_n "checking for libcerror_system_set_error in -lcerror... " >&6; } -if ${ac_cv_lib_cerror_libcerror_system_set_error+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcerror_system_set_error in -lcerror" >&5 +printf %s "checking for libcerror_system_set_error in -lcerror... " >&6; } +if test ${ac_cv_lib_cerror_libcerror_system_set_error+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcerror $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17376,32 +24315,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcerror_system_set_error (); int -main () +main (void) { return libcerror_system_set_error (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cerror_libcerror_system_set_error=yes -else +else $as_nop ac_cv_lib_cerror_libcerror_system_set_error=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_system_set_error" >&5 -$as_echo "$ac_cv_lib_cerror_libcerror_system_set_error" >&6; } -if test "x$ac_cv_lib_cerror_libcerror_system_set_error" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cerror_libcerror_system_set_error" >&5 +printf "%s\n" "$ac_cv_lib_cerror_libcerror_system_set_error" >&6; } +if test "x$ac_cv_lib_cerror_libcerror_system_set_error" = xyes +then : ac_cv_libcerror_dummy=yes -else +else $as_nop ac_cv_libcerror=no fi @@ -17410,9 +24348,10 @@ fi fi - if test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_libcerror" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect && test "x$ac_cv_libcerror" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcerror in directory: $ac_cv_with_libcerror See \`config.log' for more details" "$LINENO" 5; } @@ -17420,62 +24359,64 @@ fi - if test "x$ac_cv_libcerror" = xyes; then : + if test "x$ac_cv_libcerror" = xyes +then : -$as_echo "#define HAVE_LIBCERROR 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCERROR 1" >>confdefs.h fi - if test "x$ac_cv_libcerror" = xyes; then : + if test "x$ac_cv_libcerror" = xyes +then : HAVE_LIBCERROR=1 -else +else $as_nop HAVE_LIBCERROR=0 fi - if test "x$ac_cv_libcerror" != xyes; then : - for ac_header in stdarg.h varargs.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_cv_libcerror" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" +if test "x$ac_cv_header_stdarg_h" = xyes +then : + printf "%s\n" "#define HAVE_STDARG_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default" +if test "x$ac_cv_header_varargs_h" = xyes +then : + printf "%s\n" "#define HAVE_VARARGS_H 1" >>confdefs.h -done +fi - if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - for ac_func in wcstombs -do : + if test "x$ac_cv_enable_wide_character_type" != xno +then : ac_fn_c_check_func "$LINENO" "wcstombs" "ac_cv_func_wcstombs" -if test "x$ac_cv_func_wcstombs" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_WCSTOMBS 1 -_ACEOF +if test "x$ac_cv_func_wcstombs" = xyes +then : + printf "%s\n" "#define HAVE_WCSTOMBS 1" >>confdefs.h fi -done - if test "x$ac_cv_func_wcstombs" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_wcstombs" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: wcstombs See \`config.log' for more details" "$LINENO" 5; } @@ -17483,41 +24424,30 @@ fi - ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror_r" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R $ac_have_decl -_ACEOF +if test $ac_cv_have_decl_strerror_r = yes; then + # For backward compatibility's sake, define HAVE_STRERROR_R. + # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well + # as AC_CHECK_DECLS_ONCE.) -for ac_func in strerror_r -do : - ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" -if test "x$ac_cv_func_strerror_r" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF +printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 -$as_echo_n "checking whether strerror_r returns char *... " >&6; } -if ${ac_cv_func_strerror_r_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +printf %s "checking whether strerror_r returns char *... " >&6; } +if test ${ac_cv_func_strerror_r_char_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include int -main () +main (void) { char buf[100]; @@ -17529,69 +24459,38 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_func_strerror_r_char_p=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 -$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then -$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h +printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi - if test "x$ac_cv_have_decl_strerror_r" != xyes; then : - for ac_func in strerror -do : + if test "x$ac_cv_have_decl_strerror_r" != xyes +then : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" -if test "x$ac_cv_func_strerror" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR 1 -_ACEOF +if test "x$ac_cv_func_strerror" = xyes +then : + printf "%s\n" "#define HAVE_STRERROR 1" >>confdefs.h fi -done - if test "x$ac_cv_func_strerror" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_strerror" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: strerror_r and strerror See \`config.log' for more details" "$LINENO" 5; } @@ -17606,7 +24505,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCERROR 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCERROR 1" >>confdefs.h HAVE_LOCAL_LIBCERROR=1 @@ -17621,24 +24520,28 @@ HAVE_LOCAL_LIBCERROR_FALSE= fi - if test "x$ac_cv_libcerror_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcerror_CPPFLAGS" != "x" +then : LIBCERROR_CPPFLAGS=$ac_cv_libcerror_CPPFLAGS fi - if test "x$ac_cv_libcerror_LIBADD" != "x"; then : + if test "x$ac_cv_libcerror_LIBADD" != "x" +then : LIBCERROR_LIBADD=$ac_cv_libcerror_LIBADD fi - if test "x$ac_cv_libcerror" = xyes; then : + if test "x$ac_cv_libcerror" = xyes +then : ax_libcerror_pc_libs_private=-lcerror fi - if test "x$ac_cv_libcerror" = xyes; then : + if test "x$ac_cv_libcerror" = xyes +then : ax_libcerror_spec_requires=libcerror ax_libcerror_spec_build_requires=libcerror-devel @@ -17649,74 +24552,84 @@ # Check whether --enable-multi-threading-support was given. -if test "${enable_multi_threading_support+set}" = set; then : +if test ${enable_multi_threading_support+y} +then : enableval=$enable_multi_threading_support; ac_cv_enable_multi_threading_support=$enableval -else +else $as_nop ac_cv_enable_multi_threading_support=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable multi-threading support" >&5 -$as_echo_n "checking whether to enable enable multi-threading support... " >&6; } -if ${ac_cv_enable_multi_threading_support+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable multi-threading support" >&5 +printf %s "checking whether to enable enable multi-threading support... " >&6; } +if test ${ac_cv_enable_multi_threading_support+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_multi_threading_support=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_multi_threading_support" >&5 -$as_echo "$ac_cv_enable_multi_threading_support" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_multi_threading_support" >&5 +printf "%s\n" "$ac_cv_enable_multi_threading_support" >&6; } # Check whether --with-libcthreads was given. -if test "${with_libcthreads+set}" = set; then : +if test ${with_libcthreads+y} +then : withval=$with_libcthreads; ac_cv_with_libcthreads=$withval -else +else $as_nop ac_cv_with_libcthreads=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcthreads+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcthreads in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcthreads+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcthreads=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcthreads" >&5 -$as_echo "$ac_cv_with_libcthreads" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcthreads" >&5 +printf "%s\n" "$ac_cv_with_libcthreads" >&6; } - if test "x$ac_cv_enable_multi_threading_support" = xno; then : + if test "x$ac_cv_enable_multi_threading_support" = xno +then : ac_cv_libcthreads="no" ac_cv_libcthreads_multi_threading="no" -else - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcthreads" = xno; then : +else $as_nop + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcthreads" = xno +then : ac_cv_libcthreads=no -else - if test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect; then : - if test -d "$ac_cv_with_libcthreads"; then : +else $as_nop + ac_cv_libcthreads=check + if test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect +then : + if test -d "$ac_cv_with_libcthreads" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcthreads}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcthreads}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcthreads See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcthreads=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads" >&5 -$as_echo_n "checking for libcthreads... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads >= 20160404" >&5 +printf %s "checking for libcthreads >= 20160404... " >&6; } if test -n "$libcthreads_CFLAGS"; then pkg_cv_libcthreads_CFLAGS="$libcthreads_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcthreads >= 20160404\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcthreads >= 20160404\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcthreads >= 20160404") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcthreads_CFLAGS=`$PKG_CONFIG --cflags "libcthreads >= 20160404" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -17730,10 +24643,10 @@ pkg_cv_libcthreads_LIBS="$libcthreads_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcthreads >= 20160404\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcthreads >= 20160404\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcthreads >= 20160404") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcthreads_LIBS=`$PKG_CONFIG --libs "libcthreads >= 20160404" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -17747,8 +24660,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -17756,58 +24669,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcthreads_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcthreads >= 20160404" 2>&1` + libcthreads_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcthreads >= 20160404" 2>&1` else - libcthreads_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcthreads >= 20160404" 2>&1` + libcthreads_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcthreads >= 20160404" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcthreads_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcthreads_PKG_ERRORS" >&5 - ac_cv_libcthreads=check + ac_cv_libcthreads=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcthreads=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcthreads=check else - libcthreads_CFLAGS=$pkg_cv_libcthreads_CFLAGS - libcthreads_LIBS=$pkg_cv_libcthreads_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcthreads=yes + libcthreads_CFLAGS=$pkg_cv_libcthreads_CFLAGS + libcthreads_LIBS=$pkg_cv_libcthreads_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcthreads=yes fi fi - if test "x$ac_cv_libcthreads" = xyes; then : + if test "x$ac_cv_libcthreads" = xyes +then : ac_cv_libcthreads_CPPFLAGS="$pkg_cv_libcthreads_CFLAGS" ac_cv_libcthreads_LIBADD="$pkg_cv_libcthreads_LIBS" fi fi - if test "x$ac_cv_libcthreads" = xcheck; then : - for ac_header in libcthreads.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcthreads.h" "ac_cv_header_libcthreads_h" "$ac_includes_default" -if test "x$ac_cv_header_libcthreads_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCTHREADS_H 1 -_ACEOF + if test "x$ac_cv_libcthreads" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcthreads.h" "ac_cv_header_libcthreads_h" "$ac_includes_default" +if test "x$ac_cv_header_libcthreads_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCTHREADS_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcthreads_h" = xno; then : + if test "x$ac_cv_header_libcthreads_h" = xno +then : ac_cv_libcthreads=no -else +else $as_nop ac_cv_libcthreads=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_get_version in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_get_version in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_get_version in -lcthreads" >&5 +printf %s "checking for libcthreads_get_version in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17816,41 +24728,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_get_version (); int -main () +main (void) { return libcthreads_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_get_version=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_get_version" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_get_version" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_get_version" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_get_version" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_get_version" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_create in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_create in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_create in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_create in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17859,40 +24771,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_create (); int -main () +main (void) { return libcthreads_thread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_create=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_create" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_create" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_create" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_create" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_create" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_join in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_join in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_join+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_join in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_join in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_join+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17901,41 +24813,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_join (); int -main () +main (void) { return libcthreads_thread_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_join=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_join=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_join" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_join" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_join" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_join" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_join" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_join" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_attributes_initialize in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_attributes_initialize in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_attributes_initialize in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_attributes_initialize in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17944,40 +24856,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_attributes_initialize (); int -main () +main (void) { return libcthreads_thread_attributes_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_attributes_initialize" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_attributes_free in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_attributes_free in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_attributes_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_attributes_free in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_attributes_free in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_attributes_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17986,41 +24898,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_attributes_free (); int -main () +main (void) { return libcthreads_thread_attributes_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_attributes_free=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_attributes_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_attributes_free" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_attributes_free" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_attributes_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_attributes_free" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_attributes_free" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_attributes_free" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_initialize in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_condition_initialize in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_condition_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_initialize in -lcthreads" >&5 +printf %s "checking for libcthreads_condition_initialize in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_condition_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18029,40 +24941,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_condition_initialize (); int -main () +main (void) { return libcthreads_condition_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_condition_initialize=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_condition_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_initialize" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_condition_initialize" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_condition_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_condition_initialize" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_condition_initialize" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_free in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_condition_free in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_condition_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_free in -lcthreads" >&5 +printf %s "checking for libcthreads_condition_free in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_condition_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18071,40 +24983,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_condition_free (); int -main () +main (void) { return libcthreads_condition_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_condition_free=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_condition_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_free" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_condition_free" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_condition_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_free" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_condition_free" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_condition_free" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_broadcast in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_condition_broadcast in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_condition_broadcast+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_broadcast in -lcthreads" >&5 +printf %s "checking for libcthreads_condition_broadcast in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_condition_broadcast+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18113,40 +25025,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_condition_broadcast (); int -main () +main (void) { return libcthreads_condition_broadcast (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_condition_broadcast=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_condition_broadcast=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_broadcast" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_condition_broadcast" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_condition_broadcast" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_broadcast" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_condition_broadcast" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_condition_broadcast" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_signal in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_condition_signal in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_condition_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_signal in -lcthreads" >&5 +printf %s "checking for libcthreads_condition_signal in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_condition_signal+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18155,40 +25067,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_condition_signal (); int -main () +main (void) { return libcthreads_condition_signal (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_condition_signal=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_condition_signal=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_signal" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_condition_signal" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_condition_signal" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_signal" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_condition_signal" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_condition_signal" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_wait in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_condition_wait in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_condition_wait+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_condition_wait in -lcthreads" >&5 +printf %s "checking for libcthreads_condition_wait in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_condition_wait+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18197,41 +25109,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_condition_wait (); int -main () +main (void) { return libcthreads_condition_wait (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_condition_wait=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_condition_wait=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_wait" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_condition_wait" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_condition_wait" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_condition_wait" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_condition_wait" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_condition_wait" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_initialize in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_lock_initialize in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_lock_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_initialize in -lcthreads" >&5 +printf %s "checking for libcthreads_lock_initialize in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_lock_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18240,40 +25152,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_lock_initialize (); int -main () +main (void) { return libcthreads_lock_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_lock_initialize=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_lock_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_initialize" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_lock_initialize" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_lock_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_lock_initialize" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_lock_initialize" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_free in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_lock_free in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_lock_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_free in -lcthreads" >&5 +printf %s "checking for libcthreads_lock_free in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_lock_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18282,40 +25194,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_lock_free (); int -main () +main (void) { return libcthreads_lock_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_lock_free=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_lock_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_free" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_lock_free" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_lock_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_free" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_lock_free" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_lock_free" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_grab in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_lock_grab in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_lock_grab+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_grab in -lcthreads" >&5 +printf %s "checking for libcthreads_lock_grab in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_lock_grab+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18324,40 +25236,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_lock_grab (); int -main () +main (void) { return libcthreads_lock_grab (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_lock_grab=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_lock_grab=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_grab" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_lock_grab" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_lock_grab" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_grab" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_lock_grab" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_lock_grab" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_release in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_lock_release in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_lock_release+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_lock_release in -lcthreads" >&5 +printf %s "checking for libcthreads_lock_release in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_lock_release+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18366,41 +25278,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_lock_release (); int -main () +main (void) { return libcthreads_lock_release (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_lock_release=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_lock_release=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_release" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_lock_release" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_lock_release" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_lock_release" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_lock_release" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_lock_release" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_initialize in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_mutex_initialize in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_mutex_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_initialize in -lcthreads" >&5 +printf %s "checking for libcthreads_mutex_initialize in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_mutex_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18409,40 +25321,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_mutex_initialize (); int -main () +main (void) { return libcthreads_mutex_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_mutex_initialize=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_mutex_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_initialize" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_initialize" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_mutex_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_mutex_initialize" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_mutex_initialize" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_free in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_mutex_free in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_mutex_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_free in -lcthreads" >&5 +printf %s "checking for libcthreads_mutex_free in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_mutex_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18451,40 +25363,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_mutex_free (); int -main () +main (void) { return libcthreads_mutex_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_mutex_free=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_mutex_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_free" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_free" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_mutex_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_free" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_mutex_free" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_mutex_free" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_grab in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_mutex_grab in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_mutex_grab+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_grab in -lcthreads" >&5 +printf %s "checking for libcthreads_mutex_grab in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_mutex_grab+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18493,40 +25405,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_mutex_grab (); int -main () +main (void) { return libcthreads_mutex_grab (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_mutex_grab=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_mutex_grab=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_grab" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_grab" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_mutex_grab" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_grab" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_mutex_grab" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_mutex_grab" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_try_grab in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_mutex_try_grab in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_mutex_try_grab+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_try_grab in -lcthreads" >&5 +printf %s "checking for libcthreads_mutex_try_grab in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_mutex_try_grab+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18535,40 +25447,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_mutex_try_grab (); int -main () +main (void) { return libcthreads_mutex_try_grab (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_mutex_try_grab=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_mutex_try_grab=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_try_grab" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_try_grab" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_mutex_try_grab" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_try_grab" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_mutex_try_grab" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_mutex_try_grab" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_release in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_mutex_release in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_mutex_release+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_mutex_release in -lcthreads" >&5 +printf %s "checking for libcthreads_mutex_release in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_mutex_release+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18577,41 +25489,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_mutex_release (); int -main () +main (void) { return libcthreads_mutex_release (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_mutex_release=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_mutex_release=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_release" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_mutex_release" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_mutex_release" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_mutex_release" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_mutex_release" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_mutex_release" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_initialize in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_read_write_lock_initialize in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_initialize in -lcthreads" >&5 +printf %s "checking for libcthreads_read_write_lock_initialize in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18620,40 +25532,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_read_write_lock_initialize (); int -main () +main (void) { return libcthreads_read_write_lock_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_initialize" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_free in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_read_write_lock_free in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_free in -lcthreads" >&5 +printf %s "checking for libcthreads_read_write_lock_free in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_read_write_lock_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18662,40 +25574,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_read_write_lock_free (); int -main () +main (void) { return libcthreads_read_write_lock_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_read_write_lock_free=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_read_write_lock_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_free" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_free" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_free" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_read_write_lock_free" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_free" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_grab_for_read in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_read_write_lock_grab_for_read in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_grab_for_read in -lcthreads" >&5 +printf %s "checking for libcthreads_read_write_lock_grab_for_read in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18704,40 +25616,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_read_write_lock_grab_for_read (); int -main () +main (void) { return libcthreads_read_write_lock_grab_for_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_read" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_grab_for_write in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_read_write_lock_grab_for_write in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_grab_for_write in -lcthreads" >&5 +printf %s "checking for libcthreads_read_write_lock_grab_for_write in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18746,40 +25658,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_read_write_lock_grab_for_write (); int -main () +main (void) { return libcthreads_read_write_lock_grab_for_write (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_grab_for_write" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_release_for_read in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_read_write_lock_release_for_read in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_release_for_read in -lcthreads" >&5 +printf %s "checking for libcthreads_read_write_lock_release_for_read in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18788,40 +25700,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_read_write_lock_release_for_read (); int -main () +main (void) { return libcthreads_read_write_lock_release_for_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_read" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_release_for_write in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_read_write_lock_release_for_write in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_read_write_lock_release_for_write in -lcthreads" >&5 +printf %s "checking for libcthreads_read_write_lock_release_for_write in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18830,41 +25742,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_read_write_lock_release_for_write (); int -main () +main (void) { return libcthreads_read_write_lock_release_for_write (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_read_write_lock_release_for_write" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_initialize in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_initialize in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_initialize in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_initialize in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18873,40 +25785,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_initialize (); int -main () +main (void) { return libcthreads_queue_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_initialize=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_initialize" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_initialize" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_initialize" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_initialize" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_free in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_free in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_free in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_free in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18915,40 +25827,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_free (); int -main () +main (void) { return libcthreads_queue_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_free=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_free" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_free" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_free" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_free" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_free" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_type_pop in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_type_pop in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_type_pop+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_type_pop in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_type_pop in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_type_pop+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18957,40 +25869,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_type_pop (); int -main () +main (void) { return libcthreads_queue_type_pop (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_type_pop=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_type_pop=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_type_pop" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_type_pop" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_type_pop" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_type_pop" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_type_pop" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_type_pop" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_pop in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_pop in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_pop+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_pop in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_pop in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_pop+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18999,40 +25911,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_pop (); int -main () +main (void) { return libcthreads_queue_pop (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_pop=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_pop=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_pop" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_pop" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_pop" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_pop" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_pop" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_pop" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_try_push in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_try_push in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_try_push+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_try_push in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_try_push in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_try_push+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19041,40 +25953,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_try_push (); int -main () +main (void) { return libcthreads_queue_try_push (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_try_push=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_try_push=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_try_push" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_try_push" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_try_push" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_try_push" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_try_push" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_try_push" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_push in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_push in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_push+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_push in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_push in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_push+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19083,40 +25995,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_push (); int -main () +main (void) { return libcthreads_queue_push (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_push=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_push=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_push" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_push" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_push" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_push" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_push" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_push" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_push_sorted in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_queue_push_sorted in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_queue_push_sorted+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_queue_push_sorted in -lcthreads" >&5 +printf %s "checking for libcthreads_queue_push_sorted in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_queue_push_sorted+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19125,41 +26037,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_queue_push_sorted (); int -main () +main (void) { return libcthreads_queue_push_sorted (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_queue_push_sorted=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_queue_push_sorted=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_push_sorted" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_queue_push_sorted" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_queue_push_sorted" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_queue_push_sorted" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_queue_push_sorted" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_queue_push_sorted" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_create in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_pool_create in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_pool_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_create in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_pool_create in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_pool_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19168,40 +26080,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_pool_create (); int -main () +main (void) { return libcthreads_thread_pool_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_pool_create=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_pool_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_create" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_create" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_create" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_pool_create" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_create" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_push in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_pool_push in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_pool_push+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_push in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_pool_push in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_pool_push+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19210,40 +26122,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_pool_push (); int -main () +main (void) { return libcthreads_thread_pool_push (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_pool_push=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_pool_push=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_push" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_push" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_push" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_push" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_pool_push" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_push" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_push_sorted in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_pool_push_sorted in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_push_sorted in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_pool_push_sorted in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19252,40 +26164,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_pool_push_sorted (); int -main () +main (void) { return libcthreads_thread_pool_push_sorted (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_push_sorted" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_join in -lcthreads" >&5 -$as_echo_n "checking for libcthreads_thread_pool_join in -lcthreads... " >&6; } -if ${ac_cv_lib_cthreads_libcthreads_thread_pool_join+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcthreads_thread_pool_join in -lcthreads" >&5 +printf %s "checking for libcthreads_thread_pool_join in -lcthreads... " >&6; } +if test ${ac_cv_lib_cthreads_libcthreads_thread_pool_join+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19294,32 +26206,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcthreads_thread_pool_join (); int -main () +main (void) { return libcthreads_thread_pool_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cthreads_libcthreads_thread_pool_join=yes -else +else $as_nop ac_cv_lib_cthreads_libcthreads_thread_pool_join=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_join" >&5 -$as_echo "$ac_cv_lib_cthreads_libcthreads_thread_pool_join" >&6; } -if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_join" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cthreads_libcthreads_thread_pool_join" >&5 +printf "%s\n" "$ac_cv_lib_cthreads_libcthreads_thread_pool_join" >&6; } +if test "x$ac_cv_lib_cthreads_libcthreads_thread_pool_join" = xyes +then : ac_cv_libcthreads_dummy=yes -else +else $as_nop ac_cv_libcthreads=no fi @@ -19329,9 +26240,10 @@ fi - if test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_libcthreads" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect && test "x$ac_cv_libcthreads" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcthreads in directory: $ac_cv_with_libcthreads See \`config.log' for more details" "$LINENO" 5; } @@ -19339,88 +26251,95 @@ fi - if test "x$ac_cv_libcthreads" = xyes; then : + if test "x$ac_cv_libcthreads" = xyes +then : -$as_echo "#define HAVE_LIBCTHREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCTHREADS 1" >>confdefs.h fi - if test "x$ac_cv_libcthreads" = xyes; then : + if test "x$ac_cv_libcthreads" = xyes +then : ac_cv_libcthreads_multi_threading=libcthreads -else +else $as_nop ac_cv_libcthreads_multi_threading=no fi - if test "x$ac_cv_libcthreads" = xyes; then : + if test "x$ac_cv_libcthreads" = xyes +then : HAVE_LIBCTHREADS=1 -else +else $as_nop HAVE_LIBCTHREADS=0 fi - if test "x$ac_cv_libcthreads" != xyes; then : - if test "x$ac_cv_enable_winapi" = xno; then : + if test "x$ac_cv_libcthreads" != xyes +then : + if test "x$ac_cv_enable_winapi" = xno +then : # Check whether --with-pthread was given. -if test "${with_pthread+set}" = set; then : +if test ${with_pthread+y} +then : withval=$with_pthread; ac_cv_with_pthread=$withval -else +else $as_nop ac_cv_with_pthread=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread" >&5 -$as_echo_n "checking whether to use search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread... " >&6; } -if ${ac_cv_with_pthread+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread" >&5 +printf %s "checking whether to use search for pthread in includedir and libdir or in the specified DIR, or no if not to use pthread... " >&6; } +if test ${ac_cv_with_pthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_pthread=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pthread" >&5 -$as_echo "$ac_cv_with_pthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pthread" >&5 +printf "%s\n" "$ac_cv_with_pthread" >&6; } - if test "x$ac_cv_with_pthread" != x && test "x$ac_cv_with_pthread" != xno && test "x$ac_cv_with_pthread" != xauto-detect; then : - if test -d "$ac_cv_with_pthread"; then : + if test "x$ac_cv_with_pthread" != x && test "x$ac_cv_with_pthread" != xno && test "x$ac_cv_with_pthread" != xauto-detect +then : + if test -d "$ac_cv_with_pthread" +then : CFLAGS="$CFLAGS -I${ac_cv_with_pthread}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_pthread}/lib" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_pthread" >&5 -$as_echo "$as_me: WARNING: no such directory: $ac_cv_with_pthread" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_pthread" >&5 +printf "%s\n" "$as_me: WARNING: no such directory: $ac_cv_with_pthread" >&2;} fi fi - if test "x$ac_cv_with_pthread" = xno; then : + if test "x$ac_cv_with_pthread" = xno +then : ac_cv_pthread=no -else - for ac_header in pthread.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_H 1 -_ACEOF +else $as_nop + ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_pthread_h" = xno; then : + if test "x$ac_cv_header_pthread_h" = xno +then : ac_cv_pthread=no -else +else $as_nop ac_cv_pthread=pthread - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19429,40 +26348,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_create (); int -main () +main (void) { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_create=yes -else +else $as_nop ac_cv_lib_pthread_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_exit in -lpthread" >&5 -$as_echo_n "checking for pthread_exit in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_exit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_exit in -lpthread" >&5 +printf %s "checking for pthread_exit in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_exit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19471,40 +26390,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_exit (); int -main () +main (void) { return pthread_exit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_exit=yes -else +else $as_nop ac_cv_lib_pthread_pthread_exit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_exit" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_exit" >&6; } -if test "x$ac_cv_lib_pthread_pthread_exit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_exit" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_exit" >&6; } +if test "x$ac_cv_lib_pthread_pthread_exit" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 -$as_echo_n "checking for pthread_join in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_join+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 +printf %s "checking for pthread_join in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_join+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19513,41 +26432,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_join (); int -main () +main (void) { return pthread_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_join=yes -else +else $as_nop ac_cv_lib_pthread_pthread_join=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } -if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_join" >&6; } +if test "x$ac_cv_lib_pthread_pthread_join" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_init in -lpthread" >&5 -$as_echo_n "checking for pthread_cond_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_cond_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_init in -lpthread" >&5 +printf %s "checking for pthread_cond_init in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_cond_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19556,40 +26475,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_cond_init (); int -main () +main (void) { return pthread_cond_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_cond_init=yes -else +else $as_nop ac_cv_lib_pthread_pthread_cond_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_init" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_cond_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_cond_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_init" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_cond_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_cond_init" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_destroy in -lpthread" >&5 -$as_echo_n "checking for pthread_cond_destroy in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_cond_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_destroy in -lpthread" >&5 +printf %s "checking for pthread_cond_destroy in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_cond_destroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19598,40 +26517,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_cond_destroy (); int -main () +main (void) { return pthread_cond_destroy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_cond_destroy=yes -else +else $as_nop ac_cv_lib_pthread_pthread_cond_destroy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_destroy" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_cond_destroy" >&6; } -if test "x$ac_cv_lib_pthread_pthread_cond_destroy" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_destroy" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_cond_destroy" >&6; } +if test "x$ac_cv_lib_pthread_pthread_cond_destroy" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_broadcast in -lpthread" >&5 -$as_echo_n "checking for pthread_cond_broadcast in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_cond_broadcast+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_broadcast in -lpthread" >&5 +printf %s "checking for pthread_cond_broadcast in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_cond_broadcast+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19640,40 +26559,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_cond_broadcast (); int -main () +main (void) { return pthread_cond_broadcast (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_cond_broadcast=yes -else +else $as_nop ac_cv_lib_pthread_pthread_cond_broadcast=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_broadcast" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_cond_broadcast" >&6; } -if test "x$ac_cv_lib_pthread_pthread_cond_broadcast" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_broadcast" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_cond_broadcast" >&6; } +if test "x$ac_cv_lib_pthread_pthread_cond_broadcast" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_signal in -lpthread" >&5 -$as_echo_n "checking for pthread_cond_signal in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_cond_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_signal in -lpthread" >&5 +printf %s "checking for pthread_cond_signal in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_cond_signal+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19682,40 +26601,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_cond_signal (); int -main () +main (void) { return pthread_cond_signal (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_cond_signal=yes -else +else $as_nop ac_cv_lib_pthread_pthread_cond_signal=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_signal" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_cond_signal" >&6; } -if test "x$ac_cv_lib_pthread_pthread_cond_signal" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_signal" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_cond_signal" >&6; } +if test "x$ac_cv_lib_pthread_pthread_cond_signal" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_wait in -lpthread" >&5 -$as_echo_n "checking for pthread_cond_wait in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_cond_wait+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_wait in -lpthread" >&5 +printf %s "checking for pthread_cond_wait in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_cond_wait+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19724,41 +26643,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_cond_wait (); int -main () +main (void) { return pthread_cond_wait (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_cond_wait=yes -else +else $as_nop ac_cv_lib_pthread_pthread_cond_wait=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_wait" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_cond_wait" >&6; } -if test "x$ac_cv_lib_pthread_pthread_cond_wait" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_cond_wait" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_cond_wait" >&6; } +if test "x$ac_cv_lib_pthread_pthread_cond_wait" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 +printf %s "checking for pthread_mutex_init in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_mutex_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19767,40 +26686,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_mutex_init (); int -main () +main (void) { return pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_mutex_init=yes -else +else $as_nop ac_cv_lib_pthread_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_destroy in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_destroy in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_destroy in -lpthread" >&5 +printf %s "checking for pthread_mutex_destroy in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_mutex_destroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19809,40 +26728,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_mutex_destroy (); int -main () +main (void) { return pthread_mutex_destroy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_mutex_destroy=yes -else +else $as_nop ac_cv_lib_pthread_pthread_mutex_destroy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_destroy" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_destroy" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_destroy" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_destroy" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_destroy" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_destroy" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_lock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5 +printf %s "checking for pthread_mutex_lock in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_mutex_lock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19851,40 +26770,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_mutex_lock (); int -main () +main (void) { return pthread_mutex_lock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_mutex_lock=yes -else +else $as_nop ac_cv_lib_pthread_pthread_mutex_lock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_lock" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_lock" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_lock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_lock" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_lock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_lock" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_trylock in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_trylock in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_trylock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_trylock in -lpthread" >&5 +printf %s "checking for pthread_mutex_trylock in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_mutex_trylock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19893,40 +26812,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_mutex_trylock (); int -main () +main (void) { return pthread_mutex_trylock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_mutex_trylock=yes -else +else $as_nop ac_cv_lib_pthread_pthread_mutex_trylock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_trylock" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_trylock" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_trylock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_trylock" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_trylock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_trylock" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_unlock in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_unlock in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_unlock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_unlock in -lpthread" >&5 +printf %s "checking for pthread_mutex_unlock in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_mutex_unlock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19935,41 +26854,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_mutex_unlock (); int -main () +main (void) { return pthread_mutex_unlock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_mutex_unlock=yes -else +else $as_nop ac_cv_lib_pthread_pthread_mutex_unlock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_unlock" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_unlock" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_unlock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_unlock" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_mutex_unlock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_unlock" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_init in -lpthread" >&5 -$as_echo_n "checking for pthread_rwlock_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_rwlock_init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_init in -lpthread" >&5 +printf %s "checking for pthread_rwlock_init in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_rwlock_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19978,40 +26897,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_rwlock_init (); int -main () +main (void) { return pthread_rwlock_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_rwlock_init=yes -else +else $as_nop ac_cv_lib_pthread_pthread_rwlock_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_init" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_rwlock_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_rwlock_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_init" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_rwlock_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_rwlock_init" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy in -lpthread" >&5 -$as_echo_n "checking for pthread_rwlock_destroy in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_rwlock_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_destroy in -lpthread" >&5 +printf %s "checking for pthread_rwlock_destroy in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_rwlock_destroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20020,40 +26939,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_rwlock_destroy (); int -main () +main (void) { return pthread_rwlock_destroy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_rwlock_destroy=yes -else +else $as_nop ac_cv_lib_pthread_pthread_rwlock_destroy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_destroy" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_rwlock_destroy" >&6; } -if test "x$ac_cv_lib_pthread_pthread_rwlock_destroy" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_destroy" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_rwlock_destroy" >&6; } +if test "x$ac_cv_lib_pthread_pthread_rwlock_destroy" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_rdlock in -lpthread" >&5 -$as_echo_n "checking for pthread_rwlock_rdlock in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_rwlock_rdlock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_rdlock in -lpthread" >&5 +printf %s "checking for pthread_rwlock_rdlock in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_rwlock_rdlock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20062,40 +26981,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_rwlock_rdlock (); int -main () +main (void) { return pthread_rwlock_rdlock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_rwlock_rdlock=yes -else +else $as_nop ac_cv_lib_pthread_pthread_rwlock_rdlock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_rdlock" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_rwlock_rdlock" >&6; } -if test "x$ac_cv_lib_pthread_pthread_rwlock_rdlock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_rdlock" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_rwlock_rdlock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_rwlock_rdlock" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_wrlock in -lpthread" >&5 -$as_echo_n "checking for pthread_rwlock_wrlock in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_rwlock_wrlock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_wrlock in -lpthread" >&5 +printf %s "checking for pthread_rwlock_wrlock in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_rwlock_wrlock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20104,40 +27023,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_rwlock_wrlock (); int -main () +main (void) { return pthread_rwlock_wrlock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_rwlock_wrlock=yes -else +else $as_nop ac_cv_lib_pthread_pthread_rwlock_wrlock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_wrlock" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_rwlock_wrlock" >&6; } -if test "x$ac_cv_lib_pthread_pthread_rwlock_wrlock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_wrlock" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_rwlock_wrlock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_rwlock_wrlock" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_unlock in -lpthread" >&5 -$as_echo_n "checking for pthread_rwlock_unlock in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_rwlock_unlock+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_unlock in -lpthread" >&5 +printf %s "checking for pthread_rwlock_unlock in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_rwlock_unlock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20146,32 +27065,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_rwlock_unlock (); int -main () +main (void) { return pthread_rwlock_unlock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread_pthread_rwlock_unlock=yes -else +else $as_nop ac_cv_lib_pthread_pthread_rwlock_unlock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_unlock" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_rwlock_unlock" >&6; } -if test "x$ac_cv_lib_pthread_pthread_rwlock_unlock" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_rwlock_unlock" >&5 +printf "%s\n" "$ac_cv_lib_pthread_pthread_rwlock_unlock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_rwlock_unlock" = xyes +then : ac_pthread_dummy=yes -else +else $as_nop ac_cv_pthread=no fi @@ -20182,57 +27100,63 @@ fi - if test "x$ac_cv_pthread" = xpthread; then : + if test "x$ac_cv_pthread" = xpthread +then : -$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h fi - if test "x$ac_cv_pthread" != xno; then : + if test "x$ac_cv_pthread" != xno +then : HAVE_PTHREAD=1 -else +else $as_nop HAVE_PTHREAD=0 fi - if test "x$ac_cv_pthread_CPPFLAGS" != "x"; then : + if test "x$ac_cv_pthread_CPPFLAGS" != "x" +then : PTHREAD_CPPFLAGS=$ac_cv_pthread_CPPFLAGS fi - if test "x$ac_cv_pthread_LIBADD" != "x"; then : + if test "x$ac_cv_pthread_LIBADD" != "x" +then : PTHREAD_LIBADD=$ac_cv_pthread_LIBADD fi - if test "x$ac_cv_pthread" = xpthread; then : + if test "x$ac_cv_pthread" = xpthread +then : ax_pthread_pc_libs_private=-lpthread fi ac_cv_libcthreads_multi_threading=$ac_cv_pthread -else +else $as_nop ac_cv_libcthreads_multi_threading="winapi" fi - if test "x$ac_cv_libcthreads_multi_threading" != xno; then : + if test "x$ac_cv_libcthreads_multi_threading" != xno +then : ac_cv_libcthreads_CPPFLAGS="-I../libcthreads"; ac_cv_libcthreads_LIBADD="../libcthreads/libcthreads.la"; ac_cv_libcthreads=local -else +else $as_nop ac_cv_libcthreads=no fi -$as_echo "#define HAVE_LOCAL_LIBCTHREADS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCTHREADS 1" >>confdefs.h HAVE_LOCAL_LIBCTHREADS=1 @@ -20249,36 +27173,41 @@ HAVE_LOCAL_LIBCTHREADS_FALSE= fi - if test "x$ac_cv_libcthreads_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcthreads_CPPFLAGS" != "x" +then : LIBCTHREADS_CPPFLAGS=$ac_cv_libcthreads_CPPFLAGS fi - if test "x$ac_cv_libcthreads_LIBADD" != "x"; then : + if test "x$ac_cv_libcthreads_LIBADD" != "x" +then : LIBCTHREADS_LIBADD=$ac_cv_libcthreads_LIBADD fi - if test "x$ac_cv_libcthreads" != xno; then : + if test "x$ac_cv_libcthreads" != xno +then : -$as_echo "#define HAVE_MULTI_THREAD_SUPPORT 1" >>confdefs.h +printf "%s\n" "#define HAVE_MULTI_THREAD_SUPPORT 1" >>confdefs.h HAVE_MULTI_THREAD_SUPPORT=1 -else +else $as_nop HAVE_MULTI_THREAD_SUPPORT=0 fi - if test "x$ac_cv_libcthreads" = xyes; then : + if test "x$ac_cv_libcthreads" = xyes +then : ax_libcthreads_pc_libs_private=-lcthreads fi - if test "x$ac_cv_libcthreads" = xyes; then : + if test "x$ac_cv_libcthreads" = xyes +then : ax_libcthreads_spec_requires=libcthreads ax_libcthreads_spec_build_requires=libcthreads-devel @@ -20290,54 +27219,61 @@ # Check whether --with-libcdata was given. -if test "${with_libcdata+set}" = set; then : +if test ${with_libcdata+y} +then : withval=$with_libcdata; ac_cv_with_libcdata=$withval -else +else $as_nop ac_cv_with_libcdata=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcdata+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcdata in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcdata+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcdata=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcdata" >&5 -$as_echo "$ac_cv_with_libcdata" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcdata" >&5 +printf "%s\n" "$ac_cv_with_libcdata" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdata" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdata" = xno +then : ac_cv_libcdata=no -else - if test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect; then : - if test -d "$ac_cv_with_libcdata"; then : +else $as_nop + ac_cv_libcdata=check + if test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect +then : + if test -d "$ac_cv_with_libcdata" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcdata}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcdata}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcdata See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcdata=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata" >&5 -$as_echo_n "checking for libcdata... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata >= 20230108" >&5 +printf %s "checking for libcdata >= 20230108... " >&6; } if test -n "$libcdata_CFLAGS"; then pkg_cv_libcdata_CFLAGS="$libcdata_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdata >= 20181216\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libcdata >= 20181216") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdata >= 20230108\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcdata >= 20230108") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libcdata_CFLAGS=`$PKG_CONFIG --cflags "libcdata >= 20181216" 2>/dev/null` + pkg_cv_libcdata_CFLAGS=`$PKG_CONFIG --cflags "libcdata >= 20230108" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20349,12 +27285,12 @@ pkg_cv_libcdata_LIBS="$libcdata_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdata >= 20181216\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libcdata >= 20181216") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdata >= 20230108\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcdata >= 20230108") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libcdata_LIBS=`$PKG_CONFIG --libs "libcdata >= 20181216" 2>/dev/null` + pkg_cv_libcdata_LIBS=`$PKG_CONFIG --libs "libcdata >= 20230108" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20366,8 +27302,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -20375,58 +27311,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcdata_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcdata >= 20181216" 2>&1` + libcdata_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcdata >= 20230108" 2>&1` else - libcdata_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcdata >= 20181216" 2>&1` + libcdata_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcdata >= 20230108" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcdata_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcdata_PKG_ERRORS" >&5 - ac_cv_libcdata=check + ac_cv_libcdata=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcdata=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcdata=check else - libcdata_CFLAGS=$pkg_cv_libcdata_CFLAGS - libcdata_LIBS=$pkg_cv_libcdata_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcdata=yes + libcdata_CFLAGS=$pkg_cv_libcdata_CFLAGS + libcdata_LIBS=$pkg_cv_libcdata_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcdata=yes fi fi - if test "x$ac_cv_libcdata" = xyes; then : + if test "x$ac_cv_libcdata" = xyes +then : ac_cv_libcdata_CPPFLAGS="$pkg_cv_libcdata_CFLAGS" ac_cv_libcdata_LIBADD="$pkg_cv_libcdata_LIBS" fi fi - if test "x$ac_cv_libcdata" = xcheck; then : - for ac_header in libcdata.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcdata.h" "ac_cv_header_libcdata_h" "$ac_includes_default" -if test "x$ac_cv_header_libcdata_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCDATA_H 1 -_ACEOF + if test "x$ac_cv_libcdata" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcdata.h" "ac_cv_header_libcdata_h" "$ac_includes_default" +if test "x$ac_cv_header_libcdata_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCDATA_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcdata_h" = xno; then : + if test "x$ac_cv_header_libcdata_h" = xno +then : ac_cv_libcdata=no -else +else $as_nop ac_cv_libcdata=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_get_version in -lcdata" >&5 -$as_echo_n "checking for libcdata_get_version in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_get_version in -lcdata" >&5 +printf %s "checking for libcdata_get_version in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20435,41 +27370,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_get_version (); int -main () +main (void) { return libcdata_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_get_version=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_get_version" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_get_version" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_get_version" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_get_version" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_get_version" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_initialize in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_initialize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_initialize in -lcdata" >&5 +printf %s "checking for libcdata_array_initialize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20478,40 +27413,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_initialize (); int -main () +main (void) { return libcdata_array_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_initialize=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_initialize" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_initialize" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_initialize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_initialize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_free in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_free in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_free in -lcdata" >&5 +printf %s "checking for libcdata_array_free in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20520,40 +27455,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_free (); int -main () +main (void) { return libcdata_array_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_free=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_free" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_free" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_free" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_free" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_free" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_empty in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_empty in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_empty in -lcdata" >&5 +printf %s "checking for libcdata_array_empty in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_empty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20562,40 +27497,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_empty (); int -main () +main (void) { return libcdata_array_empty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_empty=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_empty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_empty" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_empty" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_empty" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_empty" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_empty" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_empty" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_clone in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_clone in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_clone in -lcdata" >&5 +printf %s "checking for libcdata_array_clone in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20604,40 +27539,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_clone (); int -main () +main (void) { return libcdata_array_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_clone=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_clone" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_clone" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_clone" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_clone" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_clone" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_resize in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_resize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_resize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_resize in -lcdata" >&5 +printf %s "checking for libcdata_array_resize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_resize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20646,40 +27581,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_resize (); int -main () +main (void) { return libcdata_array_resize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_resize=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_resize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_resize" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_resize" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_resize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_resize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_resize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_resize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_reverse in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_reverse in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_reverse+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_reverse in -lcdata" >&5 +printf %s "checking for libcdata_array_reverse in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_reverse+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20688,40 +27623,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_reverse (); int -main () +main (void) { return libcdata_array_reverse (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_reverse=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_reverse=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_reverse" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_reverse" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_reverse" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_reverse" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_reverse" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_reverse" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_number_of_entries in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_get_number_of_entries in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_get_number_of_entries+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_number_of_entries in -lcdata" >&5 +printf %s "checking for libcdata_array_get_number_of_entries in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_get_number_of_entries+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20730,40 +27665,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_get_number_of_entries (); int -main () +main (void) { return libcdata_array_get_number_of_entries (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_get_number_of_entries=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_get_number_of_entries=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_number_of_entries" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_get_number_of_entries" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_get_number_of_entries" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_number_of_entries" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_get_number_of_entries" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_get_number_of_entries" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_entry_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_get_entry_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_get_entry_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_entry_by_index in -lcdata" >&5 +printf %s "checking for libcdata_array_get_entry_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_get_entry_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20772,40 +27707,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_get_entry_by_index (); int -main () +main (void) { return libcdata_array_get_entry_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_get_entry_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_get_entry_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_entry_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_get_entry_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_get_entry_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_entry_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_get_entry_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_get_entry_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_entry_by_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_get_entry_by_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_get_entry_by_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_get_entry_by_value in -lcdata" >&5 +printf %s "checking for libcdata_array_get_entry_by_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_get_entry_by_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20814,40 +27749,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_get_entry_by_value (); int -main () +main (void) { return libcdata_array_get_entry_by_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_get_entry_by_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_get_entry_by_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_entry_by_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_get_entry_by_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_get_entry_by_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_get_entry_by_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_get_entry_by_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_get_entry_by_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_set_entry_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_set_entry_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_set_entry_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_set_entry_by_index in -lcdata" >&5 +printf %s "checking for libcdata_array_set_entry_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_set_entry_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20856,40 +27791,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_set_entry_by_index (); int -main () +main (void) { return libcdata_array_set_entry_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_set_entry_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_set_entry_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_set_entry_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_set_entry_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_set_entry_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_set_entry_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_set_entry_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_set_entry_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_prepend_entry in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_prepend_entry in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_prepend_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_prepend_entry in -lcdata" >&5 +printf %s "checking for libcdata_array_prepend_entry in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_prepend_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20898,40 +27833,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_prepend_entry (); int -main () +main (void) { return libcdata_array_prepend_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_prepend_entry=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_prepend_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_prepend_entry" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_prepend_entry" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_prepend_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_prepend_entry" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_prepend_entry" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_prepend_entry" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_append_entry in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_append_entry in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_append_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_append_entry in -lcdata" >&5 +printf %s "checking for libcdata_array_append_entry in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_append_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20940,40 +27875,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_append_entry (); int -main () +main (void) { return libcdata_array_append_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_append_entry=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_append_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_append_entry" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_append_entry" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_append_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_append_entry" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_append_entry" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_append_entry" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_insert_entry in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_insert_entry in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_insert_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_insert_entry in -lcdata" >&5 +printf %s "checking for libcdata_array_insert_entry in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_insert_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20982,40 +27917,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_insert_entry (); int -main () +main (void) { return libcdata_array_insert_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_insert_entry=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_insert_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_insert_entry" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_insert_entry" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_insert_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_insert_entry" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_insert_entry" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_insert_entry" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_remove_entry in -lcdata" >&5 -$as_echo_n "checking for libcdata_array_remove_entry in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_array_remove_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_array_remove_entry in -lcdata" >&5 +printf %s "checking for libcdata_array_remove_entry in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_array_remove_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21024,41 +27959,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_array_remove_entry (); int -main () +main (void) { return libcdata_array_remove_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_array_remove_entry=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_array_remove_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_remove_entry" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_array_remove_entry" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_array_remove_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_array_remove_entry" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_array_remove_entry" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_array_remove_entry" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_btree_initialize in -lcdata" >&5 -$as_echo_n "checking for libfdata_btree_initialize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libfdata_btree_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_initialize in -lcdata" >&5 +printf %s "checking for libcdata_btree_initialize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21067,40 +28002,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_btree_initialize (); +char libcdata_btree_initialize (); int -main () +main (void) { -return libfdata_btree_initialize (); +return libcdata_btree_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_cdata_libfdata_btree_initialize=yes -else - ac_cv_lib_cdata_libfdata_btree_initialize=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cdata_libcdata_btree_initialize=yes +else $as_nop + ac_cv_lib_cdata_libcdata_btree_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libfdata_btree_initialize" >&5 -$as_echo "$ac_cv_lib_cdata_libfdata_btree_initialize" >&6; } -if test "x$ac_cv_lib_cdata_libfdata_btree_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_initialize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_initialize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_free in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_free in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_free in -lcdata" >&5 +printf %s "checking for libcdata_btree_free in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21109,40 +28044,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_free (); int -main () +main (void) { return libcdata_btree_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_free=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_free" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_free" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_free" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_free" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_free" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_number_of_values in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_get_number_of_values in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_get_number_of_values+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_number_of_values in -lcdata" >&5 +printf %s "checking for libcdata_btree_get_number_of_values in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_get_number_of_values+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21151,40 +28086,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_get_number_of_values (); int -main () +main (void) { return libcdata_btree_get_number_of_values (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_get_number_of_values=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_get_number_of_values=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_number_of_values" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_get_number_of_values" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_get_number_of_values" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_number_of_values" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_get_number_of_values" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_get_number_of_values" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_value_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_get_value_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_get_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_value_by_index in -lcdata" >&5 +printf %s "checking for libcdata_btree_get_value_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_get_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21193,40 +28128,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_get_value_by_index (); int -main () +main (void) { return libcdata_btree_get_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_get_value_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_get_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_value_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_get_value_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_get_value_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_get_value_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_get_value_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_value_by_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_get_value_by_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_get_value_by_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_get_value_by_value in -lcdata" >&5 +printf %s "checking for libcdata_btree_get_value_by_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_get_value_by_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21235,40 +28170,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_get_value_by_value (); int -main () +main (void) { return libcdata_btree_get_value_by_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_get_value_by_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_get_value_by_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_value_by_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_get_value_by_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_get_value_by_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_get_value_by_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_get_value_by_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_get_value_by_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_insert_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_insert_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_insert_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_insert_value in -lcdata" >&5 +printf %s "checking for libcdata_btree_insert_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_insert_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21277,40 +28212,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_insert_value (); int -main () +main (void) { return libcdata_btree_insert_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_insert_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_insert_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_insert_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_insert_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_insert_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_insert_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_insert_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_insert_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_replace_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_replace_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_replace_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_replace_value in -lcdata" >&5 +printf %s "checking for libcdata_btree_replace_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_replace_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21319,40 +28254,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_replace_value (); int -main () +main (void) { return libcdata_btree_replace_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_replace_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_replace_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_replace_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_replace_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_replace_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_replace_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_replace_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_replace_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_remove_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_btree_remove_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_btree_remove_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_btree_remove_value in -lcdata" >&5 +printf %s "checking for libcdata_btree_remove_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_btree_remove_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21361,41 +28296,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_btree_remove_value (); int -main () +main (void) { return libcdata_btree_remove_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_btree_remove_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_btree_remove_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_remove_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_btree_remove_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_btree_remove_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_btree_remove_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_btree_remove_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_btree_remove_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_initialize in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_initialize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_initialize in -lcdata" >&5 +printf %s "checking for libcdata_list_initialize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21404,40 +28339,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_initialize (); int -main () +main (void) { return libcdata_list_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_initialize=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_initialize" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_initialize" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_initialize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_initialize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_free in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_free in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_free in -lcdata" >&5 +printf %s "checking for libcdata_list_free in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21446,40 +28381,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_free (); int -main () +main (void) { return libcdata_list_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_free=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_free" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_free" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_free" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_free" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_free" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_empty in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_empty in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_empty in -lcdata" >&5 +printf %s "checking for libcdata_list_empty in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_empty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21488,40 +28423,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_empty (); int -main () +main (void) { return libcdata_list_empty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_empty=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_empty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_empty" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_empty" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_empty" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_empty" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_empty" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_empty" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_clone in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_clone in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_clone in -lcdata" >&5 +printf %s "checking for libcdata_list_clone in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21530,40 +28465,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_clone (); int -main () +main (void) { return libcdata_list_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_clone=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_clone" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_clone" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_clone" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_clone" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_clone" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_number_of_elements in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_get_number_of_elements in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_get_number_of_elements+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_number_of_elements in -lcdata" >&5 +printf %s "checking for libcdata_list_get_number_of_elements in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_get_number_of_elements+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21572,40 +28507,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_get_number_of_elements (); int -main () +main (void) { return libcdata_list_get_number_of_elements (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_get_number_of_elements=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_get_number_of_elements=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_number_of_elements" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_get_number_of_elements" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_get_number_of_elements" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_number_of_elements" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_get_number_of_elements" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_get_number_of_elements" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_first_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_get_first_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_get_first_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_first_element in -lcdata" >&5 +printf %s "checking for libcdata_list_get_first_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_get_first_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21614,40 +28549,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_get_first_element (); int -main () +main (void) { return libcdata_list_get_first_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_get_first_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_get_first_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_first_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_get_first_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_get_first_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_first_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_get_first_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_get_first_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_last_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_get_last_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_get_last_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_last_element in -lcdata" >&5 +printf %s "checking for libcdata_list_get_last_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_get_last_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21656,40 +28591,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_get_last_element (); int -main () +main (void) { return libcdata_list_get_last_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_get_last_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_get_last_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_last_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_get_last_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_get_last_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_last_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_get_last_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_get_last_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_element_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_get_element_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_get_element_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_element_by_index in -lcdata" >&5 +printf %s "checking for libcdata_list_get_element_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_get_element_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21698,40 +28633,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_get_element_by_index (); int -main () +main (void) { return libcdata_list_get_element_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_get_element_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_get_element_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_element_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_get_element_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_get_element_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_element_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_get_element_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_get_element_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_value_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_get_value_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_get_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_get_value_by_index in -lcdata" >&5 +printf %s "checking for libcdata_list_get_value_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_get_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21740,40 +28675,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_get_value_by_index (); int -main () +main (void) { return libcdata_list_get_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_get_value_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_get_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_value_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_get_value_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_get_value_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_get_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_get_value_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_get_value_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_prepend_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_prepend_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_prepend_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_prepend_element in -lcdata" >&5 +printf %s "checking for libcdata_list_prepend_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_prepend_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21782,40 +28717,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_prepend_element (); int -main () +main (void) { return libcdata_list_prepend_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_prepend_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_prepend_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_prepend_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_prepend_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_prepend_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_prepend_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_prepend_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_prepend_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_prepend_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_prepend_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_prepend_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_prepend_value in -lcdata" >&5 +printf %s "checking for libcdata_list_prepend_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_prepend_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21824,40 +28759,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_prepend_value (); int -main () +main (void) { return libcdata_list_prepend_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_prepend_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_prepend_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_prepend_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_prepend_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_prepend_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_prepend_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_prepend_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_prepend_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_append_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_append_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_append_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_append_element in -lcdata" >&5 +printf %s "checking for libcdata_list_append_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_append_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21866,40 +28801,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_append_element (); int -main () +main (void) { return libcdata_list_append_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_append_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_append_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_append_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_append_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_append_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_append_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_append_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_append_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_append_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_append_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_append_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_append_value in -lcdata" >&5 +printf %s "checking for libcdata_list_append_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_append_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21908,40 +28843,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_append_value (); int -main () +main (void) { return libcdata_list_append_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_append_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_append_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_append_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_append_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_append_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_append_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_append_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_append_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_insert_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_insert_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_element in -lcdata" >&5 +printf %s "checking for libcdata_list_insert_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_insert_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21950,40 +28885,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_insert_element (); int -main () +main (void) { return libcdata_list_insert_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_insert_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_insert_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_insert_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_insert_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_insert_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_insert_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_insert_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_insert_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_element_with_existing in -lcdata" >&5 +printf %s "checking for libcdata_list_insert_element_with_existing in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_insert_element_with_existing+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcdata $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libcdata_list_insert_element_with_existing (); +int +main (void) +{ +return libcdata_list_insert_element_with_existing (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cdata_libcdata_list_insert_element_with_existing=yes +else $as_nop + ac_cv_lib_cdata_libcdata_list_insert_element_with_existing=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_element_with_existing" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_insert_element_with_existing" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_insert_element_with_existing" = xyes +then : + ac_cv_libcdata_dummy=yes +else $as_nop + ac_cv_libcdata=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_value in -lcdata" >&5 +printf %s "checking for libcdata_list_insert_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_insert_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21992,40 +28969,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_insert_value (); int -main () +main (void) { return libcdata_list_insert_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_insert_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_insert_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_insert_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_insert_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_insert_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_insert_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_remove_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_remove_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_remove_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_insert_value_with_existing in -lcdata" >&5 +printf %s "checking for libcdata_list_insert_value_with_existing in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_insert_value_with_existing+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcdata $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libcdata_list_insert_value_with_existing (); +int +main (void) +{ +return libcdata_list_insert_value_with_existing (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cdata_libcdata_list_insert_value_with_existing=yes +else $as_nop + ac_cv_lib_cdata_libcdata_list_insert_value_with_existing=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_insert_value_with_existing" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_insert_value_with_existing" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_insert_value_with_existing" = xyes +then : + ac_cv_libcdata_dummy=yes +else $as_nop + ac_cv_libcdata=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_remove_element in -lcdata" >&5 +printf %s "checking for libcdata_list_remove_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_remove_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22034,41 +29053,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_remove_element (); int -main () +main (void) { return libcdata_list_remove_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_remove_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_remove_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_remove_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_remove_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_remove_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_remove_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_remove_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_remove_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_initialize in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_initialize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_initialize in -lcdata" >&5 +printf %s "checking for libcdata_list_element_initialize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22077,40 +29096,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_initialize (); int -main () +main (void) { return libcdata_list_element_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_initialize=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_initialize" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_initialize" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_initialize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_initialize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_free in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_free in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_free in -lcdata" >&5 +printf %s "checking for libcdata_list_element_free in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22119,40 +29138,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_free (); int -main () +main (void) { return libcdata_list_element_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_free=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_free" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_free" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_free" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_free" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_free" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_get_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_get_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_value in -lcdata" >&5 +printf %s "checking for libcdata_list_element_get_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_get_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22161,40 +29180,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_get_value (); int -main () +main (void) { return libcdata_list_element_get_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_get_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_get_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_get_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_get_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_get_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_set_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_set_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_value in -lcdata" >&5 +printf %s "checking for libcdata_list_element_set_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_set_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22203,40 +29222,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_set_value (); int -main () +main (void) { return libcdata_list_element_set_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_set_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_set_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_set_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_set_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_set_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_previous_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_get_previous_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_get_previous_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_previous_element in -lcdata" >&5 +printf %s "checking for libcdata_list_element_get_previous_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_get_previous_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22245,40 +29264,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_get_previous_element (); int -main () +main (void) { return libcdata_list_element_get_previous_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_get_previous_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_get_previous_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_previous_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_previous_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_get_previous_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_previous_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_get_previous_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_get_previous_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_previous_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_set_previous_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_set_previous_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_previous_element in -lcdata" >&5 +printf %s "checking for libcdata_list_element_set_previous_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_set_previous_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22287,40 +29306,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_set_previous_element (); int -main () +main (void) { return libcdata_list_element_set_previous_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_set_previous_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_set_previous_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_previous_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_previous_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_set_previous_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_previous_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_set_previous_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_set_previous_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_next_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_get_next_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_get_next_element+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_next_element in -lcdata" >&5 +printf %s "checking for libcdata_list_element_get_next_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_get_next_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22329,37 +29348,37 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_get_next_element (); int -main () +main (void) { return libcdata_list_element_get_next_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_get_next_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_get_next_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_next_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_next_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_get_next_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_next_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_get_next_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_get_next_element" = xyes +then : ac_cv_libcdata_dummy=yes -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_next_element in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_set_next_element in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_set_next_element+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_next_element in -lcdata" >&5 +printf %s "checking for libcdata_list_element_set_next_element in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_set_next_element+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22368,40 +29387,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_set_next_element (); int -main () +main (void) { return libcdata_list_element_set_next_element (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_set_next_element=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_set_next_element=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_next_element" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_next_element" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_set_next_element" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_next_element" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_set_next_element" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_set_next_element" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_elements in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_get_elements in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_get_elements+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_get_elements in -lcdata" >&5 +printf %s "checking for libcdata_list_element_get_elements in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_get_elements+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22410,40 +29429,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_get_elements (); int -main () +main (void) { return libcdata_list_element_get_elements (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_get_elements=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_get_elements=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_elements" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_get_elements" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_get_elements" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_get_elements" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_get_elements" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_get_elements" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_elements in -lcdata" >&5 -$as_echo_n "checking for libcdata_list_element_set_elements in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_list_element_set_elements+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_list_element_set_elements in -lcdata" >&5 +printf %s "checking for libcdata_list_element_set_elements in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_list_element_set_elements+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22452,32 +29471,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_list_element_set_elements (); int -main () +main (void) { return libcdata_list_element_set_elements (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_list_element_set_elements=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_list_element_set_elements=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_elements" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_list_element_set_elements" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_list_element_set_elements" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_list_element_set_elements" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_list_element_set_elements" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_list_element_set_elements" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi @@ -22485,11 +29503,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_initialize in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_initialize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_initialize in -lcdata" >&5 +printf %s "checking for libcdata_range_list_initialize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22498,40 +29517,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_initialize (); int -main () +main (void) { return libcdata_range_list_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_initialize=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_initialize" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_initialize" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_initialize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_initialize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_free in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_free in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_free in -lcdata" >&5 +printf %s "checking for libcdata_range_list_free in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22540,40 +29559,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_free (); int -main () +main (void) { return libcdata_range_list_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_free=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_free" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_free" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_free" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_free" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_free" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_empty in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_empty in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_empty in -lcdata" >&5 +printf %s "checking for libcdata_range_list_empty in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_empty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22582,40 +29601,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_empty (); int -main () +main (void) { return libcdata_range_list_empty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_empty=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_empty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_empty" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_empty" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_empty" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_empty" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_empty" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_empty" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_clone in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_clone in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_clone in -lcdata" >&5 +printf %s "checking for libcdata_range_list_clone in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22624,40 +29643,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_clone (); int -main () +main (void) { return libcdata_range_list_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_clone=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_clone" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_clone" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_clone" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_clone" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_clone" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_number_of_elements in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_get_number_of_elements in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_number_of_elements in -lcdata" >&5 +printf %s "checking for libcdata_range_list_get_number_of_elements in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22666,40 +29685,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_get_number_of_elements (); int -main () +main (void) { return libcdata_range_list_get_number_of_elements (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_get_number_of_elements" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_insert_range in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_insert_range in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_insert_range+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_insert_range in -lcdata" >&5 +printf %s "checking for libcdata_range_list_insert_range in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_insert_range+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22708,40 +29727,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_insert_range (); int -main () +main (void) { return libcdata_range_list_insert_range (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_insert_range=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_insert_range=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_insert_range" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_insert_range" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_insert_range" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_insert_range" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_insert_range" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_insert_range" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_insert_range_list in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_insert_range_list in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_insert_range_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_insert_range_list in -lcdata" >&5 +printf %s "checking for libcdata_range_list_insert_range_list in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_insert_range_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22750,40 +29769,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_insert_range_list (); int -main () +main (void) { return libcdata_range_list_insert_range_list (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_insert_range_list=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_insert_range_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_insert_range_list" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_insert_range_list" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_insert_range_list" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_insert_range_list" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_insert_range_list" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_insert_range_list" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_remove_range in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_remove_range in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_remove_range+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_remove_range in -lcdata" >&5 +printf %s "checking for libcdata_range_list_remove_range in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_remove_range+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22792,40 +29811,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_remove_range (); int -main () +main (void) { return libcdata_range_list_remove_range (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_remove_range=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_remove_range=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_remove_range" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_remove_range" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_remove_range" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_remove_range" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_remove_range" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_remove_range" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_range_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_get_range_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_get_range_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_range_by_index in -lcdata" >&5 +printf %s "checking for libcdata_range_list_get_range_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_get_range_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22834,40 +29853,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_get_range_by_index (); int -main () +main (void) { return libcdata_range_list_get_range_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_get_range_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_get_range_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_get_range_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_range_at_offset in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_get_range_at_offset in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_range_at_offset in -lcdata" >&5 +printf %s "checking for libcdata_range_list_get_range_at_offset in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22876,40 +29895,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_get_range_at_offset (); int -main () +main (void) { return libcdata_range_list_get_range_at_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_get_range_at_offset" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_range_is_present in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_range_is_present in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_range_is_present+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_range_is_present in -lcdata" >&5 +printf %s "checking for libcdata_range_list_range_is_present in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_range_is_present+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22918,40 +29937,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_range_is_present (); int -main () +main (void) { return libcdata_range_list_range_is_present (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_range_is_present=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_range_is_present=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_range_is_present" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_range_is_present" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_range_is_present" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_range_is_present" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_range_is_present" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_range_is_present" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_spanning_range in -lcdata" >&5 -$as_echo_n "checking for libcdata_range_list_get_spanning_range in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_range_list_get_spanning_range+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_range_has_overlapping_range in -lcdata" >&5 +printf %s "checking for libcdata_range_list_range_has_overlapping_range in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_range_has_overlapping_range+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcdata $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libcdata_range_list_range_has_overlapping_range (); +int +main (void) +{ +return libcdata_range_list_range_has_overlapping_range (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cdata_libcdata_range_list_range_has_overlapping_range=yes +else $as_nop + ac_cv_lib_cdata_libcdata_range_list_range_has_overlapping_range=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_range_has_overlapping_range" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_range_has_overlapping_range" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_range_has_overlapping_range" = xyes +then : + ac_cv_libcdata_dummy=yes +else $as_nop + ac_cv_libcdata=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_range_list_get_spanning_range in -lcdata" >&5 +printf %s "checking for libcdata_range_list_get_spanning_range in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_range_list_get_spanning_range+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -22960,41 +30021,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_range_list_get_spanning_range (); int -main () +main (void) { return libcdata_range_list_get_spanning_range (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_range_list_get_spanning_range=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_range_list_get_spanning_range=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_range_list_get_spanning_range" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_initialize in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_initialize in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_initialize in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_initialize in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23003,40 +30064,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_initialize (); int -main () +main (void) { return libcdata_tree_node_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_initialize=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_initialize" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_initialize" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_initialize" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_initialize" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_free in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_free in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_free in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_free in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23045,40 +30106,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_free (); int -main () +main (void) { return libcdata_tree_node_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_free=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_free" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_free" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_free" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_free" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_free" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_empty in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_empty in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_empty in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_empty in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_empty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23087,40 +30148,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_empty (); int -main () +main (void) { return libcdata_tree_node_empty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_empty=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_empty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_empty" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_empty" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_empty" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_empty" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_empty" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_empty" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_clone in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_clone in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_clone in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_clone in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23129,40 +30190,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_clone (); int -main () +main (void) { return libcdata_tree_node_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_clone=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_clone" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_clone" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_clone" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_clone" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_clone" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_value in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23171,40 +30232,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_value (); int -main () +main (void) { return libcdata_tree_node_get_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_set_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_set_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_value in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_set_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_set_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23213,40 +30274,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_set_value (); int -main () +main (void) { return libcdata_tree_node_set_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_set_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_set_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_set_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_parent_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_parent_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_parent_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_parent_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_parent_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_parent_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23255,40 +30316,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_parent_node (); int -main () +main (void) { return libcdata_tree_node_get_parent_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_parent_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_parent_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_parent_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_parent_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_set_parent_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_set_parent_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_parent_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_set_parent_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_set_parent_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23297,40 +30358,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_set_parent_node (); int -main () +main (void) { return libcdata_tree_node_set_parent_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_set_parent_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_set_parent_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_parent_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_previous_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_previous_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_previous_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_previous_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_previous_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_previous_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23339,40 +30400,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_previous_node (); int -main () +main (void) { return libcdata_tree_node_get_previous_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_previous_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_previous_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_previous_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_previous_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_set_previous_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_set_previous_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_previous_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_set_previous_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_set_previous_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23381,40 +30442,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_set_previous_node (); int -main () +main (void) { return libcdata_tree_node_set_previous_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_set_previous_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_set_previous_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_previous_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_next_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_next_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_next_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_next_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_next_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_next_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23423,40 +30484,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_next_node (); int -main () +main (void) { return libcdata_tree_node_get_next_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_next_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_next_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_next_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_next_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_next_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_next_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_next_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_next_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_next_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_set_next_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_set_next_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_next_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_set_next_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_set_next_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23465,40 +30526,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_set_next_node (); int -main () +main (void) { return libcdata_tree_node_set_next_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_set_next_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_set_next_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_next_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_next_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_next_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_next_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_set_next_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_next_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_nodes in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_nodes in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_nodes+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_nodes in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_nodes in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_nodes+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23507,40 +30568,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_nodes (); int -main () +main (void) { return libcdata_tree_node_get_nodes (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_nodes=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_nodes=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_nodes" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_nodes" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_nodes" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_nodes" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_nodes" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_nodes" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_nodes in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_set_nodes in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_set_nodes+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_set_nodes in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_set_nodes in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_set_nodes+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23549,40 +30610,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_set_nodes (); int -main () +main (void) { return libcdata_tree_node_set_nodes (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_set_nodes=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_set_nodes=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_nodes" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_set_nodes" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_nodes" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_set_nodes" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_set_nodes" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_set_nodes" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_append_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_append_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_append_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_append_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_append_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_append_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23591,40 +30652,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_append_node (); int -main () +main (void) { return libcdata_tree_node_append_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_append_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_append_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_append_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_append_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_append_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_append_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_append_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_append_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_append_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_append_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_append_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_append_value in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_append_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_append_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23633,40 +30694,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_append_value (); int -main () +main (void) { return libcdata_tree_node_append_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_append_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_append_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_append_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_append_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_append_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_append_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_append_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_append_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_insert_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_insert_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_insert_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_insert_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_insert_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_insert_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23675,40 +30736,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_insert_node (); int -main () +main (void) { return libcdata_tree_node_insert_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_insert_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_insert_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_insert_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_insert_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_insert_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_insert_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_insert_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_insert_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_insert_value in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_insert_value in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_insert_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_insert_value in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_insert_value in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_insert_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23717,40 +30778,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_insert_value (); int -main () +main (void) { return libcdata_tree_node_insert_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_insert_value=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_insert_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_insert_value" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_insert_value" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_insert_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_insert_value" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_insert_value" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_insert_value" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_replace_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_replace_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_replace_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_replace_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_replace_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_replace_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23759,40 +30820,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_replace_node (); int -main () +main (void) { return libcdata_tree_node_replace_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_replace_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_replace_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_replace_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_replace_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_replace_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_replace_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_replace_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_replace_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_remove_node in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_remove_node in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_remove_node+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_remove_node in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_remove_node in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_remove_node+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23801,40 +30862,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_remove_node (); int -main () +main (void) { return libcdata_tree_node_remove_node (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_remove_node=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_remove_node=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_remove_node" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_remove_node" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_remove_node" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_remove_node" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_remove_node" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_remove_node" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_number_of_sub_nodes in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_number_of_sub_nodes in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_number_of_sub_nodes in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_number_of_sub_nodes in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23843,40 +30904,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_number_of_sub_nodes (); int -main () +main (void) { return libcdata_tree_node_get_number_of_sub_nodes (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_number_of_sub_nodes" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_sub_node_by_index in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_sub_node_by_index in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_sub_node_by_index in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_sub_node_by_index in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23885,40 +30946,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_sub_node_by_index (); int -main () +main (void) { return libcdata_tree_node_get_sub_node_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_sub_node_by_index" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_leaf_node_list in -lcdata" >&5 -$as_echo_n "checking for libcdata_tree_node_get_leaf_node_list in -lcdata... " >&6; } -if ${ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcdata_tree_node_get_leaf_node_list in -lcdata" >&5 +printf %s "checking for libcdata_tree_node_get_leaf_node_list in -lcdata... " >&6; } +if test ${ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcdata $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -23927,32 +30988,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcdata_tree_node_get_leaf_node_list (); int -main () +main (void) { return libcdata_tree_node_get_leaf_node_list (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list=yes -else +else $as_nop ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" >&5 -$as_echo "$ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" >&6; } -if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" >&5 +printf "%s\n" "$ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" >&6; } +if test "x$ac_cv_lib_cdata_libcdata_tree_node_get_leaf_node_list" = xyes +then : ac_cv_libcdata_dummy=yes -else +else $as_nop ac_cv_libcdata=no fi @@ -23961,9 +31021,10 @@ fi fi - if test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_libcdata" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect && test "x$ac_cv_libcdata" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcdata in directory: $ac_cv_with_libcdata See \`config.log' for more details" "$LINENO" 5; } @@ -23971,24 +31032,27 @@ fi - if test "x$ac_cv_libcdata" = xyes; then : + if test "x$ac_cv_libcdata" = xyes +then : -$as_echo "#define HAVE_LIBCDATA 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCDATA 1" >>confdefs.h fi - if test "x$ac_cv_libcdata" = xyes; then : + if test "x$ac_cv_libcdata" = xyes +then : HAVE_LIBCDATA=1 -else +else $as_nop HAVE_LIBCDATA=0 fi - if test "x$ac_cv_libcdata" != xyes; then : + if test "x$ac_cv_libcdata" != xyes +then : ac_cv_libcdata_CPPFLAGS="-I../libcdata"; ac_cv_libcdata_LIBADD="../libcdata/libcdata.la"; @@ -23997,7 +31061,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCDATA 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCDATA 1" >>confdefs.h HAVE_LOCAL_LIBCDATA=1 @@ -24012,24 +31076,28 @@ HAVE_LOCAL_LIBCDATA_FALSE= fi - if test "x$ac_cv_libcdata_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcdata_CPPFLAGS" != "x" +then : LIBCDATA_CPPFLAGS=$ac_cv_libcdata_CPPFLAGS fi - if test "x$ac_cv_libcdata_LIBADD" != "x"; then : + if test "x$ac_cv_libcdata_LIBADD" != "x" +then : LIBCDATA_LIBADD=$ac_cv_libcdata_LIBADD fi - if test "x$ac_cv_libcdata" = xyes; then : + if test "x$ac_cv_libcdata" = xyes +then : ax_libcdata_pc_libs_private=-lcdata fi - if test "x$ac_cv_libcdata" = xyes; then : + if test "x$ac_cv_libcdata" = xyes +then : ax_libcdata_spec_requires=libcdata ax_libcdata_spec_build_requires=libcdata-devel @@ -24041,52 +31109,59 @@ # Check whether --with-libclocale was given. -if test "${with_libclocale+set}" = set; then : +if test ${with_libclocale+y} +then : withval=$with_libclocale; ac_cv_with_libclocale=$withval -else +else $as_nop ac_cv_with_libclocale=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libclocale+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libclocale in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libclocale+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libclocale=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libclocale" >&5 -$as_echo "$ac_cv_with_libclocale" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libclocale" >&5 +printf "%s\n" "$ac_cv_with_libclocale" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libclocale" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libclocale" = xno +then : ac_cv_libclocale=no -else - if test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect; then : - if test -d "$ac_cv_with_libclocale"; then : +else $as_nop + ac_cv_libclocale=check + if test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect +then : + if test -d "$ac_cv_with_libclocale" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libclocale}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libclocale}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libclocale See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libclocale=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale" >&5 -$as_echo_n "checking for libclocale... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale >= 20120425" >&5 +printf %s "checking for libclocale >= 20120425... " >&6; } if test -n "$libclocale_CFLAGS"; then pkg_cv_libclocale_CFLAGS="$libclocale_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libclocale >= 20120425\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libclocale >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libclocale >= 20120425") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libclocale_CFLAGS=`$PKG_CONFIG --cflags "libclocale >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -24100,10 +31175,10 @@ pkg_cv_libclocale_LIBS="$libclocale_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libclocale >= 20120425\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libclocale >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libclocale >= 20120425") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libclocale_LIBS=`$PKG_CONFIG --libs "libclocale >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -24117,8 +31192,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -24126,33 +31201,35 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libclocale_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libclocale >= 20120425" 2>&1` + libclocale_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libclocale >= 20120425" 2>&1` else - libclocale_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libclocale >= 20120425" 2>&1` + libclocale_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libclocale >= 20120425" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libclocale_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libclocale_PKG_ERRORS" >&5 - ac_cv_libclocale=check + ac_cv_libclocale=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libclocale=check -else - libclocale_CFLAGS=$pkg_cv_libclocale_CFLAGS - libclocale_LIBS=$pkg_cv_libclocale_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libclocale=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libclocale=check +else + libclocale_CFLAGS=$pkg_cv_libclocale_CFLAGS + libclocale_LIBS=$pkg_cv_libclocale_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libclocale=yes fi fi - if test "x$ac_cv_libclocale" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 -$as_echo_n "checking whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } -if ${ac_cv_header_libclocale_features_h_have_wide_character_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libclocale" = xyes && test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 +printf %s "checking whether libclocale/features.h defines LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } +if test ${ac_cv_header_libclocale_features_h_have_wide_character_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -24163,7 +31240,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined( LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCLOCALE_HAVE_WIDE_CHARACTER_TYPE not defined @@ -24172,12 +31249,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_libclocale_features_h_have_wide_character_type=yes -else +else $as_nop ac_cv_header_libclocale_features_h_have_wide_character_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -24185,45 +31263,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libclocale_features_h_have_wide_character_type" >&5 -$as_echo "$ac_cv_header_libclocale_features_h_have_wide_character_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libclocale_features_h_have_wide_character_type" >&5 +printf "%s\n" "$ac_cv_header_libclocale_features_h_have_wide_character_type" >&6; } - if test "x$ac_cv_header_libclocale_features_h_have_wide_character_type" = xno; then : + if test "x$ac_cv_header_libclocale_features_h_have_wide_character_type" = xno +then : ac_cv_libclocale=no fi fi - if test "x$ac_cv_libclocale" = xyes; then : + if test "x$ac_cv_libclocale" = xyes +then : ac_cv_libclocale_CPPFLAGS="$pkg_cv_libclocale_CFLAGS" ac_cv_libclocale_LIBADD="$pkg_cv_libclocale_LIBS" fi fi - if test "x$ac_cv_libclocale" = xcheck; then : - for ac_header in libclocale.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libclocale.h" "ac_cv_header_libclocale_h" "$ac_includes_default" -if test "x$ac_cv_header_libclocale_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCLOCALE_H 1 -_ACEOF + if test "x$ac_cv_libclocale" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libclocale.h" "ac_cv_header_libclocale_h" "$ac_includes_default" +if test "x$ac_cv_header_libclocale_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCLOCALE_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libclocale_h" = xno; then : + if test "x$ac_cv_header_libclocale_h" = xno +then : ac_cv_libclocale=no -else +else $as_nop ac_cv_libclocale=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_get_version in -lclocale" >&5 -$as_echo_n "checking for libclocale_get_version in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_get_version in -lclocale" >&5 +printf %s "checking for libclocale_get_version in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24232,41 +31310,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_get_version (); int -main () +main (void) { return libclocale_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_get_version=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_get_version" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_get_version" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_get_version" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_get_version" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_get_version" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage in -lclocale" >&5 -$as_echo_n "checking for libclocale_codepage in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_codepage+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage in -lclocale" >&5 +printf %s "checking for libclocale_codepage in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_codepage+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24275,40 +31353,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_codepage (); int -main () +main (void) { return libclocale_codepage (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_codepage=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_codepage=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_codepage" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_codepage" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_codepage" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_codepage" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_get in -lclocale" >&5 -$as_echo_n "checking for libclocale_codepage_get in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_codepage_get+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_get in -lclocale" >&5 +printf %s "checking for libclocale_codepage_get in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_codepage_get+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24317,40 +31395,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_codepage_get (); int -main () +main (void) { return libclocale_codepage_get (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_codepage_get=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_codepage_get=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_get" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_codepage_get" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_codepage_get" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_get" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_codepage_get" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_codepage_get" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_set in -lclocale" >&5 -$as_echo_n "checking for libclocale_codepage_set in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_codepage_set+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_set in -lclocale" >&5 +printf %s "checking for libclocale_codepage_set in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_codepage_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24359,40 +31437,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_codepage_set (); int -main () +main (void) { return libclocale_codepage_set (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_codepage_set=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_codepage_set=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_set" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_codepage_set" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_codepage_set" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_set" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_codepage_set" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_codepage_set" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_copy_from_string in -lclocale" >&5 -$as_echo_n "checking for libclocale_codepage_copy_from_string in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_codepage_copy_from_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_copy_from_string in -lclocale" >&5 +printf %s "checking for libclocale_codepage_copy_from_string in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_codepage_copy_from_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24401,42 +31479,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_codepage_copy_from_string (); int -main () +main (void) { return libclocale_codepage_copy_from_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_codepage_copy_from_string=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_codepage_copy_from_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_copy_from_string" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_codepage_copy_from_string" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_codepage_copy_from_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_copy_from_string" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_codepage_copy_from_string" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_codepage_copy_from_string" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_copy_from_string_wide in -lclocale" >&5 -$as_echo_n "checking for libclocale_codepage_copy_from_string_wide in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_codepage_copy_from_string_wide in -lclocale" >&5 +printf %s "checking for libclocale_codepage_copy_from_string_wide in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24445,43 +31524,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_codepage_copy_from_string_wide (); int -main () +main (void) { return libclocale_codepage_copy_from_string_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_codepage_copy_from_string_wide" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_locale_get_codepage in -lclocale" >&5 -$as_echo_n "checking for libclocale_locale_get_codepage in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_locale_get_codepage+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_locale_get_codepage in -lclocale" >&5 +printf %s "checking for libclocale_locale_get_codepage in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_locale_get_codepage+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24490,40 +31569,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_locale_get_codepage (); int -main () +main (void) { return libclocale_locale_get_codepage (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_locale_get_codepage=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_locale_get_codepage=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_locale_get_codepage" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_locale_get_codepage" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_locale_get_codepage" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_locale_get_codepage" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_locale_get_codepage" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_locale_get_codepage" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_locale_get_decimal_point in -lclocale" >&5 -$as_echo_n "checking for libclocale_locale_get_decimal_point in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_locale_get_decimal_point+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_locale_get_decimal_point in -lclocale" >&5 +printf %s "checking for libclocale_locale_get_decimal_point in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_locale_get_decimal_point+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24532,41 +31611,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_locale_get_decimal_point (); int -main () +main (void) { return libclocale_locale_get_decimal_point (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_locale_get_decimal_point=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_locale_get_decimal_point=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_locale_get_decimal_point" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_locale_get_decimal_point" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_locale_get_decimal_point" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_locale_get_decimal_point" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_locale_get_decimal_point" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_locale_get_decimal_point" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libclocale_initialize in -lclocale" >&5 -$as_echo_n "checking for libclocale_initialize in -lclocale... " >&6; } -if ${ac_cv_lib_clocale_libclocale_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libclocale_initialize in -lclocale" >&5 +printf %s "checking for libclocale_initialize in -lclocale... " >&6; } +if test ${ac_cv_lib_clocale_libclocale_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lclocale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24575,32 +31654,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libclocale_initialize (); int -main () +main (void) { return libclocale_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_clocale_libclocale_initialize=yes -else +else $as_nop ac_cv_lib_clocale_libclocale_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_initialize" >&5 -$as_echo "$ac_cv_lib_clocale_libclocale_initialize" >&6; } -if test "x$ac_cv_lib_clocale_libclocale_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_clocale_libclocale_initialize" >&5 +printf "%s\n" "$ac_cv_lib_clocale_libclocale_initialize" >&6; } +if test "x$ac_cv_lib_clocale_libclocale_initialize" = xyes +then : ac_cv_libclocale_dummy=yes -else +else $as_nop ac_cv_libclocale=no fi @@ -24609,9 +31687,10 @@ fi fi - if test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_libclocale" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect && test "x$ac_cv_libclocale" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libclocale in directory: $ac_cv_with_libclocale See \`config.log' for more details" "$LINENO" 5; } @@ -24619,74 +31698,72 @@ fi - if test "x$ac_cv_libclocale" = xyes; then : + if test "x$ac_cv_libclocale" = xyes +then : -$as_echo "#define HAVE_LIBCLOCALE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCLOCALE 1" >>confdefs.h fi - if test "x$ac_cv_libclocale" = xyes; then : + if test "x$ac_cv_libclocale" = xyes +then : HAVE_LIBCLOCALE=1 -else +else $as_nop HAVE_LIBCLOCALE=0 fi - if test "x$ac_cv_libclocale" != xyes; then : - for ac_header in langinfo.h locale.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_cv_libclocale" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes +then : + printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" +if test "x$ac_cv_header_locale_h" = xyes +then : + printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h -done +fi - for ac_func in getenv -do : - ac_fn_c_check_func "$LINENO" "getenv" "ac_cv_func_getenv" -if test "x$ac_cv_func_getenv" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETENV 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "getenv" "ac_cv_func_getenv" +if test "x$ac_cv_func_getenv" = xyes +then : + printf "%s\n" "#define HAVE_GETENV 1" >>confdefs.h fi -done - if test "x$ac_cv_func_getenv" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_getenv" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: getenv See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_enable_winapi" = xno; then : - for ac_func in localeconv -do : + if test "x$ac_cv_enable_winapi" = xno +then : ac_fn_c_check_func "$LINENO" "localeconv" "ac_cv_func_localeconv" -if test "x$ac_cv_func_localeconv" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LOCALECONV 1 -_ACEOF +if test "x$ac_cv_func_localeconv" = xyes +then : + printf "%s\n" "#define HAVE_LOCALECONV 1" >>confdefs.h fi -done - if test "x$ac_cv_func_localeconv" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_localeconv" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: localeconv See \`config.log' for more details" "$LINENO" 5; } @@ -24694,44 +31771,39 @@ fi - for ac_func in setlocale -do : ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" -if test "x$ac_cv_func_setlocale" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SETLOCALE 1 -_ACEOF +if test "x$ac_cv_func_setlocale" = xyes +then : + printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h fi -done - if test "x$ac_cv_func_setlocale" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_setlocale" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: setlocale See \`config.log' for more details" "$LINENO" 5; } fi - for ac_func in nl_langinfo -do : ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" -if test "x$ac_cv_func_nl_langinfo" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NL_LANGINFO 1 -_ACEOF +if test "x$ac_cv_func_nl_langinfo" = xyes +then : + printf "%s\n" "#define HAVE_NL_LANGINFO 1" >>confdefs.h fi -done - if test "x$ac_cv_func_nl_langinfo" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo CODESET support" >&5 -$as_echo_n "checking for nl_langinfo CODESET support... " >&6; } -if ${ac_cv_cv_langinfo_codeset+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_func_nl_langinfo" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo CODESET support" >&5 +printf %s "checking for nl_langinfo CODESET support... " >&6; } +if test ${ac_cv_cv_langinfo_codeset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -24742,19 +31814,20 @@ /* end confdefs.h. */ #include int -main () +main (void) { char* charset = nl_langinfo( CODESET ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_cv_langinfo_codeset=yes -else +else $as_nop ac_cv_cv_langinfo_codeset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -24763,15 +31836,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_langinfo_codeset" >&5 -$as_echo "$ac_cv_cv_langinfo_codeset" >&6; } -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cv_langinfo_codeset" >&5 +printf "%s\n" "$ac_cv_cv_langinfo_codeset" >&6; } +else $as_nop ac_cv_cv_langinfo_codeset=no fi - if test "x$ac_cv_cv_langinfo_codeset" = xyes; then : + if test "x$ac_cv_cv_langinfo_codeset" = xyes +then : -$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h +printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h fi @@ -24784,7 +31858,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCLOCALE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCLOCALE 1" >>confdefs.h HAVE_LOCAL_LIBCLOCALE=1 @@ -24799,24 +31873,28 @@ HAVE_LOCAL_LIBCLOCALE_FALSE= fi - if test "x$ac_cv_libclocale_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libclocale_CPPFLAGS" != "x" +then : LIBCLOCALE_CPPFLAGS=$ac_cv_libclocale_CPPFLAGS fi - if test "x$ac_cv_libclocale_LIBADD" != "x"; then : + if test "x$ac_cv_libclocale_LIBADD" != "x" +then : LIBCLOCALE_LIBADD=$ac_cv_libclocale_LIBADD fi - if test "x$ac_cv_libclocale" = xyes; then : + if test "x$ac_cv_libclocale" = xyes +then : ax_libclocale_pc_libs_private=-lclocale fi - if test "x$ac_cv_libclocale" = xyes; then : + if test "x$ac_cv_libclocale" = xyes +then : ax_libclocale_spec_requires=libclocale ax_libclocale_spec_build_requires=libclocale-devel @@ -24828,52 +31906,59 @@ # Check whether --with-libcnotify was given. -if test "${with_libcnotify+set}" = set; then : +if test ${with_libcnotify+y} +then : withval=$with_libcnotify; ac_cv_with_libcnotify=$withval -else +else $as_nop ac_cv_with_libcnotify=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcnotify+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcnotify in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcnotify+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcnotify=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcnotify" >&5 -$as_echo "$ac_cv_with_libcnotify" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcnotify" >&5 +printf "%s\n" "$ac_cv_with_libcnotify" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcnotify" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcnotify" = xno +then : ac_cv_libcnotify=no -else - if test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect; then : - if test -d "$ac_cv_with_libcnotify"; then : +else $as_nop + ac_cv_libcnotify=check + if test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect +then : + if test -d "$ac_cv_with_libcnotify" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcnotify}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcnotify}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcnotify See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcnotify=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify" >&5 -$as_echo_n "checking for libcnotify... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify >= 20120425" >&5 +printf %s "checking for libcnotify >= 20120425... " >&6; } if test -n "$libcnotify_CFLAGS"; then pkg_cv_libcnotify_CFLAGS="$libcnotify_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcnotify >= 20120425\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcnotify >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcnotify >= 20120425") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcnotify_CFLAGS=`$PKG_CONFIG --cflags "libcnotify >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -24887,10 +31972,10 @@ pkg_cv_libcnotify_LIBS="$libcnotify_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcnotify >= 20120425\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcnotify >= 20120425\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcnotify >= 20120425") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcnotify_LIBS=`$PKG_CONFIG --libs "libcnotify >= 20120425" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -24904,8 +31989,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -24913,58 +31998,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcnotify_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcnotify >= 20120425" 2>&1` + libcnotify_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcnotify >= 20120425" 2>&1` else - libcnotify_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcnotify >= 20120425" 2>&1` + libcnotify_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcnotify >= 20120425" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcnotify_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcnotify_PKG_ERRORS" >&5 - ac_cv_libcnotify=check + ac_cv_libcnotify=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcnotify=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcnotify=check else - libcnotify_CFLAGS=$pkg_cv_libcnotify_CFLAGS - libcnotify_LIBS=$pkg_cv_libcnotify_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcnotify=yes + libcnotify_CFLAGS=$pkg_cv_libcnotify_CFLAGS + libcnotify_LIBS=$pkg_cv_libcnotify_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcnotify=yes fi fi - if test "x$ac_cv_libcnotify" = xyes; then : + if test "x$ac_cv_libcnotify" = xyes +then : ac_cv_libcnotify_CPPFLAGS="$pkg_cv_libcnotify_CFLAGS" ac_cv_libcnotify_LIBADD="$pkg_cv_libcnotify_LIBS" fi fi - if test "x$ac_cv_libcnotify" = xcheck; then : - for ac_header in libcnotify.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcnotify.h" "ac_cv_header_libcnotify_h" "$ac_includes_default" -if test "x$ac_cv_header_libcnotify_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCNOTIFY_H 1 -_ACEOF + if test "x$ac_cv_libcnotify" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcnotify.h" "ac_cv_header_libcnotify_h" "$ac_includes_default" +if test "x$ac_cv_header_libcnotify_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCNOTIFY_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcnotify_h" = xno; then : + if test "x$ac_cv_header_libcnotify_h" = xno +then : ac_cv_libcnotify=no -else +else $as_nop ac_cv_libcnotify=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_get_version in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_get_version in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_get_version in -lcnotify" >&5 +printf %s "checking for libcnotify_get_version in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -24973,41 +32057,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_get_version (); int -main () +main (void) { return libcnotify_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_get_version=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_get_version" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_get_version" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_get_version" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_get_version" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_get_version" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_printf in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_printf in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_printf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_printf in -lcnotify" >&5 +printf %s "checking for libcnotify_printf in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_printf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25016,40 +32100,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_printf (); int -main () +main (void) { return libcnotify_printf (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_printf=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_printf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_printf" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_printf" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_printf" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_printf" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_printf" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_printf" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_print_data in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_print_data in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_print_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_print_data in -lcnotify" >&5 +printf %s "checking for libcnotify_print_data in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_print_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25058,40 +32142,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_print_data (); int -main () +main (void) { return libcnotify_print_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_print_data=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_print_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_print_data" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_print_data" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_print_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_print_data" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_print_data" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_print_data" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_print_error_backtrace in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_print_error_backtrace in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_print_error_backtrace+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_print_error_backtrace in -lcnotify" >&5 +printf %s "checking for libcnotify_print_error_backtrace in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_print_error_backtrace+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25100,41 +32184,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_print_error_backtrace (); int -main () +main (void) { return libcnotify_print_error_backtrace (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_print_error_backtrace=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_print_error_backtrace=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_print_error_backtrace" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_print_error_backtrace" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_print_error_backtrace" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_print_error_backtrace" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_print_error_backtrace" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_print_error_backtrace" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_set in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_stream_set in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_stream_set+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_set in -lcnotify" >&5 +printf %s "checking for libcnotify_stream_set in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_stream_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25143,40 +32227,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_stream_set (); int -main () +main (void) { return libcnotify_stream_set (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_stream_set=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_stream_set=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_set" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_stream_set" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_stream_set" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_set" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_stream_set" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_stream_set" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_open in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_stream_open in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_stream_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_open in -lcnotify" >&5 +printf %s "checking for libcnotify_stream_open in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_stream_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25185,40 +32269,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_stream_open (); int -main () +main (void) { return libcnotify_stream_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_stream_open=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_stream_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_open" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_stream_open" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_stream_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_open" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_stream_open" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_stream_open" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_close in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_stream_close in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_stream_close+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_stream_close in -lcnotify" >&5 +printf %s "checking for libcnotify_stream_close in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_stream_close+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25227,41 +32311,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_stream_close (); int -main () +main (void) { return libcnotify_stream_close (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_stream_close=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_stream_close=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_close" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_stream_close" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_stream_close" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_stream_close" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_stream_close" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_stream_close" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcnotify_verbose_set in -lcnotify" >&5 -$as_echo_n "checking for libcnotify_verbose_set in -lcnotify... " >&6; } -if ${ac_cv_lib_cnotify_libcnotify_verbose_set+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcnotify_verbose_set in -lcnotify" >&5 +printf %s "checking for libcnotify_verbose_set in -lcnotify... " >&6; } +if test ${ac_cv_lib_cnotify_libcnotify_verbose_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcnotify $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25270,32 +32354,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcnotify_verbose_set (); int -main () +main (void) { return libcnotify_verbose_set (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cnotify_libcnotify_verbose_set=yes -else +else $as_nop ac_cv_lib_cnotify_libcnotify_verbose_set=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_verbose_set" >&5 -$as_echo "$ac_cv_lib_cnotify_libcnotify_verbose_set" >&6; } -if test "x$ac_cv_lib_cnotify_libcnotify_verbose_set" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cnotify_libcnotify_verbose_set" >&5 +printf "%s\n" "$ac_cv_lib_cnotify_libcnotify_verbose_set" >&6; } +if test "x$ac_cv_lib_cnotify_libcnotify_verbose_set" = xyes +then : ac_cv_libcnotify_dummy=yes -else +else $as_nop ac_cv_libcnotify=no fi @@ -25304,9 +32387,10 @@ fi fi - if test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_libcnotify" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect && test "x$ac_cv_libcnotify" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcnotify in directory: $ac_cv_with_libcnotify See \`config.log' for more details" "$LINENO" 5; } @@ -25314,58 +32398,57 @@ fi - if test "x$ac_cv_libcnotify" = xyes; then : + if test "x$ac_cv_libcnotify" = xyes +then : -$as_echo "#define HAVE_LIBCNOTIFY 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCNOTIFY 1" >>confdefs.h fi - if test "x$ac_cv_libcnotify" = xyes; then : + if test "x$ac_cv_libcnotify" = xyes +then : HAVE_LIBCNOTIFY=1 -else +else $as_nop HAVE_LIBCNOTIFY=0 fi - if test "x$ac_cv_libcnotify" != xyes; then : - for ac_header in stdarg.h varargs.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_cv_libcnotify" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" +if test "x$ac_cv_header_stdarg_h" = xyes +then : + printf "%s\n" "#define HAVE_STDARG_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default" +if test "x$ac_cv_header_varargs_h" = xyes +then : + printf "%s\n" "#define HAVE_VARARGS_H 1" >>confdefs.h -done +fi - if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } fi - for ac_header in errno.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ERRNO_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h fi -done - ac_cv_libcnotify_CPPFLAGS="-I../libcnotify"; ac_cv_libcnotify_LIBADD="../libcnotify/libcnotify.la"; @@ -25374,7 +32457,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCNOTIFY 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCNOTIFY 1" >>confdefs.h HAVE_LOCAL_LIBCNOTIFY=1 @@ -25389,24 +32472,28 @@ HAVE_LOCAL_LIBCNOTIFY_FALSE= fi - if test "x$ac_cv_libcnotify_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcnotify_CPPFLAGS" != "x" +then : LIBCNOTIFY_CPPFLAGS=$ac_cv_libcnotify_CPPFLAGS fi - if test "x$ac_cv_libcnotify_LIBADD" != "x"; then : + if test "x$ac_cv_libcnotify_LIBADD" != "x" +then : LIBCNOTIFY_LIBADD=$ac_cv_libcnotify_LIBADD fi - if test "x$ac_cv_libcnotify" = xyes; then : + if test "x$ac_cv_libcnotify" = xyes +then : ax_libcnotify_pc_libs_private=-lcnotify fi - if test "x$ac_cv_libcnotify" = xyes; then : + if test "x$ac_cv_libcnotify" = xyes +then : ax_libcnotify_spec_requires=libcnotify ax_libcnotify_spec_build_requires=libcnotify-devel @@ -25418,52 +32505,59 @@ # Check whether --with-libcsplit was given. -if test "${with_libcsplit+set}" = set; then : +if test ${with_libcsplit+y} +then : withval=$with_libcsplit; ac_cv_with_libcsplit=$withval -else +else $as_nop ac_cv_with_libcsplit=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcsplit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcsplit in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcsplit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcsplit=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcsplit" >&5 -$as_echo "$ac_cv_with_libcsplit" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcsplit" >&5 +printf "%s\n" "$ac_cv_with_libcsplit" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcsplit" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcsplit" = xno +then : ac_cv_libcsplit=no -else - if test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect; then : - if test -d "$ac_cv_with_libcsplit"; then : +else $as_nop + ac_cv_libcsplit=check + if test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect +then : + if test -d "$ac_cv_with_libcsplit" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcsplit}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcsplit}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcsplit See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcsplit=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit" >&5 -$as_echo_n "checking for libcsplit... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit >= 20120701" >&5 +printf %s "checking for libcsplit >= 20120701... " >&6; } if test -n "$libcsplit_CFLAGS"; then pkg_cv_libcsplit_CFLAGS="$libcsplit_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcsplit >= 20120701\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcsplit >= 20120701\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcsplit >= 20120701") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcsplit_CFLAGS=`$PKG_CONFIG --cflags "libcsplit >= 20120701" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -25477,10 +32571,10 @@ pkg_cv_libcsplit_LIBS="$libcsplit_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcsplit >= 20120701\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcsplit >= 20120701\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcsplit >= 20120701") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcsplit_LIBS=`$PKG_CONFIG --libs "libcsplit >= 20120701" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -25494,8 +32588,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -25503,33 +32597,35 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcsplit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcsplit >= 20120701" 2>&1` + libcsplit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcsplit >= 20120701" 2>&1` else - libcsplit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcsplit >= 20120701" 2>&1` + libcsplit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcsplit >= 20120701" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcsplit_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcsplit_PKG_ERRORS" >&5 - ac_cv_libcsplit=check + ac_cv_libcsplit=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcsplit=check -else - libcsplit_CFLAGS=$pkg_cv_libcsplit_CFLAGS - libcsplit_LIBS=$pkg_cv_libcsplit_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcsplit=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcsplit=check +else + libcsplit_CFLAGS=$pkg_cv_libcsplit_CFLAGS + libcsplit_LIBS=$pkg_cv_libcsplit_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcsplit=yes fi fi - if test "x$ac_cv_libcsplit" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 -$as_echo_n "checking whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } -if ${ac_cv_header_libcsplit_features_h_have_wide_character_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcsplit" = xyes && test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 +printf %s "checking whether libcsplit/features.h defines LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } +if test ${ac_cv_header_libcsplit_features_h_have_wide_character_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -25540,7 +32636,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined( LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCSPLIT_HAVE_WIDE_CHARACTER_TYPE not defined @@ -25549,12 +32645,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_libcsplit_features_h_have_wide_character_type=yes -else +else $as_nop ac_cv_header_libcsplit_features_h_have_wide_character_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -25562,45 +32659,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcsplit_features_h_have_wide_character_type" >&5 -$as_echo "$ac_cv_header_libcsplit_features_h_have_wide_character_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcsplit_features_h_have_wide_character_type" >&5 +printf "%s\n" "$ac_cv_header_libcsplit_features_h_have_wide_character_type" >&6; } - if test "x$ac_cv_header_libcsplit_features_h_have_wide_character_type" = xno; then : + if test "x$ac_cv_header_libcsplit_features_h_have_wide_character_type" = xno +then : ac_cv_libcsplit=no fi fi - if test "x$ac_cv_libcsplit" = xyes; then : + if test "x$ac_cv_libcsplit" = xyes +then : ac_cv_libcsplit_CPPFLAGS="$pkg_cv_libcsplit_CFLAGS" ac_cv_libcsplit_LIBADD="$pkg_cv_libcsplit_LIBS" fi fi - if test "x$ac_cv_libcsplit" = xcheck; then : - for ac_header in libcsplit.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcsplit.h" "ac_cv_header_libcsplit_h" "$ac_includes_default" -if test "x$ac_cv_header_libcsplit_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCSPLIT_H 1 -_ACEOF + if test "x$ac_cv_libcsplit" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcsplit.h" "ac_cv_header_libcsplit_h" "$ac_includes_default" +if test "x$ac_cv_header_libcsplit_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCSPLIT_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcsplit_h" = xno; then : + if test "x$ac_cv_header_libcsplit_h" = xno +then : ac_cv_libcsplit=no -else +else $as_nop ac_cv_libcsplit=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_get_version in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_get_version in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_get_version in -lcsplit" >&5 +printf %s "checking for libcsplit_get_version in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25609,41 +32706,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_get_version (); int -main () +main (void) { return libcsplit_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_get_version=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_get_version" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_get_version" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_get_version" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_get_version" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_get_version" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_string_split in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_narrow_string_split in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_narrow_string_split+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_string_split in -lcsplit" >&5 +printf %s "checking for libcsplit_narrow_string_split in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_narrow_string_split+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25652,41 +32749,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_narrow_string_split (); int -main () +main (void) { return libcsplit_narrow_string_split (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_narrow_string_split=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_narrow_string_split=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_string_split" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_narrow_string_split" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_narrow_string_split" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_string_split" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_narrow_string_split" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_narrow_string_split" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_free in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_narrow_split_string_free in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_free in -lcsplit" >&5 +printf %s "checking for libcsplit_narrow_split_string_free in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_narrow_split_string_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25695,40 +32792,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_narrow_split_string_free (); int -main () +main (void) { return libcsplit_narrow_split_string_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_narrow_split_string_free=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_narrow_split_string_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_free" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_free" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_free" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_narrow_split_string_free" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_free" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_string in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_narrow_split_string_get_string in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_string in -lcsplit" >&5 +printf %s "checking for libcsplit_narrow_split_string_get_string in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25737,40 +32834,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_narrow_split_string_get_string (); int -main () +main (void) { return libcsplit_narrow_split_string_get_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_string" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_number_of_segments in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_narrow_split_string_get_number_of_segments in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_number_of_segments in -lcsplit" >&5 +printf %s "checking for libcsplit_narrow_split_string_get_number_of_segments in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25779,40 +32876,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_narrow_split_string_get_number_of_segments (); int -main () +main (void) { return libcsplit_narrow_split_string_get_number_of_segments (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_number_of_segments" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_segment_by_index in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_narrow_split_string_get_segment_by_index in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_get_segment_by_index in -lcsplit" >&5 +printf %s "checking for libcsplit_narrow_split_string_get_segment_by_index in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25821,40 +32918,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_narrow_split_string_get_segment_by_index (); int -main () +main (void) { return libcsplit_narrow_split_string_get_segment_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_get_segment_by_index" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_set_segment_by_index in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_narrow_split_string_set_segment_by_index in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_narrow_split_string_set_segment_by_index in -lcsplit" >&5 +printf %s "checking for libcsplit_narrow_split_string_set_segment_by_index in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25863,42 +32960,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_narrow_split_string_set_segment_by_index (); int -main () +main (void) { return libcsplit_narrow_split_string_set_segment_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_narrow_split_string_set_segment_by_index" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_string_split in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_wide_string_split in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_wide_string_split+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_string_split in -lcsplit" >&5 +printf %s "checking for libcsplit_wide_string_split in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_wide_string_split+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25907,41 +33005,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_wide_string_split (); int -main () +main (void) { return libcsplit_wide_string_split (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_wide_string_split=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_wide_string_split=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_string_split" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_wide_string_split" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_wide_string_split" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_string_split" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_wide_string_split" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_wide_string_split" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_free in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_wide_split_string_free in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_wide_split_string_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_free in -lcsplit" >&5 +printf %s "checking for libcsplit_wide_split_string_free in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_wide_split_string_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25950,40 +33048,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_wide_split_string_free (); int -main () +main (void) { return libcsplit_wide_split_string_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_wide_split_string_free=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_wide_split_string_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_free" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_free" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_free" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_wide_split_string_free" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_free" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_string in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_wide_split_string_get_string in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_string in -lcsplit" >&5 +printf %s "checking for libcsplit_wide_split_string_get_string in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -25992,40 +33090,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_wide_split_string_get_string (); int -main () +main (void) { return libcsplit_wide_split_string_get_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_wide_split_string_get_string=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_wide_split_string_get_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_string" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_number_of_segments in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_wide_split_string_get_number_of_segments in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_number_of_segments in -lcsplit" >&5 +printf %s "checking for libcsplit_wide_split_string_get_number_of_segments in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26034,40 +33132,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_wide_split_string_get_number_of_segments (); int -main () +main (void) { return libcsplit_wide_split_string_get_number_of_segments (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_number_of_segments" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_segment_by_index in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_wide_split_string_get_segment_by_index in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_get_segment_by_index in -lcsplit" >&5 +printf %s "checking for libcsplit_wide_split_string_get_segment_by_index in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26076,40 +33174,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_wide_split_string_get_segment_by_index (); int -main () +main (void) { return libcsplit_wide_split_string_get_segment_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_get_segment_by_index" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_set_segment_by_index in -lcsplit" >&5 -$as_echo_n "checking for libcsplit_wide_split_string_set_segment_by_index in -lcsplit... " >&6; } -if ${ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcsplit_wide_split_string_set_segment_by_index in -lcsplit" >&5 +printf %s "checking for libcsplit_wide_split_string_set_segment_by_index in -lcsplit... " >&6; } +if test ${ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcsplit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26118,32 +33216,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcsplit_wide_split_string_set_segment_by_index (); int -main () +main (void) { return libcsplit_wide_split_string_set_segment_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index=yes -else +else $as_nop ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" >&5 -$as_echo "$ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" >&6; } -if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" >&5 +printf "%s\n" "$ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" >&6; } +if test "x$ac_cv_lib_csplit_libcsplit_wide_split_string_set_segment_by_index" = xyes +then : ac_cv_libcsplit_dummy=yes -else +else $as_nop ac_cv_libcsplit=no fi @@ -26154,9 +33251,10 @@ fi fi - if test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_libcsplit" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect && test "x$ac_cv_libcsplit" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcsplit in directory: $ac_cv_with_libcsplit See \`config.log' for more details" "$LINENO" 5; } @@ -26164,24 +33262,27 @@ fi - if test "x$ac_cv_libcsplit" = xyes; then : + if test "x$ac_cv_libcsplit" = xyes +then : -$as_echo "#define HAVE_LIBCSPLIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCSPLIT 1" >>confdefs.h fi - if test "x$ac_cv_libcsplit" = xyes; then : + if test "x$ac_cv_libcsplit" = xyes +then : HAVE_LIBCSPLIT=1 -else +else $as_nop HAVE_LIBCSPLIT=0 fi - if test "x$ac_cv_libcsplit" != xyes; then : + if test "x$ac_cv_libcsplit" != xyes +then : ac_cv_libcsplit_CPPFLAGS="-I../libcsplit"; ac_cv_libcsplit_LIBADD="../libcsplit/libcsplit.la"; @@ -26190,7 +33291,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCSPLIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCSPLIT 1" >>confdefs.h HAVE_LOCAL_LIBCSPLIT=1 @@ -26205,24 +33306,28 @@ HAVE_LOCAL_LIBCSPLIT_FALSE= fi - if test "x$ac_cv_libcsplit_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcsplit_CPPFLAGS" != "x" +then : LIBCSPLIT_CPPFLAGS=$ac_cv_libcsplit_CPPFLAGS fi - if test "x$ac_cv_libcsplit_LIBADD" != "x"; then : + if test "x$ac_cv_libcsplit_LIBADD" != "x" +then : LIBCSPLIT_LIBADD=$ac_cv_libcsplit_LIBADD fi - if test "x$ac_cv_libcsplit" = xyes; then : + if test "x$ac_cv_libcsplit" = xyes +then : ax_libcsplit_pc_libs_private=-lcsplit fi - if test "x$ac_cv_libcsplit" = xyes; then : + if test "x$ac_cv_libcsplit" = xyes +then : ax_libcsplit_spec_requires=libcsplit ax_libcsplit_spec_build_requires=libcsplit-devel @@ -26234,54 +33339,61 @@ # Check whether --with-libuna was given. -if test "${with_libuna+set}" = set; then : +if test ${with_libuna+y} +then : withval=$with_libuna; ac_cv_with_libuna=$withval -else +else $as_nop ac_cv_with_libuna=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libuna in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libuna in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libuna+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libuna in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libuna in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libuna+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libuna=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libuna" >&5 -$as_echo "$ac_cv_with_libuna" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libuna" >&5 +printf "%s\n" "$ac_cv_with_libuna" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuna" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuna" = xno +then : ac_cv_libuna=no -else - if test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect; then : - if test -d "$ac_cv_with_libuna"; then : +else $as_nop + ac_cv_libuna=check + if test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect +then : + if test -d "$ac_cv_with_libuna" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libuna}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libuna}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libuna See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libuna=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna" >&5 -$as_echo_n "checking for libuna... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna >= 20230702" >&5 +printf %s "checking for libuna >= 20230702... " >&6; } if test -n "$libuna_CFLAGS"; then pkg_cv_libuna_CFLAGS="$libuna_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuna >= 20181006\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libuna >= 20181006") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuna >= 20230702\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libuna >= 20230702") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libuna_CFLAGS=`$PKG_CONFIG --cflags "libuna >= 20181006" 2>/dev/null` + pkg_cv_libuna_CFLAGS=`$PKG_CONFIG --cflags "libuna >= 20230702" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -26293,12 +33405,12 @@ pkg_cv_libuna_LIBS="$libuna_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuna >= 20181006\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libuna >= 20181006") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libuna >= 20230702\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libuna >= 20230702") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libuna_LIBS=`$PKG_CONFIG --libs "libuna >= 20181006" 2>/dev/null` + pkg_cv_libuna_LIBS=`$PKG_CONFIG --libs "libuna >= 20230702" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -26310,8 +33422,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -26319,58 +33431,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libuna_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuna >= 20181006" 2>&1` + libuna_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libuna >= 20230702" 2>&1` else - libuna_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuna >= 20181006" 2>&1` + libuna_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libuna >= 20230702" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libuna_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libuna_PKG_ERRORS" >&5 - ac_cv_libuna=check + ac_cv_libuna=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libuna=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libuna=check else - libuna_CFLAGS=$pkg_cv_libuna_CFLAGS - libuna_LIBS=$pkg_cv_libuna_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libuna=yes + libuna_CFLAGS=$pkg_cv_libuna_CFLAGS + libuna_LIBS=$pkg_cv_libuna_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libuna=yes fi fi - if test "x$ac_cv_libuna" = xyes; then : + if test "x$ac_cv_libuna" = xyes +then : ac_cv_libuna_CPPFLAGS="$pkg_cv_libuna_CFLAGS" ac_cv_libuna_LIBADD="$pkg_cv_libuna_LIBS" fi fi - if test "x$ac_cv_libuna" = xcheck; then : - for ac_header in libuna.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libuna.h" "ac_cv_header_libuna_h" "$ac_includes_default" -if test "x$ac_cv_header_libuna_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUNA_H 1 -_ACEOF + if test "x$ac_cv_libuna" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libuna.h" "ac_cv_header_libuna_h" "$ac_includes_default" +if test "x$ac_cv_header_libuna_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBUNA_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libuna_h" = xno; then : + if test "x$ac_cv_header_libuna_h" = xno +then : ac_cv_libuna=no -else +else $as_nop ac_cv_libuna=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_get_version in -luna" >&5 -$as_echo_n "checking for libuna_get_version in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_get_version in -luna" >&5 +printf %s "checking for libuna_get_version in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26379,41 +33490,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_get_version (); int -main () +main (void) { return libuna_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_get_version=yes -else +else $as_nop ac_cv_lib_una_libuna_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_get_version" >&5 -$as_echo "$ac_cv_lib_una_libuna_get_version" >&6; } -if test "x$ac_cv_lib_una_libuna_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_get_version" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_get_version" >&6; } +if test "x$ac_cv_lib_una_libuna_get_version" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_size_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base16_stream_size_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_size_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base16_stream_size_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26422,40 +33533,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base16_stream_size_to_byte_stream (); int -main () +main (void) { return libuna_base16_stream_size_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base16_stream_size_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_copy_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base16_stream_copy_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_copy_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base16_stream_copy_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26464,40 +33575,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base16_stream_copy_to_byte_stream (); int -main () +main (void) { return libuna_base16_stream_copy_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base16_stream_copy_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_size_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base16_stream_size_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_size_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base16_stream_size_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26506,40 +33617,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base16_stream_size_from_byte_stream (); int -main () +main (void) { return libuna_base16_stream_size_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base16_stream_size_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base16_stream_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base16_stream_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26548,40 +33659,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base16_stream_copy_from_byte_stream (); int -main () +main (void) { return libuna_base16_stream_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base16_stream_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_with_index_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base16_stream_with_index_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base16_stream_with_index_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base16_stream_with_index_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26590,41 +33701,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base16_stream_with_index_copy_from_byte_stream (); int -main () +main (void) { return libuna_base16_stream_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base16_stream_with_index_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_from_base32_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_quintuplet_copy_from_base32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_from_base32_stream in -luna" >&5 +printf %s "checking for libuna_base32_quintuplet_copy_from_base32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26633,40 +33744,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_quintuplet_copy_from_base32_stream (); int -main () +main (void) { return libuna_base32_quintuplet_copy_from_base32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_base32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_to_base32_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_quintuplet_copy_to_base32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_to_base32_stream in -luna" >&5 +printf %s "checking for libuna_base32_quintuplet_copy_to_base32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26675,40 +33786,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_quintuplet_copy_to_base32_stream (); int -main () +main (void) { return libuna_base32_quintuplet_copy_to_base32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_base32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_quintuplet_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_quintuplet_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26717,40 +33828,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_quintuplet_copy_from_byte_stream (); int -main () +main (void) { return libuna_base32_quintuplet_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_quintuplet_copy_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_quintuplet_copy_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_quintuplet_copy_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26759,41 +33870,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_quintuplet_copy_to_byte_stream (); int -main () +main (void) { return libuna_base32_quintuplet_copy_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_quintuplet_copy_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_size_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_stream_size_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_size_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_stream_size_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26802,40 +33913,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_stream_size_to_byte_stream (); int -main () +main (void) { return libuna_base32_stream_size_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_stream_size_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_copy_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_stream_copy_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_copy_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_stream_copy_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26844,40 +33955,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_stream_copy_to_byte_stream (); int -main () +main (void) { return libuna_base32_stream_copy_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_stream_copy_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_size_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_stream_size_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_size_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_stream_size_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26886,40 +33997,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_stream_size_from_byte_stream (); int -main () +main (void) { return libuna_base32_stream_size_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_stream_size_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_stream_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_stream_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26928,40 +34039,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_stream_copy_from_byte_stream (); int -main () +main (void) { return libuna_base32_stream_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_stream_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_with_index_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base32_stream_with_index_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base32_stream_with_index_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base32_stream_with_index_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -26970,41 +34081,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base32_stream_with_index_copy_from_byte_stream (); int -main () +main (void) { return libuna_base32_stream_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base32_stream_with_index_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_from_base64_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_triplet_copy_from_base64_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_from_base64_stream in -luna" >&5 +printf %s "checking for libuna_base64_triplet_copy_from_base64_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27013,40 +34124,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_triplet_copy_from_base64_stream (); int -main () +main (void) { return libuna_base64_triplet_copy_from_base64_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_from_base64_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_to_base64_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_triplet_copy_to_base64_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_to_base64_stream in -luna" >&5 +printf %s "checking for libuna_base64_triplet_copy_to_base64_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27055,40 +34166,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_triplet_copy_to_base64_stream (); int -main () +main (void) { return libuna_base64_triplet_copy_to_base64_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_to_base64_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_triplet_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_triplet_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27097,40 +34208,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_triplet_copy_from_byte_stream (); int -main () +main (void) { return libuna_base64_triplet_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_triplet_copy_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_triplet_copy_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_triplet_copy_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27139,41 +34250,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_triplet_copy_to_byte_stream (); int -main () +main (void) { return libuna_base64_triplet_copy_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_triplet_copy_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_size_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_stream_size_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_size_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_stream_size_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27182,40 +34293,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_stream_size_to_byte_stream (); int -main () +main (void) { return libuna_base64_stream_size_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_stream_size_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_copy_to_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_stream_copy_to_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_copy_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_stream_copy_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27224,40 +34335,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_stream_copy_to_byte_stream (); int -main () +main (void) { return libuna_base64_stream_copy_to_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_stream_copy_to_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_size_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_stream_size_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_size_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_stream_size_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27266,40 +34377,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_stream_size_from_byte_stream (); int -main () +main (void) { return libuna_base64_stream_size_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_stream_size_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_stream_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_stream_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27308,40 +34419,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_stream_copy_from_byte_stream (); int -main () +main (void) { return libuna_base64_stream_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_stream_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_with_index_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_base64_stream_with_index_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_base64_stream_with_index_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_base64_stream_with_index_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27350,41 +34461,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_base64_stream_with_index_copy_from_byte_stream (); int -main () +main (void) { return libuna_base64_stream_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_base64_stream_with_index_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_byte_stream_size_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_byte_stream_size_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf8 in -luna" >&5 +printf %s "checking for libuna_byte_stream_size_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_byte_stream_size_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27393,40 +34504,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_byte_stream_size_from_utf8 (); int -main () +main (void) { return libuna_byte_stream_size_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_byte_stream_size_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_byte_stream_size_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_byte_stream_size_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_byte_stream_size_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_byte_stream_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_byte_stream_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27435,40 +34546,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_byte_stream_copy_from_utf8 (); int -main () +main (void) { return libuna_byte_stream_copy_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_byte_stream_copy_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_byte_stream_copy_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_byte_stream_size_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_byte_stream_size_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf16 in -luna" >&5 +printf %s "checking for libuna_byte_stream_size_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_byte_stream_size_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27477,40 +34588,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_byte_stream_size_from_utf16 (); int -main () +main (void) { return libuna_byte_stream_size_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_byte_stream_size_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_byte_stream_size_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_byte_stream_size_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_byte_stream_size_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_byte_stream_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_byte_stream_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27519,40 +34630,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_byte_stream_copy_from_utf16 (); int -main () +main (void) { return libuna_byte_stream_copy_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_byte_stream_copy_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_byte_stream_copy_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_byte_stream_size_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_byte_stream_size_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_size_from_utf32 in -luna" >&5 +printf %s "checking for libuna_byte_stream_size_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_byte_stream_size_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27561,40 +34672,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_byte_stream_size_from_utf32 (); int -main () +main (void) { return libuna_byte_stream_size_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_byte_stream_size_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_byte_stream_size_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_byte_stream_size_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_size_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_byte_stream_size_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_byte_stream_size_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_byte_stream_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_byte_stream_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_byte_stream_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_byte_stream_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27603,41 +34714,1134 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_byte_stream_copy_from_utf32 (); int -main () +main (void) { return libuna_byte_stream_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_byte_stream_copy_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_byte_stream_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_byte_stream_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_stream_size_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_size_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_size_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_size_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_size_to_byte_stream (); +int +main (void) +{ +return libuna_unicode_character_size_to_byte_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_size_to_byte_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_size_to_byte_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_size_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_size_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_size_to_byte_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_byte_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_from_byte_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_byte_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_byte_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_byte_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_byte_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_byte_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_to_byte_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_byte_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_byte_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_byte_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_size_to_ucs2 in -luna" >&5 +printf %s "checking for libuna_unicode_character_size_to_ucs2 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_size_to_ucs2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_size_to_ucs2 (); +int +main (void) +{ +return libuna_unicode_character_size_to_ucs2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_size_to_ucs2=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_size_to_ucs2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_size_to_ucs2" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_size_to_ucs2" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_size_to_ucs2" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_ucs2 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_ucs2 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_ucs2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_ucs2 (); +int +main (void) +{ +return libuna_unicode_character_copy_from_ucs2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_ucs2=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_ucs2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_ucs2" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_ucs2" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_ucs2" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_ucs2 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_ucs2 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_ucs2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_ucs2 (); +int +main (void) +{ +return libuna_unicode_character_copy_to_ucs2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_ucs2=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_ucs2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_ucs2" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_ucs2" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_ucs2" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_size_to_ucs4 in -luna" >&5 +printf %s "checking for libuna_unicode_character_size_to_ucs4 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_size_to_ucs4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_size_to_ucs4 (); +int +main (void) +{ +return libuna_unicode_character_size_to_ucs4 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_size_to_ucs4=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_size_to_ucs4=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_size_to_ucs4" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_size_to_ucs4" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_size_to_ucs4" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_ucs4 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_ucs4 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_ucs4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_ucs4 (); +int +main (void) +{ +return libuna_unicode_character_copy_from_ucs4 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_ucs4=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_ucs4=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_ucs4" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_ucs4" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_ucs4" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_ucs4 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_ucs4 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_ucs4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_ucs4 (); +int +main (void) +{ +return libuna_unicode_character_copy_to_ucs4 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_ucs4=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_ucs4=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_ucs4" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_ucs4" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_ucs4" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf7_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf7_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf7_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf7_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf7_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf7_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf7_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf7_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf7_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf7_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf7_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_size_to_utf8 in -luna" >&5 +printf %s "checking for libuna_unicode_character_size_to_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_size_to_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_size_to_utf8 (); +int +main (void) +{ +return libuna_unicode_character_size_to_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_size_to_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_size_to_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_size_to_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_size_to_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_size_to_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf8 (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf8 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf8 (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_size_to_utf8_rfc2279 in -luna" >&5 +printf %s "checking for libuna_unicode_character_size_to_utf8_rfc2279 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_size_to_utf8_rfc2279+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_size_to_utf8_rfc2279 (); +int +main (void) +{ +return libuna_unicode_character_size_to_utf8_rfc2279 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_size_to_utf8_rfc2279=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_size_to_utf8_rfc2279=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_size_to_utf8_rfc2279" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_size_to_utf8_rfc2279" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_size_to_utf8_rfc2279" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf8_rfc2279 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf8_rfc2279 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf8_rfc2279+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf8_rfc2279 (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf8_rfc2279 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf8_rfc2279=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf8_rfc2279=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf8_rfc2279" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf8_rfc2279" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf8_rfc2279" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf8_rfc2279 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf8_rfc2279 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf8_rfc2279+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf8_rfc2279 (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf8_rfc2279 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf8_rfc2279=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf8_rfc2279=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf8_rfc2279" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf8_rfc2279" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf8_rfc2279" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_size_to_utf16 in -luna" >&5 +printf %s "checking for libuna_unicode_character_size_to_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_size_to_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_size_to_utf16 (); +int +main (void) +{ +return libuna_unicode_character_size_to_utf16 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_size_to_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_size_to_utf16=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_size_to_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_size_to_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_size_to_utf16" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf16 (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf16 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf16=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf16" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf16 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf16 (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf16 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf16=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf16" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf16_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf16_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf16_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf16_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf16_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf16_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf16_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf16_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf16_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf32 (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf32 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf32" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf32 in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf32 (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf32 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf32" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_from_utf32_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_from_utf32_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_from_utf32_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_from_utf32_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_unicode_character_copy_to_utf32_stream in -luna" >&5 +printf %s "checking for libuna_unicode_character_copy_to_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_unicode_character_copy_to_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_unicode_character_copy_to_utf32_stream (); +int +main (void) +{ +return libuna_unicode_character_copy_to_utf32_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_unicode_character_copy_to_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_unicode_character_copy_to_utf32_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_unicode_character_copy_to_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_unicode_character_copy_to_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_unicode_character_copy_to_utf32_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf8_stream_size_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27646,40 +35850,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_stream_size_from_utf8 (); int -main () +main (void) { return libuna_utf8_stream_size_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_stream_size_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_stream_size_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_stream_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf8_stream_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27688,40 +35892,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_stream_copy_from_utf8 (); int -main () +main (void) { return libuna_utf8_stream_copy_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_stream_size_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf8_stream_size_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27730,40 +35934,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_stream_size_from_utf16 (); int -main () +main (void) { return libuna_utf8_stream_size_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_stream_size_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_stream_size_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_stream_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf8_stream_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27772,40 +35976,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_stream_copy_from_utf16 (); int -main () +main (void) { return libuna_utf8_stream_copy_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_stream_size_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_size_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf8_stream_size_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_stream_size_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27814,40 +36018,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_stream_size_from_utf32 (); int -main () +main (void) { return libuna_utf8_stream_size_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_stream_size_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_stream_size_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_stream_size_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_stream_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_stream_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf8_stream_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27856,41 +36060,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_stream_copy_from_utf32 (); int -main () +main (void) { return libuna_utf8_stream_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_stream_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_stream_size_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf16_stream_size_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27899,40 +36103,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_stream_size_from_utf8 (); int -main () +main (void) { return libuna_utf16_stream_size_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_stream_size_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_stream_size_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_stream_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf16_stream_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27941,40 +36145,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_stream_copy_from_utf8 (); int -main () +main (void) { return libuna_utf16_stream_copy_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_stream_size_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf16_stream_size_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -27983,40 +36187,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_stream_size_from_utf16 (); int -main () +main (void) { return libuna_utf16_stream_size_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_stream_size_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_stream_size_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_stream_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf16_stream_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28025,40 +36229,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_stream_copy_from_utf16 (); int -main () +main (void) { return libuna_utf16_stream_copy_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_stream_size_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_size_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf16_stream_size_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_stream_size_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28067,40 +36271,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_stream_size_from_utf32 (); int -main () +main (void) { return libuna_utf16_stream_size_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_stream_size_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_stream_size_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_stream_size_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_stream_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_stream_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf16_stream_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28109,41 +36313,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_stream_copy_from_utf32 (); int -main () +main (void) { return libuna_utf16_stream_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_stream_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_stream_size_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf32_stream_size_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28152,40 +36356,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_stream_size_from_utf8 (); int -main () +main (void) { return libuna_utf32_stream_size_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_stream_size_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_stream_size_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_stream_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf32_stream_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28194,40 +36398,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_stream_copy_from_utf8 (); int -main () +main (void) { return libuna_utf32_stream_copy_from_utf8 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf8" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_stream_size_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf32_stream_size_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28236,40 +36440,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_stream_size_from_utf16 (); int -main () +main (void) { return libuna_utf32_stream_size_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_stream_size_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_stream_size_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_stream_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf32_stream_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28278,40 +36482,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_stream_copy_from_utf16 (); int -main () +main (void) { return libuna_utf32_stream_copy_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_stream_size_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_size_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf32_stream_size_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_stream_size_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28320,40 +36524,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_stream_size_from_utf32 (); int -main () +main (void) { return libuna_utf32_stream_size_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_stream_size_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_stream_size_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_stream_size_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_stream_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_stream_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf32_stream_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28362,41 +36566,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_stream_copy_from_utf32 (); int -main () +main (void) { return libuna_utf32_stream_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_stream_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28405,40 +36609,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_size_from_byte_stream (); int -main () +main (void) { return libuna_utf8_string_size_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28447,40 +36651,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_copy_from_byte_stream (); int -main () +main (void) { return libuna_utf8_string_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28489,40 +36693,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_with_index_copy_from_byte_stream (); int -main () +main (void) { return libuna_utf8_string_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_compare_with_byte_stream (); +int +main (void) +{ +return libuna_utf8_string_compare_with_byte_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_byte_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_byte_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_byte_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28531,40 +36777,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_size_from_utf7_stream (); int -main () +main (void) { return libuna_utf8_string_size_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28573,40 +36819,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_copy_from_utf7_stream (); int -main () +main (void) { return libuna_utf8_string_copy_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28615,40 +36861,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_with_index_copy_from_utf7_stream (); int -main () +main (void) { return libuna_utf8_string_with_index_copy_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_compare_with_utf7_stream (); +int +main (void) +{ +return libuna_utf8_string_compare_with_utf7_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_utf7_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_utf7_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_utf7_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28657,40 +36945,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_size_from_utf8_stream (); int -main () +main (void) { return libuna_utf8_string_size_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28699,40 +36987,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_copy_from_utf8_stream (); int -main () +main (void) { return libuna_utf8_string_copy_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28741,40 +37029,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_with_index_copy_from_utf8_stream (); int -main () +main (void) { return libuna_utf8_string_with_index_copy_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28783,40 +37071,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_size_from_utf16_stream (); +char libuna_utf8_string_compare_with_utf8_stream (); int -main () +main (void) { -return libuna_utf8_string_size_from_utf16_stream (); +return libuna_utf8_string_compare_with_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream=yes -else - ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_utf8_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28825,40 +37113,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_copy_from_utf16_stream (); +char libuna_utf8_string_size_from_utf16 (); int -main () +main (void) { -return libuna_utf8_string_copy_from_utf16_stream (); +return libuna_utf8_string_size_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream=yes -else - ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_size_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_size_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28867,40 +37155,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_with_index_copy_from_utf16_stream (); +char libuna_utf8_string_copy_from_utf16 (); int -main () +main (void) { -return libuna_utf8_string_with_index_copy_from_utf16_stream (); +return libuna_utf8_string_copy_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream=yes -else - ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_copy_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_copy_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28909,40 +37197,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_size_from_utf32_stream (); +char libuna_utf8_string_with_index_copy_from_utf16 (); int -main () +main (void) { -return libuna_utf8_string_size_from_utf32_stream (); +return libuna_utf8_string_with_index_copy_from_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream=yes -else - ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_utf16 in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28951,40 +37239,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_copy_from_utf32_stream (); +char libuna_utf8_string_compare_with_utf16 (); int -main () +main (void) { -return libuna_utf8_string_copy_from_utf32_stream (); +return libuna_utf8_string_compare_with_utf16 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream=yes -else - ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_utf16=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_utf16" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28993,40 +37281,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_with_index_copy_from_utf32_stream (); +char libuna_utf8_string_size_from_utf16_stream (); int -main () +main (void) { -return libuna_utf8_string_with_index_copy_from_utf32_stream (); +return libuna_utf8_string_size_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream=yes -else - ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29035,40 +37323,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_size_from_utf16 (); +char libuna_utf8_string_copy_from_utf16_stream (); int -main () +main (void) { -return libuna_utf8_string_size_from_utf16 (); +return libuna_utf8_string_copy_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_size_from_utf16=yes -else - ac_cv_lib_una_libuna_utf8_string_size_from_utf16=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29077,40 +37365,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_copy_from_utf16 (); +char libuna_utf8_string_with_index_copy_from_utf16_stream (); int -main () +main (void) { -return libuna_utf8_string_copy_from_utf16 (); +return libuna_utf8_string_with_index_copy_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_copy_from_utf16=yes -else - ac_cv_lib_una_libuna_utf8_string_copy_from_utf16=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29119,40 +37407,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf8_string_with_index_copy_from_utf16 (); +char libuna_utf8_string_compare_with_utf16_stream (); int -main () +main (void) { -return libuna_utf8_string_with_index_copy_from_utf16 (); +return libuna_utf8_string_compare_with_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16=yes -else - ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_size_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_size_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29161,40 +37449,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_size_from_utf32 (); int -main () +main (void) { return libuna_utf8_string_size_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_size_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_size_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_size_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29203,40 +37491,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_copy_from_utf32 (); int -main () +main (void) { return libuna_utf8_string_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_copy_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf8_string_with_index_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29245,41 +37533,377 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf8_string_with_index_copy_from_utf32 (); int -main () +main (void) { return libuna_utf8_string_with_index_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32=yes -else +else $as_nop ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_utf32 in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_compare_with_utf32 (); +int +main (void) +{ +return libuna_utf8_string_compare_with_utf32 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_utf32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_utf32" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_size_from_utf32_stream (); +int +main (void) +{ +return libuna_utf8_string_size_from_utf32_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_utf32_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_copy_from_utf32_stream (); +int +main (void) +{ +return libuna_utf8_string_copy_from_utf32_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_utf32_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_with_index_copy_from_utf32_stream (); +int +main (void) +{ +return libuna_utf8_string_with_index_copy_from_utf32_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_utf32_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_compare_with_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_compare_with_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_compare_with_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_compare_with_utf32_stream (); +int +main (void) +{ +return libuna_utf8_string_compare_with_utf32_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_compare_with_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_compare_with_utf32_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_compare_with_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_compare_with_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_compare_with_utf32_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_size_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_size_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_size_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_size_from_scsu_stream (); +int +main (void) +{ +return libuna_utf8_string_size_from_scsu_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_size_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_size_from_scsu_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_size_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_size_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_size_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_copy_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_copy_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_copy_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_copy_from_scsu_stream (); +int +main (void) +{ +return libuna_utf8_string_copy_from_scsu_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_copy_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_copy_from_scsu_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_copy_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_copy_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_copy_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf8_string_with_index_copy_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf8_string_with_index_copy_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf8_string_with_index_copy_from_scsu_stream (); +int +main (void) +{ +return libuna_utf8_string_with_index_copy_from_scsu_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_scsu_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf8_string_with_index_copy_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29288,40 +37912,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_size_from_byte_stream (); int -main () +main (void) { return libuna_utf16_string_size_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29330,40 +37954,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_copy_from_byte_stream (); int -main () +main (void) { return libuna_utf16_string_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29372,40 +37996,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_with_index_copy_from_byte_stream (); int -main () +main (void) { return libuna_utf16_string_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_compare_with_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_compare_with_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_compare_with_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_compare_with_byte_stream (); +int +main (void) +{ +return libuna_utf16_string_compare_with_byte_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_compare_with_byte_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_compare_with_byte_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_compare_with_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_compare_with_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_compare_with_byte_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29414,40 +38080,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_size_from_utf7_stream (); int -main () +main (void) { return libuna_utf16_string_size_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29456,40 +38122,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_copy_from_utf7_stream (); int -main () +main (void) { return libuna_utf16_string_copy_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29498,40 +38164,208 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_with_index_copy_from_utf7_stream (); int -main () +main (void) { return libuna_utf16_string_with_index_copy_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_compare_with_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_compare_with_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_compare_with_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_compare_with_utf7_stream (); +int +main (void) +{ +return libuna_utf16_string_compare_with_utf7_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_compare_with_utf7_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_compare_with_utf7_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_compare_with_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_compare_with_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_compare_with_utf7_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_size_from_utf8 (); +int +main (void) +{ +return libuna_utf16_string_size_from_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_size_from_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_size_from_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_copy_from_utf8 (); +int +main (void) +{ +return libuna_utf16_string_copy_from_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_copy_from_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_copy_from_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_with_index_copy_from_utf8 (); +int +main (void) +{ +return libuna_utf16_string_with_index_copy_from_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29540,40 +38374,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_size_from_utf8_stream (); int -main () +main (void) { return libuna_utf16_string_size_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29582,40 +38416,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_copy_from_utf8_stream (); int -main () +main (void) { return libuna_utf16_string_copy_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29624,40 +38458,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_with_index_copy_from_utf8_stream (); int -main () +main (void) { return libuna_utf16_string_with_index_copy_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_compare_with_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_compare_with_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_compare_with_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_compare_with_utf8_stream (); +int +main (void) +{ +return libuna_utf16_string_compare_with_utf8_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_compare_with_utf8_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_compare_with_utf8_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_compare_with_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_compare_with_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_compare_with_utf8_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29666,40 +38542,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_size_from_utf16_stream (); int -main () +main (void) { return libuna_utf16_string_size_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29708,40 +38584,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_copy_from_utf16_stream (); int -main () +main (void) { return libuna_utf16_string_copy_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29750,40 +38626,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf16_string_with_index_copy_from_utf16_stream (); int -main () +main (void) { return libuna_utf16_string_with_index_copy_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_compare_with_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_compare_with_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_compare_with_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29792,40 +38668,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_size_from_utf32_stream (); +char libuna_utf16_string_compare_with_utf16_stream (); int -main () +main (void) { -return libuna_utf16_string_size_from_utf32_stream (); +return libuna_utf16_string_compare_with_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream=yes -else - ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_compare_with_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_compare_with_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_compare_with_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_compare_with_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_compare_with_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29834,40 +38710,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_copy_from_utf32_stream (); +char libuna_utf16_string_size_from_utf32 (); int -main () +main (void) { -return libuna_utf16_string_copy_from_utf32_stream (); +return libuna_utf16_string_size_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream=yes -else - ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_size_from_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_size_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29876,40 +38752,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_with_index_copy_from_utf32_stream (); +char libuna_utf16_string_copy_from_utf32 (); int -main () +main (void) { -return libuna_utf16_string_with_index_copy_from_utf32_stream (); +return libuna_utf16_string_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream=yes -else - ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_copy_from_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf32 in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29918,40 +38794,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_size_from_utf8 (); +char libuna_utf16_string_with_index_copy_from_utf32 (); int -main () +main (void) { -return libuna_utf16_string_size_from_utf8 (); +return libuna_utf16_string_with_index_copy_from_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_size_from_utf8=yes -else - ac_cv_lib_una_libuna_utf16_string_size_from_utf8=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_compare_with_utf32 in -luna" >&5 +printf %s "checking for libuna_utf16_string_compare_with_utf32 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_compare_with_utf32+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -29960,40 +38836,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_copy_from_utf8 (); +char libuna_utf16_string_compare_with_utf32 (); int -main () +main (void) { -return libuna_utf16_string_copy_from_utf8 (); +return libuna_utf16_string_compare_with_utf32 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_copy_from_utf8=yes -else - ac_cv_lib_una_libuna_utf16_string_copy_from_utf8=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_compare_with_utf32=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_compare_with_utf32=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_compare_with_utf32" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_compare_with_utf32" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_compare_with_utf32" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30002,40 +38878,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_with_index_copy_from_utf8 (); +char libuna_utf16_string_size_from_utf32_stream (); int -main () +main (void) { -return libuna_utf16_string_with_index_copy_from_utf8 (); +return libuna_utf16_string_size_from_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8=yes -else - ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_size_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_size_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30044,40 +38920,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_size_from_utf32 (); +char libuna_utf16_string_copy_from_utf32_stream (); int -main () +main (void) { -return libuna_utf16_string_size_from_utf32 (); +return libuna_utf16_string_copy_from_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_size_from_utf32=yes -else - ac_cv_lib_una_libuna_utf16_string_size_from_utf32=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_size_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30086,40 +38962,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_copy_from_utf32 (); +char libuna_utf16_string_with_index_copy_from_utf32_stream (); int -main () +main (void) { -return libuna_utf16_string_copy_from_utf32 (); +return libuna_utf16_string_with_index_copy_from_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_copy_from_utf32=yes -else - ac_cv_lib_una_libuna_utf16_string_copy_from_utf32=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_utf32 in -luna" >&5 -$as_echo_n "checking for libuna_utf16_string_with_index_copy_from_utf32 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_compare_with_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_compare_with_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_compare_with_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30128,41 +39004,167 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf16_string_with_index_copy_from_utf32 (); +char libuna_utf16_string_compare_with_utf32_stream (); int -main () +main (void) { -return libuna_utf16_string_with_index_copy_from_utf32 (); +return libuna_utf16_string_compare_with_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32=yes -else - ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_compare_with_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_compare_with_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" >&6; } -if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_utf32" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_compare_with_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_compare_with_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_compare_with_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_size_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_size_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_size_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_size_from_scsu_stream (); +int +main (void) +{ +return libuna_utf16_string_size_from_scsu_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_size_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_size_from_scsu_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_size_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_size_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_size_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_copy_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_copy_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_copy_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_copy_from_scsu_stream (); +int +main (void) +{ +return libuna_utf16_string_copy_from_scsu_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_copy_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_copy_from_scsu_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_copy_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_copy_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_copy_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf16_string_with_index_copy_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf16_string_with_index_copy_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf16_string_with_index_copy_from_scsu_stream (); +int +main (void) +{ +return libuna_utf16_string_with_index_copy_from_scsu_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_scsu_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf16_string_with_index_copy_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30171,40 +39173,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_size_from_byte_stream (); int -main () +main (void) { return libuna_utf32_string_size_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30213,40 +39215,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_copy_from_byte_stream (); int -main () +main (void) { return libuna_utf32_string_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_byte_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_with_index_copy_from_byte_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30255,40 +39257,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_with_index_copy_from_byte_stream (); int -main () +main (void) { return libuna_utf32_string_with_index_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_byte_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_compare_with_byte_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_compare_with_byte_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_compare_with_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_compare_with_byte_stream (); +int +main (void) +{ +return libuna_utf32_string_compare_with_byte_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_compare_with_byte_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_compare_with_byte_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_compare_with_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_compare_with_byte_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_compare_with_byte_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30297,40 +39341,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_size_from_utf7_stream (); int -main () +main (void) { return libuna_utf32_string_size_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30339,40 +39383,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_copy_from_utf7_stream (); int -main () +main (void) { return libuna_utf32_string_copy_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf7_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf7_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30381,40 +39425,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_with_index_copy_from_utf7_stream (); int -main () +main (void) { return libuna_utf32_string_with_index_copy_from_utf7_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf7_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_compare_with_utf7_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_compare_with_utf7_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_compare_with_utf7_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_compare_with_utf7_stream (); +int +main (void) +{ +return libuna_utf32_string_compare_with_utf7_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_compare_with_utf7_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_compare_with_utf7_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_compare_with_utf7_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_compare_with_utf7_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_compare_with_utf7_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30423,40 +39509,164 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_size_from_utf8_stream (); int -main () +main (void) { return libuna_utf32_string_size_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_size_from_utf8 (); +int +main (void) +{ +return libuna_utf32_string_size_from_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_size_from_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_size_from_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf8 in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_utf8 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf8+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_copy_from_utf8 (); +int +main (void) +{ +return libuna_utf32_string_copy_from_utf8 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_copy_from_utf8=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_copy_from_utf8=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ac_cv_libuna_dummy=yes in -llibuna_utf32_string_with_index_copy_from_utf8" >&5 +printf %s "checking for ac_cv_libuna_dummy=yes in -llibuna_utf32_string_with_index_copy_from_utf8... " >&6; } +if test ${ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-llibuna_utf32_string_with_index_copy_from_utf8 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char ac_cv_libuna_dummy=yes (); +int +main (void) +{ +return ac_cv_libuna_dummy=yes (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes=yes +else $as_nop + ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" >&5 +printf "%s\n" "$ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" >&6; } +if test "x$ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" = xyes +then : + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30465,40 +39675,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_copy_from_utf8_stream (); int -main () +main (void) { return libuna_utf32_string_copy_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf8_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf8_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30507,40 +39717,208 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_with_index_copy_from_utf8_stream (); int -main () +main (void) { return libuna_utf32_string_with_index_copy_from_utf8_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf8_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_compare_with_utf8_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_compare_with_utf8_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_compare_with_utf8_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_compare_with_utf8_stream (); +int +main (void) +{ +return libuna_utf32_string_compare_with_utf8_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_compare_with_utf8_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_compare_with_utf8_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_compare_with_utf8_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_compare_with_utf8_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_compare_with_utf8_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_size_from_utf16 (); +int +main (void) +{ +return libuna_utf32_string_size_from_utf16 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_size_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_size_from_utf16=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf16" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_copy_from_utf16 (); +int +main (void) +{ +return libuna_utf32_string_copy_from_utf16 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_copy_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_copy_from_utf16=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf16 in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_utf16 in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_with_index_copy_from_utf16 (); +int +main (void) +{ +return libuna_utf32_string_with_index_copy_from_utf16 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30549,40 +39927,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_size_from_utf16_stream (); int -main () +main (void) { return libuna_utf32_string_size_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30591,40 +39969,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_copy_from_utf16_stream (); int -main () +main (void) { return libuna_utf32_string_copy_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf16_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf16_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30633,40 +40011,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_with_index_copy_from_utf16_stream (); int -main () +main (void) { return libuna_utf32_string_with_index_copy_from_utf16_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_compare_with_utf16_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_compare_with_utf16_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_compare_with_utf16_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-luna $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libuna_utf32_string_compare_with_utf16_stream (); +int +main (void) +{ +return libuna_utf32_string_compare_with_utf16_stream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_compare_with_utf16_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_compare_with_utf16_stream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_compare_with_utf16_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_compare_with_utf16_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_compare_with_utf16_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30675,40 +40095,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_size_from_utf32_stream (); int -main () +main (void) { return libuna_utf32_string_size_from_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30717,40 +40137,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_copy_from_utf32_stream (); int -main () +main (void) { return libuna_utf32_string_copy_from_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf32_stream in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf32_stream in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30759,40 +40179,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libuna_utf32_string_with_index_copy_from_utf32_stream (); int -main () +main (void) { return libuna_utf32_string_with_index_copy_from_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream=yes -else +else $as_nop ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_compare_with_utf32_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_compare_with_utf32_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_compare_with_utf32_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30801,40 +40221,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf32_string_size_from_utf8 (); +char libuna_utf32_string_compare_with_utf32_stream (); int -main () +main (void) { -return libuna_utf32_string_size_from_utf8 (); +return libuna_utf32_string_compare_with_utf32_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf32_string_size_from_utf8=yes -else - ac_cv_lib_una_libuna_utf32_string_size_from_utf8=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_compare_with_utf32_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_compare_with_utf32_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_compare_with_utf32_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_compare_with_utf32_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_compare_with_utf32_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf8 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_utf8 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf8+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_size_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_size_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30843,80 +40263,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf32_string_copy_from_utf8 (); +char libuna_utf32_string_size_from_scsu_stream (); int -main () +main (void) { -return libuna_utf32_string_copy_from_utf8 (); +return libuna_utf32_string_size_from_scsu_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf32_string_copy_from_utf8=yes -else - ac_cv_lib_una_libuna_utf32_string_copy_from_utf8=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_size_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_size_from_scsu_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf8" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_size_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_scsu_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ac_cv_libuna_dummy=yes in -llibuna_utf32_string_with_index_copy_from_utf8" >&5 -$as_echo_n "checking for ac_cv_libuna_dummy=yes in -llibuna_utf32_string_with_index_copy_from_utf8... " >&6; } -if ${ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_copy_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_copy_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-llibuna_utf32_string_with_index_copy_from_utf8 $LIBS" +LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ac_cv_libuna_dummy=yes (); +char libuna_utf32_string_copy_from_scsu_stream (); int -main () +main (void) { -return ac_cv_libuna_dummy=yes (); +return libuna_utf32_string_copy_from_scsu_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes=yes -else - ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_copy_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_copy_from_scsu_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" >&5 -$as_echo "$ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" >&6; } -if test "x$ac_cv_lib_libuna_utf32_string_with_index_copy_from_utf8_ac_cv_libuna_dummy_yes" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_copy_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_scsu_stream" = xyes +then : + ac_cv_libuna_dummy=yes +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_size_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_size_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_size_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_scsu_stream in -luna" >&5 +printf %s "checking for libuna_utf32_string_with_index_copy_from_scsu_stream in -luna... " >&6; } +if test ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_scsu_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-luna $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30925,127 +40347,235 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf32_string_size_from_utf16 (); +char libuna_utf32_string_with_index_copy_from_scsu_stream (); int -main () +main (void) { -return libuna_utf32_string_size_from_utf16 (); +return libuna_utf32_string_with_index_copy_from_scsu_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf32_string_size_from_utf16=yes -else - ac_cv_lib_una_libuna_utf32_string_size_from_utf16=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_scsu_stream=yes +else $as_nop + ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_scsu_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_size_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_size_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_size_from_utf16" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_scsu_stream" >&5 +printf "%s\n" "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_scsu_stream" >&6; } +if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_scsu_stream" = xyes +then : ac_cv_libuna_dummy=yes -else +else $as_nop ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luna $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf32_string_copy_from_utf16 (); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \`LIBUNA_COMPARE_LESS' is defined" >&5 +printf %s "checking if \`LIBUNA_COMPARE_LESS' is defined... " >&6; } +if test ${ac_cv_libuna_defines_compare_less+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int -main () +main (void) { -return libuna_utf32_string_copy_from_utf16 (); +int test = LIBUNA_COMPARE_LESS; + +return( 0 ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf32_string_copy_from_utf16=yes -else - ac_cv_lib_una_libuna_utf32_string_copy_from_utf16=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libuna_defines_compare_less=yes +else $as_nop + ac_cv_libuna_defines_compare_less=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_copy_from_utf16" = xyes; then : - ac_cv_libuna_dummy=yes -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libuna_defines_compare_less" >&5 +printf "%s\n" "$ac_cv_libuna_defines_compare_less" >&6; } + + if test "x$ac_cv_libuna_defines_compare_less" != xyes +then : ac_cv_libuna=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libuna_utf32_string_with_index_copy_from_utf16 in -luna" >&5 -$as_echo_n "checking for libuna_utf32_string_with_index_copy_from_utf16 in -luna... " >&6; } -if ${ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luna $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \`LIBUNA_COMPARE_EQUAL' is defined" >&5 +printf %s "checking if \`LIBUNA_COMPARE_EQUAL' is defined... " >&6; } +if test ${ac_cv_libuna_defines_compare_equal+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +int +main (void) +{ +int test = LIBUNA_COMPARE_EQUAL; -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libuna_utf32_string_with_index_copy_from_utf16 (); +return( 0 ); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libuna_defines_compare_equal=yes +else $as_nop + ac_cv_libuna_defines_compare_equal=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libuna_defines_compare_equal" >&5 +printf "%s\n" "$ac_cv_libuna_defines_compare_equal" >&6; } + + if test "x$ac_cv_libuna_defines_compare_less" != xyes +then : + ac_cv_libuna=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \`LIBUNA_COMPARE_GREATER' is defined" >&5 +printf %s "checking if \`LIBUNA_COMPARE_GREATER' is defined... " >&6; } +if test ${ac_cv_libuna_defines_compare_greater+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int -main () +main (void) { -return libuna_utf32_string_with_index_copy_from_utf16 (); +int test = LIBUNA_COMPARE_GREATER; + +return( 0 ); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16=yes -else - ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libuna_defines_compare_greater=yes +else $as_nop + ac_cv_libuna_defines_compare_greater=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" >&5 -$as_echo "$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" >&6; } -if test "x$ac_cv_lib_una_libuna_utf32_string_with_index_copy_from_utf16" = xyes; then : - ac_cv_libuna_dummy=yes -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libuna_defines_compare_greater" >&5 +printf "%s\n" "$ac_cv_libuna_defines_compare_greater" >&6; } + + if test "x$ac_cv_libuna_defines_compare_less" != xyes +then : ac_cv_libuna=no fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \`LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE' is defined" >&5 +printf %s "checking if \`LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE' is defined... " >&6; } +if test ${ac_cv_libuna_defines_compare_greater+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +int test = LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE; + +return( 0 ); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_libuna_defines_compare_greater=yes +else $as_nop + ac_cv_libuna_defines_compare_greater=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libuna_defines_compare_greater" >&5 +printf "%s\n" "$ac_cv_libuna_defines_compare_greater" >&6; } + + if test "x$ac_cv_libuna_defines_utf16_stream_allow_unpaired_surrogate" != xyes +then : + ac_cv_libuna=no +fi ac_cv_libuna_LIBADD="-luna" fi fi - if test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_libuna" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect && test "x$ac_cv_libuna" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libuna in directory: $ac_cv_with_libuna See \`config.log' for more details" "$LINENO" 5; } @@ -31053,24 +40583,27 @@ fi - if test "x$ac_cv_libuna" = xyes; then : + if test "x$ac_cv_libuna" = xyes +then : -$as_echo "#define HAVE_LIBUNA 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBUNA 1" >>confdefs.h fi - if test "x$ac_cv_libuna" = xyes; then : + if test "x$ac_cv_libuna" = xyes +then : HAVE_LIBUNA=1 -else +else $as_nop HAVE_LIBUNA=0 fi - if test "x$ac_cv_libuna" != xyes; then : + if test "x$ac_cv_libuna" != xyes +then : ac_cv_libuna_CPPFLAGS="-I../libuna"; ac_cv_libuna_LIBADD="../libuna/libuna.la"; @@ -31079,7 +40612,7 @@ -$as_echo "#define HAVE_LOCAL_LIBUNA 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBUNA 1" >>confdefs.h HAVE_LOCAL_LIBUNA=1 @@ -31094,24 +40627,28 @@ HAVE_LOCAL_LIBUNA_FALSE= fi - if test "x$ac_cv_libuna_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libuna_CPPFLAGS" != "x" +then : LIBUNA_CPPFLAGS=$ac_cv_libuna_CPPFLAGS fi - if test "x$ac_cv_libuna_LIBADD" != "x"; then : + if test "x$ac_cv_libuna_LIBADD" != "x" +then : LIBUNA_LIBADD=$ac_cv_libuna_LIBADD fi - if test "x$ac_cv_libuna" = xyes; then : + if test "x$ac_cv_libuna" = xyes +then : ax_libuna_pc_libs_private=-luna fi - if test "x$ac_cv_libuna" = xyes; then : + if test "x$ac_cv_libuna" = xyes +then : ax_libuna_spec_requires=libuna ax_libuna_spec_build_requires=libuna-devel @@ -31123,52 +40660,59 @@ # Check whether --with-libcfile was given. -if test "${with_libcfile+set}" = set; then : +if test ${with_libcfile+y} +then : withval=$with_libcfile; ac_cv_with_libcfile=$withval -else +else $as_nop ac_cv_with_libcfile=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcfile+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcfile in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcfile+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcfile=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcfile" >&5 -$as_echo "$ac_cv_with_libcfile" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcfile" >&5 +printf "%s\n" "$ac_cv_with_libcfile" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcfile" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcfile" = xno +then : ac_cv_libcfile=no -else - if test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect; then : - if test -d "$ac_cv_with_libcfile"; then : +else $as_nop + ac_cv_libcfile=check + if test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect +then : + if test -d "$ac_cv_with_libcfile" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcfile}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcfile}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcfile See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcfile=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile" >&5 -$as_echo_n "checking for libcfile... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile >= 20160409" >&5 +printf %s "checking for libcfile >= 20160409... " >&6; } if test -n "$libcfile_CFLAGS"; then pkg_cv_libcfile_CFLAGS="$libcfile_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcfile >= 20160409\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcfile >= 20160409\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcfile >= 20160409") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcfile_CFLAGS=`$PKG_CONFIG --cflags "libcfile >= 20160409" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -31182,10 +40726,10 @@ pkg_cv_libcfile_LIBS="$libcfile_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcfile >= 20160409\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcfile >= 20160409\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcfile >= 20160409") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcfile_LIBS=`$PKG_CONFIG --libs "libcfile >= 20160409" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -31199,8 +40743,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -31208,33 +40752,35 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcfile_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcfile >= 20160409" 2>&1` + libcfile_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcfile >= 20160409" 2>&1` else - libcfile_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcfile >= 20160409" 2>&1` + libcfile_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcfile >= 20160409" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcfile_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcfile_PKG_ERRORS" >&5 - ac_cv_libcfile=check + ac_cv_libcfile=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcfile=check -else - libcfile_CFLAGS=$pkg_cv_libcfile_CFLAGS - libcfile_LIBS=$pkg_cv_libcfile_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcfile=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcfile=check +else + libcfile_CFLAGS=$pkg_cv_libcfile_CFLAGS + libcfile_LIBS=$pkg_cv_libcfile_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcfile=yes fi fi - if test "x$ac_cv_libcfile" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 -$as_echo_n "checking whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } -if ${ac_cv_header_libcfile_features_h_have_wide_character_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcfile" = xyes && test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 +printf %s "checking whether libcfile/features.h defines LIBCFILE_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } +if test ${ac_cv_header_libcfile_features_h_have_wide_character_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -31245,7 +40791,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined( LIBCFILE_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCFILE_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCFILE_HAVE_WIDE_CHARACTER_TYPE not defined @@ -31254,12 +40800,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_libcfile_features_h_have_wide_character_type=yes -else +else $as_nop ac_cv_header_libcfile_features_h_have_wide_character_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -31267,45 +40814,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcfile_features_h_have_wide_character_type" >&5 -$as_echo "$ac_cv_header_libcfile_features_h_have_wide_character_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcfile_features_h_have_wide_character_type" >&5 +printf "%s\n" "$ac_cv_header_libcfile_features_h_have_wide_character_type" >&6; } - if test "x$ac_cv_header_libcfile_features_h_have_wide_character_type" = xno; then : + if test "x$ac_cv_header_libcfile_features_h_have_wide_character_type" = xno +then : ac_cv_libcfile=no fi fi - if test "x$ac_cv_libcfile" = xyes; then : + if test "x$ac_cv_libcfile" = xyes +then : ac_cv_libcfile_CPPFLAGS="$pkg_cv_libcfile_CFLAGS" ac_cv_libcfile_LIBADD="$pkg_cv_libcfile_LIBS" fi fi - if test "x$ac_cv_libcfile" = xcheck; then : - for ac_header in libcfile.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcfile.h" "ac_cv_header_libcfile_h" "$ac_includes_default" -if test "x$ac_cv_header_libcfile_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCFILE_H 1 -_ACEOF + if test "x$ac_cv_libcfile" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcfile.h" "ac_cv_header_libcfile_h" "$ac_includes_default" +if test "x$ac_cv_header_libcfile_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCFILE_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcfile_h" = xno; then : + if test "x$ac_cv_header_libcfile_h" = xno +then : ac_cv_libcfile=no -else +else $as_nop ac_cv_libcfile=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_get_version in -lcfile" >&5 -$as_echo_n "checking for libcfile_get_version in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_get_version in -lcfile" >&5 +printf %s "checking for libcfile_get_version in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31314,41 +40861,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_get_version (); int -main () +main (void) { return libcfile_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_get_version=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_get_version" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_get_version" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_get_version" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_get_version" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_get_version" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_initialize in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_initialize in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_initialize in -lcfile" >&5 +printf %s "checking for libcfile_file_initialize in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31357,40 +40904,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_initialize (); int -main () +main (void) { return libcfile_file_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_initialize=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_initialize" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_initialize" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_initialize" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_initialize" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_initialize" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_free in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_free in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_free in -lcfile" >&5 +printf %s "checking for libcfile_file_free in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31399,40 +40946,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_free (); int -main () +main (void) { return libcfile_file_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_free=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_free" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_free" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_free" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_free" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_free" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_open in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open in -lcfile" >&5 +printf %s "checking for libcfile_file_open in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31441,40 +40988,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_open (); int -main () +main (void) { return libcfile_file_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_open=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_open" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_open" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_open" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_with_error_code in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_open_with_error_code in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_open_with_error_code+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_with_error_code in -lcfile" >&5 +printf %s "checking for libcfile_file_open_with_error_code in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_open_with_error_code+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31483,40 +41030,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_open_with_error_code (); int -main () +main (void) { return libcfile_file_open_with_error_code (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_open_with_error_code=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_open_with_error_code=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_with_error_code" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_open_with_error_code" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_open_with_error_code" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_with_error_code" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_open_with_error_code" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_open_with_error_code" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_close in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_close in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_close+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_close in -lcfile" >&5 +printf %s "checking for libcfile_file_close in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_close+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31525,40 +41072,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_close (); int -main () +main (void) { return libcfile_file_close (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_close=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_close=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_close" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_close" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_close" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_close" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_close" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_close" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_read_buffer in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_read_buffer in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_read_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_read_buffer in -lcfile" >&5 +printf %s "checking for libcfile_file_read_buffer in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_read_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31567,40 +41114,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_read_buffer (); int -main () +main (void) { return libcfile_file_read_buffer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_read_buffer=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_read_buffer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_read_buffer" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_read_buffer" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_read_buffer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_read_buffer" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_read_buffer" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_read_buffer" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_read_buffer_with_error_code in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_read_buffer_with_error_code in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_read_buffer_with_error_code in -lcfile" >&5 +printf %s "checking for libcfile_file_read_buffer_with_error_code in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31609,40 +41156,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_read_buffer_with_error_code (); int -main () +main (void) { return libcfile_file_read_buffer_with_error_code (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_read_buffer_with_error_code" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_write_buffer in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_write_buffer in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_write_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_write_buffer in -lcfile" >&5 +printf %s "checking for libcfile_file_write_buffer in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_write_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31651,40 +41198,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_write_buffer (); int -main () +main (void) { return libcfile_file_write_buffer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_write_buffer=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_write_buffer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_write_buffer" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_write_buffer" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_write_buffer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_write_buffer" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_write_buffer" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_write_buffer" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_write_buffer_with_error_code in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_write_buffer_with_error_code in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_write_buffer_with_error_code in -lcfile" >&5 +printf %s "checking for libcfile_file_write_buffer_with_error_code in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31693,40 +41240,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_write_buffer_with_error_code (); int -main () +main (void) { return libcfile_file_write_buffer_with_error_code (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_write_buffer_with_error_code" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_seek_offset in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_seek_offset in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_seek_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_seek_offset in -lcfile" >&5 +printf %s "checking for libcfile_file_seek_offset in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_seek_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31735,40 +41282,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_seek_offset (); int -main () +main (void) { return libcfile_file_seek_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_seek_offset=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_seek_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_seek_offset" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_seek_offset" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_seek_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_seek_offset" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_seek_offset" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_seek_offset" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_resize in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_resize in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_resize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_resize in -lcfile" >&5 +printf %s "checking for libcfile_file_resize in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_resize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31777,40 +41324,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_resize (); int -main () +main (void) { return libcfile_file_resize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_resize=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_resize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_resize" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_resize" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_resize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_resize" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_resize" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_resize" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_is_open in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_is_open in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_is_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_is_open in -lcfile" >&5 +printf %s "checking for libcfile_file_is_open in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_is_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31819,40 +41366,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_is_open (); int -main () +main (void) { return libcfile_file_is_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_is_open=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_is_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_is_open" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_is_open" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_is_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_is_open" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_is_open" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_is_open" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_get_offset in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_get_offset in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_get_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_get_offset in -lcfile" >&5 +printf %s "checking for libcfile_file_get_offset in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_get_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31861,40 +41408,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_get_offset (); int -main () +main (void) { return libcfile_file_get_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_get_offset=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_get_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_get_offset" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_get_offset" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_get_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_get_offset" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_get_offset" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_get_offset" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_get_size in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_get_size in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_get_size in -lcfile" >&5 +printf %s "checking for libcfile_file_get_size in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_get_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31903,40 +41450,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_get_size (); int -main () +main (void) { return libcfile_file_get_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_get_size=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_get_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_get_size" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_get_size" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_get_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_get_size" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_get_size" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_get_size" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_is_device in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_is_device in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_is_device+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_is_device in -lcfile" >&5 +printf %s "checking for libcfile_file_is_device in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_is_device+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31945,40 +41492,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_is_device (); int -main () +main (void) { return libcfile_file_is_device (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_is_device=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_is_device=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_is_device" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_is_device" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_is_device" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_is_device" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_is_device" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_is_device" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_io_control_read in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_io_control_read in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_io_control_read+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_io_control_read in -lcfile" >&5 +printf %s "checking for libcfile_file_io_control_read in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_io_control_read+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -31987,40 +41534,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_io_control_read (); int -main () +main (void) { return libcfile_file_io_control_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_io_control_read=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_io_control_read=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_io_control_read" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_io_control_read" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_io_control_read" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_io_control_read" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_io_control_read" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_io_control_read" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_io_control_read_with_error_code in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_io_control_read_with_error_code in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_io_control_read_with_error_code in -lcfile" >&5 +printf %s "checking for libcfile_file_io_control_read_with_error_code in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32029,42 +41576,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_io_control_read_with_error_code (); int -main () +main (void) { return libcfile_file_io_control_read_with_error_code (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_io_control_read_with_error_code" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_wide in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_open_wide in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_open_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_wide in -lcfile" >&5 +printf %s "checking for libcfile_file_open_wide in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_open_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32073,40 +41621,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_open_wide (); int -main () +main (void) { return libcfile_file_open_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_open_wide=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_open_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_wide" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_open_wide" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_open_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_wide" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_open_wide" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_open_wide" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_wide_with_error_code in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_open_wide_with_error_code in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_open_wide_with_error_code in -lcfile" >&5 +printf %s "checking for libcfile_file_open_wide_with_error_code in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32115,43 +41663,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_open_wide_with_error_code (); int -main () +main (void) { return libcfile_file_open_wide_with_error_code (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_open_wide_with_error_code" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_exists in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_exists in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_exists+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_exists in -lcfile" >&5 +printf %s "checking for libcfile_file_exists in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_exists+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32160,40 +41708,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_exists (); int -main () +main (void) { return libcfile_file_exists (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_exists=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_exists=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_exists" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_exists" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_exists" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_exists" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_exists" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_exists" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_remove in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_remove in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_remove+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_remove in -lcfile" >&5 +printf %s "checking for libcfile_file_remove in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_remove+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32202,42 +41750,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_remove (); int -main () +main (void) { return libcfile_file_remove (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_remove=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_remove=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_remove" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_remove" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_remove" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_remove" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_remove" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_remove" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_exists_wide in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_exists_wide in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_exists_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_exists_wide in -lcfile" >&5 +printf %s "checking for libcfile_file_exists_wide in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_exists_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32246,40 +41795,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_exists_wide (); int -main () +main (void) { return libcfile_file_exists_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_exists_wide=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_exists_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_exists_wide" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_exists_wide" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_exists_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_exists_wide" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_exists_wide" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_exists_wide" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_remove_wide in -lcfile" >&5 -$as_echo_n "checking for libcfile_file_remove_wide in -lcfile... " >&6; } -if ${ac_cv_lib_cfile_libcfile_file_remove_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcfile_file_remove_wide in -lcfile" >&5 +printf %s "checking for libcfile_file_remove_wide in -lcfile... " >&6; } +if test ${ac_cv_lib_cfile_libcfile_file_remove_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32288,32 +41837,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcfile_file_remove_wide (); int -main () +main (void) { return libcfile_file_remove_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cfile_libcfile_file_remove_wide=yes -else +else $as_nop ac_cv_lib_cfile_libcfile_file_remove_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_remove_wide" >&5 -$as_echo "$ac_cv_lib_cfile_libcfile_file_remove_wide" >&6; } -if test "x$ac_cv_lib_cfile_libcfile_file_remove_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfile_libcfile_file_remove_wide" >&5 +printf "%s\n" "$ac_cv_lib_cfile_libcfile_file_remove_wide" >&6; } +if test "x$ac_cv_lib_cfile_libcfile_file_remove_wide" = xyes +then : ac_cv_libcfile_dummy=yes -else +else $as_nop ac_cv_libcfile=no fi @@ -32324,9 +41872,10 @@ fi fi - if test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_libcfile" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect && test "x$ac_cv_libcfile" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcfile in directory: $ac_cv_with_libcfile See \`config.log' for more details" "$LINENO" 5; } @@ -32334,88 +41883,162 @@ fi - if test "x$ac_cv_libcfile" = xyes; then : + if test "x$ac_cv_libcfile" = xyes +then : -$as_echo "#define HAVE_LIBCFILE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCFILE 1" >>confdefs.h fi - if test "x$ac_cv_libcfile" = xyes; then : + if test "x$ac_cv_libcfile" = xyes +then : HAVE_LIBCFILE=1 -else +else $as_nop HAVE_LIBCFILE=0 fi - if test "x$ac_cv_libcfile" != xyes; then : - for ac_header in errno.h stdio.h sys/stat.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_cv_libcfile" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" +if test "x$ac_cv_header_stdio_h" = xyes +then : + printf "%s\n" "#define HAVE_STDIO_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h + +fi - for ac_header in cygwin/fs.h fcntl.h linux/fs.h sys/disk.h sys/disklabel.h sys/ioctl.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "cygwin/fs.h" "ac_cv_header_cygwin_fs_h" "$ac_includes_default" +if test "x$ac_cv_header_cygwin_fs_h" = xyes +then : + printf "%s\n" "#define HAVE_CYGWIN_FS_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "linux/fs.h" "ac_cv_header_linux_fs_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_fs_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_FS_H 1" >>confdefs.h +fi +ac_fn_c_check_header_compile "$LINENO" "sys/disk.h" "ac_cv_header_sys_disk_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_disk_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_DISK_H 1" >>confdefs.h - for ac_func in close fstat ftruncate ioctl lseek open read write -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_header_compile "$LINENO" "sys/disklabel.h" "ac_cv_header_sys_disklabel_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_disklabel_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_DISKLABEL_H 1" >>confdefs.h fi -done +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi + + + ac_fn_c_check_func "$LINENO" "close" "ac_cv_func_close" +if test "x$ac_cv_func_close" = xyes +then : + printf "%s\n" "#define HAVE_CLOSE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fstat" "ac_cv_func_fstat" +if test "x$ac_cv_func_fstat" = xyes +then : + printf "%s\n" "#define HAVE_FSTAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" +if test "x$ac_cv_func_ftruncate" = xyes +then : + printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl" +if test "x$ac_cv_func_ioctl" = xyes +then : + printf "%s\n" "#define HAVE_IOCTL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "lseek" "ac_cv_func_lseek" +if test "x$ac_cv_func_lseek" = xyes +then : + printf "%s\n" "#define HAVE_LSEEK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "open" "ac_cv_func_open" +if test "x$ac_cv_func_open" = xyes +then : + printf "%s\n" "#define HAVE_OPEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "read" "ac_cv_func_read" +if test "x$ac_cv_func_read" = xyes +then : + printf "%s\n" "#define HAVE_READ 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "write" "ac_cv_func_write" +if test "x$ac_cv_func_write" = xyes +then : + printf "%s\n" "#define HAVE_WRITE 1" >>confdefs.h + +fi - if test "x$ac_cv_func_close" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + + if test "x$ac_cv_func_close" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: close See \`config.log' for more details" "$LINENO" 5; } fi - for ac_func in posix_fadvise -do : ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" -if test "x$ac_cv_func_posix_fadvise" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_POSIX_FADVISE 1 -_ACEOF +if test "x$ac_cv_func_posix_fadvise" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h fi -done - if test "x$ac_cv_func_posix_fadvise" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_fadvise can be linked" >&5 -$as_echo_n "checking whether posix_fadvise can be linked... " >&6; } + if test "x$ac_cv_func_posix_fadvise" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_fadvise can be linked" >&5 +printf %s "checking whether posix_fadvise can be linked... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" @@ -32430,7 +42053,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined( POSIX_FADV_SEQUENTIAL ) #define POSIX_FADV_SEQUENTIAL 2 @@ -32440,12 +42063,13 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_posix_fadvise=yes -else +else $as_nop ac_cv_func_posix_fadvise=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c @@ -32456,40 +42080,45 @@ CFLAGS="$SAVE_CFLAGS" - if test "x$ac_cv_func_posix_fadvise" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "x$ac_cv_func_posix_fadvise" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_POSIX_FADVISE 1" >>confdefs.h +printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi - if test "x$ac_cv_func_fstat" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_fstat" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: fstat See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_ftruncate" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_ftruncate" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: ftruncate See \`config.log' for more details" "$LINENO" 5; } fi - if test x"$ac_cv_enable_winapi" = xno; then : - if test "x$ac_cv_func_ioctl" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test x"$ac_cv_enable_winapi" = xno +then : + if test "x$ac_cv_func_ioctl" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: ioctl See \`config.log' for more details" "$LINENO" 5; } @@ -32497,62 +42126,69 @@ fi - if test "x$ac_cv_func_lseek" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_lseek" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: lseek See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_open" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_open" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: open See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_read" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_read" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: read See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_write" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_write" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: write See \`config.log' for more details" "$LINENO" 5; } fi - for ac_func in stat unlink -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "stat" "ac_cv_func_stat" +if test "x$ac_cv_func_stat" = xyes +then : + printf "%s\n" "#define HAVE_STAT 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "unlink" "ac_cv_func_unlink" +if test "x$ac_cv_func_unlink" = xyes +then : + printf "%s\n" "#define HAVE_UNLINK 1" >>confdefs.h +fi - if test "x$ac_cv_func_stat" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + + if test "x$ac_cv_func_stat" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: stat See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_unlink" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_unlink" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: unlink See \`config.log' for more details" "$LINENO" 5; } @@ -32565,7 +42201,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCFILE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCFILE 1" >>confdefs.h HAVE_LOCAL_LIBCFILE=1 @@ -32580,24 +42216,28 @@ HAVE_LOCAL_LIBCFILE_FALSE= fi - if test "x$ac_cv_libcfile_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcfile_CPPFLAGS" != "x" +then : LIBCFILE_CPPFLAGS=$ac_cv_libcfile_CPPFLAGS fi - if test "x$ac_cv_libcfile_LIBADD" != "x"; then : + if test "x$ac_cv_libcfile_LIBADD" != "x" +then : LIBCFILE_LIBADD=$ac_cv_libcfile_LIBADD fi - if test "x$ac_cv_libcfile" = xyes; then : + if test "x$ac_cv_libcfile" = xyes +then : ax_libcfile_pc_libs_private=-lcfile fi - if test "x$ac_cv_libcfile" = xyes; then : + if test "x$ac_cv_libcfile" = xyes +then : ax_libcfile_spec_requires=libcfile ax_libcfile_spec_build_requires=libcfile-devel @@ -32609,52 +42249,59 @@ # Check whether --with-libcpath was given. -if test "${with_libcpath+set}" = set; then : +if test ${with_libcpath+y} +then : withval=$with_libcpath; ac_cv_with_libcpath=$withval -else +else $as_nop ac_cv_with_libcpath=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcpath in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcpath=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcpath" >&5 -$as_echo "$ac_cv_with_libcpath" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcpath" >&5 +printf "%s\n" "$ac_cv_with_libcpath" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcpath" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcpath" = xno +then : ac_cv_libcpath=no -else - if test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect; then : - if test -d "$ac_cv_with_libcpath"; then : +else $as_nop + ac_cv_libcpath=check + if test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect +then : + if test -d "$ac_cv_with_libcpath" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcpath}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcpath}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcpath See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcpath=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath" >&5 -$as_echo_n "checking for libcpath... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath >= 20180716" >&5 +printf %s "checking for libcpath >= 20180716... " >&6; } if test -n "$libcpath_CFLAGS"; then pkg_cv_libcpath_CFLAGS="$libcpath_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcpath >= 20180716\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcpath >= 20180716\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcpath >= 20180716") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcpath_CFLAGS=`$PKG_CONFIG --cflags "libcpath >= 20180716" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -32668,10 +42315,10 @@ pkg_cv_libcpath_LIBS="$libcpath_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcpath >= 20180716\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcpath >= 20180716\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcpath >= 20180716") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libcpath_LIBS=`$PKG_CONFIG --libs "libcpath >= 20180716" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -32685,8 +42332,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -32694,33 +42341,35 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcpath_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcpath >= 20180716" 2>&1` + libcpath_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcpath >= 20180716" 2>&1` else - libcpath_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcpath >= 20180716" 2>&1` + libcpath_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcpath >= 20180716" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcpath_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcpath_PKG_ERRORS" >&5 - ac_cv_libcpath=check + ac_cv_libcpath=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcpath=check -else - libcpath_CFLAGS=$pkg_cv_libcpath_CFLAGS - libcpath_LIBS=$pkg_cv_libcpath_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcpath=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcpath=check +else + libcpath_CFLAGS=$pkg_cv_libcpath_CFLAGS + libcpath_LIBS=$pkg_cv_libcpath_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcpath=yes fi fi - if test "x$ac_cv_libcpath" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 -$as_echo_n "checking whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } -if ${ac_cv_header_libcpath_features_h_have_wide_character_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcpath" = xyes && test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 +printf %s "checking whether libcpath/features.h defines LIBCPATH_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } +if test ${ac_cv_header_libcpath_features_h_have_wide_character_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -32731,7 +42380,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined( LIBCPATH_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBCPATH_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBCPATH_HAVE_WIDE_CHARACTER_TYPE not defined @@ -32740,12 +42389,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_libcpath_features_h_have_wide_character_type=yes -else +else $as_nop ac_cv_header_libcpath_features_h_have_wide_character_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -32753,45 +42403,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcpath_features_h_have_wide_character_type" >&5 -$as_echo "$ac_cv_header_libcpath_features_h_have_wide_character_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libcpath_features_h_have_wide_character_type" >&5 +printf "%s\n" "$ac_cv_header_libcpath_features_h_have_wide_character_type" >&6; } - if test "x$ac_cv_header_libcpath_features_h_have_wide_character_type" = xno; then : + if test "x$ac_cv_header_libcpath_features_h_have_wide_character_type" = xno +then : ac_cv_libcpath=no fi fi - if test "x$ac_cv_libcpath" = xyes; then : + if test "x$ac_cv_libcpath" = xyes +then : ac_cv_libcpath_CPPFLAGS="$pkg_cv_libcpath_CFLAGS" ac_cv_libcpath_LIBADD="$pkg_cv_libcpath_LIBS" fi fi - if test "x$ac_cv_libcpath" = xcheck; then : - for ac_header in libcpath.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcpath.h" "ac_cv_header_libcpath_h" "$ac_includes_default" -if test "x$ac_cv_header_libcpath_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCPATH_H 1 -_ACEOF + if test "x$ac_cv_libcpath" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcpath.h" "ac_cv_header_libcpath_h" "$ac_includes_default" +if test "x$ac_cv_header_libcpath_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCPATH_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcpath_h" = xno; then : + if test "x$ac_cv_header_libcpath_h" = xno +then : ac_cv_libcpath=no -else +else $as_nop ac_cv_libcpath=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_get_version in -lcpath" >&5 -$as_echo_n "checking for libcpath_get_version in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_get_version in -lcpath" >&5 +printf %s "checking for libcpath_get_version in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32800,41 +42450,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_get_version (); int -main () +main (void) { return libcpath_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_get_version=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_get_version" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_get_version" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_get_version" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_get_version" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_get_version" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_change_directory in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_change_directory in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_change_directory+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_change_directory in -lcpath" >&5 +printf %s "checking for libcpath_path_change_directory in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_change_directory+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32843,40 +42493,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_change_directory (); int -main () +main (void) { return libcpath_path_change_directory (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_change_directory=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_change_directory=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_change_directory" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_change_directory" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_change_directory" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_change_directory" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_change_directory" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_change_directory" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_current_working_directory in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_current_working_directory in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_current_working_directory+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_current_working_directory in -lcpath" >&5 +printf %s "checking for libcpath_path_get_current_working_directory in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_current_working_directory+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32885,40 +42535,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_current_working_directory (); int -main () +main (void) { return libcpath_path_get_current_working_directory (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_current_working_directory=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_current_working_directory=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_current_working_directory" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_current_working_directory" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_current_working_directory" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_current_working_directory" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_current_working_directory" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_current_working_directory" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_full_path in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_full_path in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_full_path+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_full_path in -lcpath" >&5 +printf %s "checking for libcpath_path_get_full_path in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_full_path+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32927,40 +42577,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_full_path (); int -main () +main (void) { return libcpath_path_get_full_path (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_full_path=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_full_path=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_full_path" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_full_path" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_full_path" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_full_path" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_full_path" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_full_path" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_filename in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_sanitized_filename in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_filename+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_filename in -lcpath" >&5 +printf %s "checking for libcpath_path_get_sanitized_filename in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_sanitized_filename+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -32969,40 +42619,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_sanitized_filename (); int -main () +main (void) { return libcpath_path_get_sanitized_filename (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_sanitized_filename=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_sanitized_filename=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_path in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_sanitized_path in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_path+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_path in -lcpath" >&5 +printf %s "checking for libcpath_path_get_sanitized_path in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_sanitized_path+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33011,40 +42661,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_sanitized_path (); int -main () +main (void) { return libcpath_path_get_sanitized_path (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_sanitized_path=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_sanitized_path=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_path" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_path" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_path" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_path" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_sanitized_path" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_path" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_join in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_join in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_join+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_join in -lcpath" >&5 +printf %s "checking for libcpath_path_join in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_join+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33053,40 +42703,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_join (); int -main () +main (void) { return libcpath_path_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_join=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_join=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_join" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_join" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_join" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_join" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_join" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_join" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_make_directory in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_make_directory in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_make_directory+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_make_directory in -lcpath" >&5 +printf %s "checking for libcpath_path_make_directory in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_make_directory+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33095,42 +42745,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_make_directory (); int -main () +main (void) { return libcpath_path_make_directory (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_make_directory=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_make_directory=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_make_directory" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_make_directory" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_make_directory" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_make_directory" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_make_directory" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_make_directory" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_change_directory_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_change_directory_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_change_directory_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_change_directory_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_change_directory_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_change_directory_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33139,40 +42790,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_change_directory_wide (); int -main () +main (void) { return libcpath_path_change_directory_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_change_directory_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_change_directory_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_change_directory_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_change_directory_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_change_directory_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_change_directory_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_change_directory_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_change_directory_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_current_working_directory_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_current_working_directory_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_current_working_directory_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_get_current_working_directory_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33181,40 +42832,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_current_working_directory_wide (); int -main () +main (void) { return libcpath_path_get_current_working_directory_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_current_working_directory_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_full_path_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_full_path_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_full_path_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_full_path_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_get_full_path_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_full_path_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33223,40 +42874,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_full_path_wide (); int -main () +main (void) { return libcpath_path_get_full_path_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_full_path_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_full_path_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_full_path_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_full_path_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_full_path_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_full_path_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_full_path_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_full_path_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_filename_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_sanitized_filename_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_filename_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_get_sanitized_filename_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33265,40 +42916,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_sanitized_filename_wide (); int -main () +main (void) { return libcpath_path_get_sanitized_filename_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_filename_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_path_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_get_sanitized_path_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_get_sanitized_path_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_get_sanitized_path_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33307,40 +42958,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_get_sanitized_path_wide (); int -main () +main (void) { return libcpath_path_get_sanitized_path_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_get_sanitized_path_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_join_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_join_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_join_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_join_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_join_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_join_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33349,40 +43000,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_join_wide (); int -main () +main (void) { return libcpath_path_join_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_join_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_join_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_join_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_join_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_join_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_join_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_join_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_join_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_make_directory_wide in -lcpath" >&5 -$as_echo_n "checking for libcpath_path_make_directory_wide in -lcpath... " >&6; } -if ${ac_cv_lib_cpath_libcpath_path_make_directory_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcpath_path_make_directory_wide in -lcpath" >&5 +printf %s "checking for libcpath_path_make_directory_wide in -lcpath... " >&6; } +if test ${ac_cv_lib_cpath_libcpath_path_make_directory_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcpath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33391,32 +43042,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcpath_path_make_directory_wide (); int -main () +main (void) { return libcpath_path_make_directory_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cpath_libcpath_path_make_directory_wide=yes -else +else $as_nop ac_cv_lib_cpath_libcpath_path_make_directory_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_make_directory_wide" >&5 -$as_echo "$ac_cv_lib_cpath_libcpath_path_make_directory_wide" >&6; } -if test "x$ac_cv_lib_cpath_libcpath_path_make_directory_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cpath_libcpath_path_make_directory_wide" >&5 +printf "%s\n" "$ac_cv_lib_cpath_libcpath_path_make_directory_wide" >&6; } +if test "x$ac_cv_lib_cpath_libcpath_path_make_directory_wide" = xyes +then : ac_cv_libcpath_dummy=yes -else +else $as_nop ac_cv_libcpath=no fi @@ -33427,9 +43077,10 @@ fi fi - if test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_libcpath" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect && test "x$ac_cv_libcpath" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcpath in directory: $ac_cv_with_libcpath See \`config.log' for more details" "$LINENO" 5; } @@ -33437,82 +43088,91 @@ fi - if test "x$ac_cv_libcpath" = xyes; then : + if test "x$ac_cv_libcpath" = xyes +then : -$as_echo "#define HAVE_LIBCPATH 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCPATH 1" >>confdefs.h fi - if test "x$ac_cv_libcpath" = xyes; then : + if test "x$ac_cv_libcpath" = xyes +then : HAVE_LIBCPATH=1 -else +else $as_nop HAVE_LIBCPATH=0 fi - if test "x$ac_cv_libcpath" != xyes; then : - for ac_header in errno.h sys/stat.h sys/syslimits.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + if test "x$ac_cv_libcpath" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "sys/syslimits.h" "ac_cv_header_sys_syslimits_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_syslimits_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSLIMITS_H 1" >>confdefs.h +fi - for ac_func in chdir getcwd -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + + ac_fn_c_check_func "$LINENO" "chdir" "ac_cv_func_chdir" +if test "x$ac_cv_func_chdir" = xyes +then : + printf "%s\n" "#define HAVE_CHDIR 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" +if test "x$ac_cv_func_getcwd" = xyes +then : + printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h +fi - if test "x$ac_cv_func_chdir" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + + if test "x$ac_cv_func_chdir" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: chdir See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_func_getcwd" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_getcwd" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing functions: getcwd See \`config.log' for more details" "$LINENO" 5; } fi - for ac_func in mkdir -do : ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" -if test "x$ac_cv_func_mkdir" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MKDIR 1 -_ACEOF +if test "x$ac_cv_func_mkdir" = xyes +then : + printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h fi -done - if test "x$ac_cv_func_mkdir" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to use mkdir" >&5 -$as_echo_n "checking how to use mkdir... " >&6; } + if test "x$ac_cv_func_mkdir" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to use mkdir" >&5 +printf %s "checking how to use mkdir... " >&6; } SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall -Werror" @@ -33528,43 +43188,46 @@ #include #include int -main () +main (void) { mkdir( "", 0 ) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: with additional mode argument" >&5 -$as_echo "with additional mode argument" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: with additional mode argument" >&5 +printf "%s\n" "with additional mode argument" >&6; } ac_cv_cv_mkdir_mode=yes -else +else $as_nop ac_cv_cv_mkdir_mode=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "x$ac_cv_cv_mkdir_mode" = xno; then : + if test "x$ac_cv_cv_mkdir_mode" = xno +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { mkdir( "" ) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: with single argument" >&5 -$as_echo "with single argument" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: with single argument" >&5 +printf "%s\n" "with single argument" >&6; } ac_cv_cv_mkdir=yes -else +else $as_nop ac_cv_cv_mkdir=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi @@ -33577,31 +43240,35 @@ CFLAGS="$SAVE_CFLAGS" - if test "x$ac_cv_cv_mkdir_mode" = xno && test "x$ac_cv_cv_mkdir" = xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown" >&5 -$as_echo "$as_me: WARNING: unknown" >&2;} + if test "x$ac_cv_cv_mkdir_mode" = xno && test "x$ac_cv_cv_mkdir" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unknown" >&5 +printf "%s\n" "$as_me: WARNING: unknown" >&2;} ac_cv_func_mkdir=no fi - if test "x$ac_cv_func_mkdir" = xyes; then : + if test "x$ac_cv_func_mkdir" = xyes +then : -$as_echo "#define HAVE_MKDIR 1" >>confdefs.h +printf "%s\n" "#define HAVE_MKDIR 1" >>confdefs.h fi - if test "x$ac_cv_cv_mkdir_mode" = xyes; then : + if test "x$ac_cv_cv_mkdir_mode" = xyes +then : -$as_echo "#define HAVE_MKDIR_MODE 1" >>confdefs.h +printf "%s\n" "#define HAVE_MKDIR_MODE 1" >>confdefs.h fi fi - if test "x$ac_cv_func_mkdir" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_mkdir" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: mkdir See \`config.log' for more details" "$LINENO" 5; } @@ -33615,7 +43282,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCPATH 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCPATH 1" >>confdefs.h HAVE_LOCAL_LIBCPATH=1 @@ -33630,24 +43297,28 @@ HAVE_LOCAL_LIBCPATH_FALSE= fi - if test "x$ac_cv_libcpath_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcpath_CPPFLAGS" != "x" +then : LIBCPATH_CPPFLAGS=$ac_cv_libcpath_CPPFLAGS fi - if test "x$ac_cv_libcpath_LIBADD" != "x"; then : + if test "x$ac_cv_libcpath_LIBADD" != "x" +then : LIBCPATH_LIBADD=$ac_cv_libcpath_LIBADD fi - if test "x$ac_cv_libcpath" = xyes; then : + if test "x$ac_cv_libcpath" = xyes +then : ax_libcpath_pc_libs_private=-lcpath fi - if test "x$ac_cv_libcpath" = xyes; then : + if test "x$ac_cv_libcpath" = xyes +then : ax_libcpath_spec_requires=libcpath ax_libcpath_spec_build_requires=libcpath-devel @@ -33659,54 +43330,61 @@ # Check whether --with-libbfio was given. -if test "${with_libbfio+set}" = set; then : +if test ${with_libbfio+y} +then : withval=$with_libbfio; ac_cv_with_libbfio=$withval -else +else $as_nop ac_cv_with_libbfio=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libbfio+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libbfio in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libbfio+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libbfio=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libbfio" >&5 -$as_echo "$ac_cv_with_libbfio" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libbfio" >&5 +printf "%s\n" "$ac_cv_with_libbfio" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libbfio" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libbfio" = xno +then : ac_cv_libbfio=no -else - if test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect; then : - if test -d "$ac_cv_with_libbfio"; then : +else $as_nop + ac_cv_libbfio=check + if test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect +then : + if test -d "$ac_cv_with_libbfio" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libbfio}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libbfio}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libbfio See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libbfio=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio" >&5 -$as_echo_n "checking for libbfio... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio >= 20201125" >&5 +printf %s "checking for libbfio >= 20201125... " >&6; } if test -n "$libbfio_CFLAGS"; then pkg_cv_libbfio_CFLAGS="$libbfio_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbfio >= 20160108\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libbfio >= 20160108") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbfio >= 20201125\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libbfio >= 20201125") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libbfio_CFLAGS=`$PKG_CONFIG --cflags "libbfio >= 20160108" 2>/dev/null` + pkg_cv_libbfio_CFLAGS=`$PKG_CONFIG --cflags "libbfio >= 20201125" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -33718,12 +43396,12 @@ pkg_cv_libbfio_LIBS="$libbfio_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbfio >= 20160108\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libbfio >= 20160108") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbfio >= 20201125\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libbfio >= 20201125") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libbfio_LIBS=`$PKG_CONFIG --libs "libbfio >= 20160108" 2>/dev/null` + pkg_cv_libbfio_LIBS=`$PKG_CONFIG --libs "libbfio >= 20201125" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -33735,8 +43413,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -33744,33 +43422,35 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libbfio_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libbfio >= 20160108" 2>&1` + libbfio_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libbfio >= 20201125" 2>&1` else - libbfio_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libbfio >= 20160108" 2>&1` + libbfio_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libbfio >= 20201125" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libbfio_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libbfio_PKG_ERRORS" >&5 - ac_cv_libbfio=check + ac_cv_libbfio=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libbfio=check -else - libbfio_CFLAGS=$pkg_cv_libbfio_CFLAGS - libbfio_LIBS=$pkg_cv_libbfio_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libbfio=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libbfio=check +else + libbfio_CFLAGS=$pkg_cv_libbfio_CFLAGS + libbfio_LIBS=$pkg_cv_libbfio_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libbfio=yes fi fi - if test "x$ac_cv_libbfio" = xyes && test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 -$as_echo_n "checking whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } -if ${ac_cv_header_libbfio_features_h_have_wide_character_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libbfio" = xyes && test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1" >&5 +printf %s "checking whether libbfio/features.h defines LIBBFIO_HAVE_WIDE_CHARACTER_TYPE as 1... " >&6; } +if test ${ac_cv_header_libbfio_features_h_have_wide_character_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -33781,7 +43461,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { #if !defined( LIBBFIO_HAVE_WIDE_CHARACTER_TYPE ) || ( LIBBFIO_HAVE_WIDE_CHARACTER_TYPE != 1 ) #error LIBBFIO_HAVE_WIDE_CHARACTER_TYPE not defined @@ -33790,12 +43470,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_libbfio_features_h_have_wide_character_type=yes -else +else $as_nop ac_cv_header_libbfio_features_h_have_wide_character_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -33803,45 +43484,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libbfio_features_h_have_wide_character_type" >&5 -$as_echo "$ac_cv_header_libbfio_features_h_have_wide_character_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_libbfio_features_h_have_wide_character_type" >&5 +printf "%s\n" "$ac_cv_header_libbfio_features_h_have_wide_character_type" >&6; } - if test "x$ac_cv_header_libbfio_features_h_have_wide_character_type" = xno; then : + if test "x$ac_cv_header_libbfio_features_h_have_wide_character_type" = xno +then : ac_cv_libbfio=no fi fi - if test "x$ac_cv_libbfio" = xyes; then : + if test "x$ac_cv_libbfio" = xyes +then : ac_cv_libbfio_CPPFLAGS="$pkg_cv_libbfio_CFLAGS" ac_cv_libbfio_LIBADD="$pkg_cv_libbfio_LIBS" fi fi - if test "x$ac_cv_libbfio" = xcheck; then : - for ac_header in libbfio.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libbfio.h" "ac_cv_header_libbfio_h" "$ac_includes_default" -if test "x$ac_cv_header_libbfio_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBBFIO_H 1 -_ACEOF + if test "x$ac_cv_libbfio" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libbfio.h" "ac_cv_header_libbfio_h" "$ac_includes_default" +if test "x$ac_cv_header_libbfio_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBBFIO_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libbfio_h" = xno; then : + if test "x$ac_cv_header_libbfio_h" = xno +then : ac_cv_libbfio=no -else +else $as_nop ac_cv_libbfio=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_get_version in -lbfio" >&5 -$as_echo_n "checking for libbfio_get_version in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_get_version in -lbfio" >&5 +printf %s "checking for libbfio_get_version in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33850,41 +43531,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_get_version (); int -main () +main (void) { return libbfio_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_get_version=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_get_version" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_get_version" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_get_version" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_get_version" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_get_version" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_free in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_free in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_free in -lbfio" >&5 +printf %s "checking for libbfio_handle_free in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33893,40 +43574,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_free (); int -main () +main (void) { return libbfio_handle_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_free=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_free" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_free" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_free" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_free" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_free" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_open in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_open in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_open in -lbfio" >&5 +printf %s "checking for libbfio_handle_open in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33935,40 +43616,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_open (); int -main () +main (void) { return libbfio_handle_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_open=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_open" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_open" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_open" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_open" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_open" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_close in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_close in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_close+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_close in -lbfio" >&5 +printf %s "checking for libbfio_handle_close in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_close+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -33977,40 +43658,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_close (); int -main () +main (void) { return libbfio_handle_close (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_close=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_close=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_close" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_close" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_close" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_close" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_close" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_close" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_exists in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_exists in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_exists+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_exists in -lbfio" >&5 +printf %s "checking for libbfio_handle_exists in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_exists+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34019,40 +43700,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_exists (); int -main () +main (void) { return libbfio_handle_exists (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_exists=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_exists=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_exists" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_exists" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_exists" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_exists" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_exists" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_exists" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_read_buffer in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_read_buffer in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_read_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_read_buffer in -lbfio" >&5 +printf %s "checking for libbfio_handle_read_buffer in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_read_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34061,40 +43742,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_read_buffer (); int -main () +main (void) { return libbfio_handle_read_buffer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_read_buffer=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_read_buffer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_read_buffer" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_read_buffer" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_read_buffer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_read_buffer" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_read_buffer" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_read_buffer" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_write_buffer in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_write_buffer in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_write_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_read_buffer_at_offset in -lbfio" >&5 +printf %s "checking for libbfio_handle_read_buffer_at_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_read_buffer_at_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbfio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libbfio_handle_read_buffer_at_offset (); +int +main (void) +{ +return libbfio_handle_read_buffer_at_offset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_handle_read_buffer_at_offset=yes +else $as_nop + ac_cv_lib_bfio_libbfio_handle_read_buffer_at_offset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_read_buffer_at_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_read_buffer_at_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_read_buffer_at_offset" = xyes +then : + ac_cv_libbfio_dummy=yes +else $as_nop + ac_cv_libbfio=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_write_buffer in -lbfio" >&5 +printf %s "checking for libbfio_handle_write_buffer in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_write_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34103,40 +43826,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_write_buffer (); int -main () +main (void) { return libbfio_handle_write_buffer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_write_buffer=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_write_buffer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_write_buffer" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_write_buffer" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_write_buffer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_write_buffer" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_write_buffer" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_write_buffer" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_seek_offset in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_seek_offset in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_seek_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_write_buffer_at_offset in -lbfio" >&5 +printf %s "checking for libbfio_handle_write_buffer_at_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_write_buffer_at_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbfio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char libbfio_handle_write_buffer_at_offset (); +int +main (void) +{ +return libbfio_handle_write_buffer_at_offset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_handle_write_buffer_at_offset=yes +else $as_nop + ac_cv_lib_bfio_libbfio_handle_write_buffer_at_offset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_write_buffer_at_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_write_buffer_at_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_write_buffer_at_offset" = xyes +then : + ac_cv_libbfio_dummy=yes +else $as_nop + ac_cv_libbfio=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_seek_offset in -lbfio" >&5 +printf %s "checking for libbfio_handle_seek_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_seek_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34145,41 +43910,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_seek_offset (); int -main () +main (void) { return libbfio_handle_seek_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_seek_offset=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_seek_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_seek_offset" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_seek_offset" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_seek_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_seek_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_seek_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_seek_offset" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_is_open in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_is_open in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_is_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_is_open in -lbfio" >&5 +printf %s "checking for libbfio_handle_is_open in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_is_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34188,40 +43953,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_is_open (); int -main () +main (void) { return libbfio_handle_is_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_is_open=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_is_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_is_open" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_is_open" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_is_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_is_open" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_is_open" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_is_open" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_offset in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_get_offset in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_get_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_offset in -lbfio" >&5 +printf %s "checking for libbfio_handle_get_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_get_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34230,40 +43995,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_get_offset (); int -main () +main (void) { return libbfio_handle_get_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_get_offset=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_get_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_offset" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_get_offset" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_get_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_get_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_get_offset" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_size in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_get_size in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_size in -lbfio" >&5 +printf %s "checking for libbfio_handle_get_size in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_get_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34272,40 +44037,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_get_size (); int -main () +main (void) { return libbfio_handle_get_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_get_size=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_get_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_size" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_get_size" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_get_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_size" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_get_size" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_get_size" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_set_track_offsets_read in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_set_track_offsets_read in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_set_track_offsets_read in -lbfio" >&5 +printf %s "checking for libbfio_handle_set_track_offsets_read in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34314,40 +44079,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_set_track_offsets_read (); int -main () +main (void) { return libbfio_handle_set_track_offsets_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_set_track_offsets_read" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_number_of_offsets_read in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_get_number_of_offsets_read in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_number_of_offsets_read in -lbfio" >&5 +printf %s "checking for libbfio_handle_get_number_of_offsets_read in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34356,40 +44121,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_get_number_of_offsets_read (); int -main () +main (void) { return libbfio_handle_get_number_of_offsets_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_get_number_of_offsets_read" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_offset_read in -lbfio" >&5 -$as_echo_n "checking for libbfio_handle_get_offset_read in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_handle_get_offset_read+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_handle_get_offset_read in -lbfio" >&5 +printf %s "checking for libbfio_handle_get_offset_read in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_handle_get_offset_read+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34398,41 +44163,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_handle_get_offset_read (); int -main () +main (void) { return libbfio_handle_get_offset_read (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_handle_get_offset_read=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_handle_get_offset_read=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_offset_read" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_handle_get_offset_read" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_handle_get_offset_read" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_handle_get_offset_read" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_handle_get_offset_read" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_handle_get_offset_read" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_initialize in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_initialize in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_initialize in -lbfio" >&5 +printf %s "checking for libbfio_file_initialize in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34441,40 +44206,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_initialize (); int -main () +main (void) { return libbfio_file_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_initialize=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_initialize" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_initialize" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_initialize" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_initialize" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_initialize" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_size in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_get_name_size in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_get_name_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_size in -lbfio" >&5 +printf %s "checking for libbfio_file_get_name_size in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_get_name_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34483,40 +44248,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_get_name_size (); int -main () +main (void) { return libbfio_file_get_name_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_get_name_size=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_get_name_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_size" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_get_name_size" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_get_name_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_size" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_get_name_size" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_get_name_size" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_get_name in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_get_name+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name in -lbfio" >&5 +printf %s "checking for libbfio_file_get_name in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_get_name+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34525,40 +44290,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_get_name (); int -main () +main (void) { return libbfio_file_get_name (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_get_name=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_get_name=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_get_name" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_get_name" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_get_name" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_get_name" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_set_name in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_set_name in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_set_name+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_set_name in -lbfio" >&5 +printf %s "checking for libbfio_file_set_name in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_set_name+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34567,42 +44332,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_set_name (); int -main () +main (void) { return libbfio_file_set_name (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_set_name=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_set_name=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_set_name" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_set_name" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_set_name" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_set_name" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_set_name" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_set_name" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - if test "x$ac_cv_enable_wide_character_type" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_size_wide in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_get_name_size_wide in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_get_name_size_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_size_wide in -lbfio" >&5 +printf %s "checking for libbfio_file_get_name_size_wide in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_get_name_size_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34611,40 +44377,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_get_name_size_wide (); int -main () +main (void) { return libbfio_file_get_name_size_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_get_name_size_wide=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_get_name_size_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_size_wide" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_get_name_size_wide" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_get_name_size_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_size_wide" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_get_name_size_wide" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_get_name_size_wide" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_wide in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_get_name_wide in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_get_name_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_get_name_wide in -lbfio" >&5 +printf %s "checking for libbfio_file_get_name_wide in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_get_name_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34653,40 +44419,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_get_name_wide (); int -main () +main (void) { return libbfio_file_get_name_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_get_name_wide=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_get_name_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_wide" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_get_name_wide" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_get_name_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_get_name_wide" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_get_name_wide" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_get_name_wide" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_set_name_wide in -lbfio" >&5 -$as_echo_n "checking for libbfio_file_set_name_wide in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_file_set_name_wide+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_set_name_wide in -lbfio" >&5 +printf %s "checking for libbfio_file_set_name_wide in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_set_name_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34695,43 +44461,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_file_set_name_wide (); int -main () +main (void) { return libbfio_file_set_name_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_file_set_name_wide=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_file_set_name_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_set_name_wide" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_file_set_name_wide" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_file_set_name_wide" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_set_name_wide" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_set_name_wide" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_set_name_wide" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_initialize in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_initialize in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_initialize in -lbfio" >&5 +printf %s "checking for libbfio_pool_initialize in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34740,40 +44506,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_initialize (); int -main () +main (void) { return libbfio_pool_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_initialize=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_initialize" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_initialize" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_initialize" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_initialize" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_initialize" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_free in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_free in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_free in -lbfio" >&5 +printf %s "checking for libbfio_pool_free in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34782,40 +44548,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_free (); int -main () +main (void) { return libbfio_pool_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_free=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_free" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_free" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_free" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_free" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_free" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_clone in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_clone in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_clone in -lbfio" >&5 +printf %s "checking for libbfio_pool_clone in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34824,41 +44590,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_clone (); int -main () +main (void) { return libbfio_pool_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_clone=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_clone" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_clone" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_clone" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_clone" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_clone" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_number_of_handles in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_get_number_of_handles in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_get_number_of_handles+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_number_of_handles in -lbfio" >&5 +printf %s "checking for libbfio_pool_get_number_of_handles in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_get_number_of_handles+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34867,40 +44633,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_get_number_of_handles (); int -main () +main (void) { return libbfio_pool_get_number_of_handles (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_get_number_of_handles=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_get_number_of_handles=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_get_number_of_handles" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_handle in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_get_handle in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_get_handle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_handle in -lbfio" >&5 +printf %s "checking for libbfio_pool_get_handle in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_get_handle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34909,40 +44675,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_get_handle (); int -main () +main (void) { return libbfio_pool_get_handle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_get_handle=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_get_handle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_handle" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_get_handle" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_get_handle" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_handle" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_get_handle" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_get_handle" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_set_handle in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_set_handle in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_set_handle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_set_handle in -lbfio" >&5 +printf %s "checking for libbfio_pool_set_handle in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_set_handle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34951,40 +44717,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_set_handle (); int -main () +main (void) { return libbfio_pool_set_handle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_set_handle=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_set_handle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_set_handle" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_set_handle" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_set_handle" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_set_handle" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_set_handle" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_set_handle" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_append_handle in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_append_handle in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_append_handle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_append_handle in -lbfio" >&5 +printf %s "checking for libbfio_pool_append_handle in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_append_handle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -34993,40 +44759,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_append_handle (); int -main () +main (void) { return libbfio_pool_append_handle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_append_handle=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_append_handle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_append_handle" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_append_handle" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_append_handle" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_append_handle" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_append_handle" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_append_handle" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_remove_handle in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_remove_handle in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_remove_handle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_remove_handle in -lbfio" >&5 +printf %s "checking for libbfio_pool_remove_handle in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_remove_handle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35035,40 +44801,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_remove_handle (); int -main () +main (void) { return libbfio_pool_remove_handle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_remove_handle=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_remove_handle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_remove_handle" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_remove_handle" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_remove_handle" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_remove_handle" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_remove_handle" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_remove_handle" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_maximum_number_of_open_handles in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_get_maximum_number_of_open_handles in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_maximum_number_of_open_handles in -lbfio" >&5 +printf %s "checking for libbfio_pool_get_maximum_number_of_open_handles in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35077,40 +44843,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_get_maximum_number_of_open_handles (); int -main () +main (void) { return libbfio_pool_get_maximum_number_of_open_handles (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_get_maximum_number_of_open_handles" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_set_maximum_number_of_open_handles in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_set_maximum_number_of_open_handles in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_set_maximum_number_of_open_handles in -lbfio" >&5 +printf %s "checking for libbfio_pool_set_maximum_number_of_open_handles in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35119,41 +44885,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_set_maximum_number_of_open_handles (); int -main () +main (void) { return libbfio_pool_set_maximum_number_of_open_handles (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_set_maximum_number_of_open_handles" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_open in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_open in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_open+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_open in -lbfio" >&5 +printf %s "checking for libbfio_pool_open in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35162,40 +44928,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_open (); int -main () +main (void) { return libbfio_pool_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_open=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_open" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_open" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_open" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_open" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_open" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_reopen in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_reopen in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_reopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_reopen in -lbfio" >&5 +printf %s "checking for libbfio_pool_reopen in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_reopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35204,40 +44970,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_reopen (); int -main () +main (void) { return libbfio_pool_reopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_reopen=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_reopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_reopen" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_reopen" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_reopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_reopen" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_reopen" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_reopen" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_close in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_close in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_close+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_close in -lbfio" >&5 +printf %s "checking for libbfio_pool_close in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_close+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35246,40 +45012,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_close (); int -main () +main (void) { return libbfio_pool_close (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_close=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_close=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_close" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_close" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_close" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_close" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_close" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_close" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_close_all in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_close_all in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_close_all+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_close_all in -lbfio" >&5 +printf %s "checking for libbfio_pool_close_all in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_close_all+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35288,40 +45054,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_close_all (); int -main () +main (void) { return libbfio_pool_close_all (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_close_all=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_close_all=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_close_all" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_close_all" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_close_all" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_close_all" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_close_all" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_close_all" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_read_buffer in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_read_buffer in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_read_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_read_buffer in -lbfio" >&5 +printf %s "checking for libbfio_pool_read_buffer in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_read_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35330,40 +45096,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libbfio_pool_read_buffer (); int -main () +main (void) { return libbfio_pool_read_buffer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bfio_libbfio_pool_read_buffer=yes -else +else $as_nop ac_cv_lib_bfio_libbfio_pool_read_buffer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_read_buffer" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_read_buffer" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_read_buffer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_read_buffer" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_read_buffer" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_read_buffer" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_write_buffer in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_write_buffer in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_write_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_read_buffer_at_offset in -lbfio" >&5 +printf %s "checking for libbfio_pool_read_buffer_at_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_read_buffer_at_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35372,40 +45138,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libbfio_pool_write_buffer (); +char libbfio_pool_read_buffer_at_offset (); int -main () +main (void) { -return libbfio_pool_write_buffer (); +return libbfio_pool_read_buffer_at_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_bfio_libbfio_pool_write_buffer=yes -else - ac_cv_lib_bfio_libbfio_pool_write_buffer=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_pool_read_buffer_at_offset=yes +else $as_nop + ac_cv_lib_bfio_libbfio_pool_read_buffer_at_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_write_buffer" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_write_buffer" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_write_buffer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_read_buffer_at_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_read_buffer_at_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_read_buffer_at_offset" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_seek_offset in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_seek_offset in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_seek_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_write_buffer in -lbfio" >&5 +printf %s "checking for libbfio_pool_write_buffer in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_write_buffer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35414,40 +45180,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libbfio_pool_seek_offset (); +char libbfio_pool_write_buffer (); int -main () +main (void) { -return libbfio_pool_seek_offset (); +return libbfio_pool_write_buffer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_bfio_libbfio_pool_seek_offset=yes -else - ac_cv_lib_bfio_libbfio_pool_seek_offset=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_pool_write_buffer=yes +else $as_nop + ac_cv_lib_bfio_libbfio_pool_write_buffer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_seek_offset" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_seek_offset" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_seek_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_write_buffer" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_write_buffer" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_write_buffer" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_offset in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_get_offset in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_get_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_write_buffer_at_offset in -lbfio" >&5 +printf %s "checking for libbfio_pool_write_buffer_at_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_write_buffer_at_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35456,40 +45222,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libbfio_pool_get_offset (); +char libbfio_pool_write_buffer_at_offset (); int -main () +main (void) { -return libbfio_pool_get_offset (); +return libbfio_pool_write_buffer_at_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_bfio_libbfio_pool_get_offset=yes -else - ac_cv_lib_bfio_libbfio_pool_get_offset=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_pool_write_buffer_at_offset=yes +else $as_nop + ac_cv_lib_bfio_libbfio_pool_write_buffer_at_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_offset" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_get_offset" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_get_offset" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_write_buffer_at_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_write_buffer_at_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_write_buffer_at_offset" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_size in -lbfio" >&5 -$as_echo_n "checking for libbfio_pool_get_size in -lbfio... " >&6; } -if ${ac_cv_lib_bfio_libbfio_pool_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_seek_offset in -lbfio" >&5 +printf %s "checking for libbfio_pool_seek_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_seek_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -35498,1138 +45264,293 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libbfio_pool_get_size (); +char libbfio_pool_seek_offset (); int -main () +main (void) { -return libbfio_pool_get_size (); +return libbfio_pool_seek_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_bfio_libbfio_pool_get_size=yes -else - ac_cv_lib_bfio_libbfio_pool_get_size=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_pool_seek_offset=yes +else $as_nop + ac_cv_lib_bfio_libbfio_pool_seek_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_size" >&5 -$as_echo "$ac_cv_lib_bfio_libbfio_pool_get_size" >&6; } -if test "x$ac_cv_lib_bfio_libbfio_pool_get_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_seek_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_seek_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_seek_offset" = xyes +then : ac_cv_libbfio_dummy=yes -else +else $as_nop ac_cv_libbfio=no fi - - ac_cv_libbfio_LIBADD="-lbfio" -fi - -fi - if test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_libbfio" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 1 "unable to find supported libbfio in directory: $ac_cv_with_libbfio -See \`config.log' for more details" "$LINENO" 5; } - -fi - -fi - - if test "x$ac_cv_libbfio" = xyes; then : - -$as_echo "#define HAVE_LIBBFIO 1" >>confdefs.h - - -fi - - if test "x$ac_cv_libbfio" = xyes; then : - HAVE_LIBBFIO=1 - -else - HAVE_LIBBFIO=0 - - -fi - - - if test "x$ac_cv_libbfio" != xyes; then : - - ac_cv_libbfio_CPPFLAGS="-I../libbfio"; - ac_cv_libbfio_LIBADD="../libbfio/libbfio.la"; - - ac_cv_libbfio=local - - - -$as_echo "#define HAVE_LOCAL_LIBBFIO 1" >>confdefs.h - - HAVE_LOCAL_LIBBFIO=1 - - -fi - - if test "x$ac_cv_libbfio" = xlocal; then - HAVE_LOCAL_LIBBFIO_TRUE= - HAVE_LOCAL_LIBBFIO_FALSE='#' -else - HAVE_LOCAL_LIBBFIO_TRUE='#' - HAVE_LOCAL_LIBBFIO_FALSE= -fi - - if test "x$ac_cv_libbfio_CPPFLAGS" != "x"; then : - LIBBFIO_CPPFLAGS=$ac_cv_libbfio_CPPFLAGS - - -fi - if test "x$ac_cv_libbfio_LIBADD" != "x"; then : - LIBBFIO_LIBADD=$ac_cv_libbfio_LIBADD - - -fi - - if test "x$ac_cv_libbfio" = xyes; then : - ax_libbfio_pc_libs_private=-lbfio - - -fi - - if test "x$ac_cv_libbfio" = xyes; then : - ax_libbfio_spec_requires=libbfio - - ax_libbfio_spec_build_requires=libbfio-devel - - -fi - - - - -# Check whether --with-libfcache was given. -if test "${with_libfcache+set}" = set; then : - withval=$with_libfcache; ac_cv_with_libfcache=$withval -else - ac_cv_with_libfcache=auto-detect -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libfcache+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_with_libfcache=auto-detect -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfcache" >&5 -$as_echo "$ac_cv_with_libfcache" >&6; } - - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfcache" = xno; then : - ac_cv_libfcache=no -else - if test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect; then : - if test -d "$ac_cv_with_libfcache"; then : - CFLAGS="$CFLAGS -I${ac_cv_with_libfcache}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfcache}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 1 "no such directory: $ac_cv_with_libfcache -See \`config.log' for more details" "$LINENO" 5; } - -fi - ac_cv_libfcache=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache" >&5 -$as_echo_n "checking for libfcache... " >&6; } - -if test -n "$libfcache_CFLAGS"; then - pkg_cv_libfcache_CFLAGS="$libfcache_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfcache >= 20181010\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libfcache >= 20181010") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_libfcache_CFLAGS=`$PKG_CONFIG --cflags "libfcache >= 20181010" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$libfcache_LIBS"; then - pkg_cv_libfcache_LIBS="$libfcache_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfcache >= 20181010\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libfcache >= 20181010") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_libfcache_LIBS=`$PKG_CONFIG --libs "libfcache >= 20181010" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - libfcache_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfcache >= 20181010" 2>&1` - else - libfcache_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfcache >= 20181010" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$libfcache_PKG_ERRORS" >&5 - - ac_cv_libfcache=check -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libfcache=check -else - libfcache_CFLAGS=$pkg_cv_libfcache_CFLAGS - libfcache_LIBS=$pkg_cv_libfcache_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libfcache=yes -fi - -fi - if test "x$ac_cv_libfcache" = xyes; then : - ac_cv_libfcache_CPPFLAGS="$pkg_cv_libfcache_CFLAGS" - ac_cv_libfcache_LIBADD="$pkg_cv_libfcache_LIBS" -fi - -fi - - if test "x$ac_cv_libfcache" = xcheck; then : - for ac_header in libfcache.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libfcache.h" "ac_cv_header_libfcache_h" "$ac_includes_default" -if test "x$ac_cv_header_libfcache_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBFCACHE_H 1 -_ACEOF - -fi - -done - - - if test "x$ac_cv_header_libfcache_h" = xno; then : - ac_cv_libfcache=no -else - ac_cv_libfcache=yes - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_get_version in -lfcache" >&5 -$as_echo_n "checking for libfcache_get_version in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_offset in -lbfio" >&5 +printf %s "checking for libbfio_pool_get_offset in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_get_offset+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_get_version (); -int -main () -{ -return libfcache_get_version (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_get_version=yes -else - ac_cv_lib_fcache_libfcache_get_version=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_get_version" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_get_version" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_get_version" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_initialize in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_initialize in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_initialize (); -int -main () -{ -return libfcache_cache_initialize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_initialize=yes -else - ac_cv_lib_fcache_libfcache_cache_initialize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_initialize" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_initialize" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_initialize" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_free in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_free in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_free+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_free (); -int -main () -{ -return libfcache_cache_free (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_free=yes -else - ac_cv_lib_fcache_libfcache_cache_free=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_free" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_free" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_free" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clone in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_clone in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_clone (); -int -main () -{ -return libfcache_cache_clone (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_clone=yes -else - ac_cv_lib_fcache_libfcache_cache_clone=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clone" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_clone" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_clone" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clear in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_clear in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_clear+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_clear (); -int -main () -{ -return libfcache_cache_clear (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_clear=yes -else - ac_cv_lib_fcache_libfcache_cache_clear=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clear" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_clear" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_clear" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_number_of_entries in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_get_number_of_entries in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_get_number_of_entries+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_get_number_of_entries (); -int -main () -{ -return libfcache_cache_get_number_of_entries (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_get_number_of_entries=yes -else - ac_cv_lib_fcache_libfcache_cache_get_number_of_entries=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_number_of_cache_values in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_get_number_of_cache_values in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_get_number_of_cache_values (); -int -main () -{ -return libfcache_cache_get_number_of_cache_values (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values=yes -else - ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_value_by_identifier in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_get_value_by_identifier in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_get_value_by_identifier (); -int -main () -{ -return libfcache_cache_get_value_by_identifier (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier=yes -else - ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_value_by_index in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_get_value_by_index in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_get_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_get_value_by_index (); -int -main () -{ -return libfcache_cache_get_value_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_get_value_by_index=yes -else - ac_cv_lib_fcache_libfcache_cache_get_value_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_value_by_index" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_get_value_by_index" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_get_value_by_index" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_set_value_by_identifier in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_set_value_by_identifier in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_set_value_by_identifier (); -int -main () -{ -return libfcache_cache_set_value_by_identifier (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier=yes -else - ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_set_value_by_index in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_set_value_by_index in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_set_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" +LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_set_value_by_index (); +char libbfio_pool_get_offset (); int -main () +main (void) { -return libfcache_cache_set_value_by_index (); +return libbfio_pool_get_offset (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_set_value_by_index=yes -else - ac_cv_lib_fcache_libfcache_cache_set_value_by_index=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_pool_get_offset=yes +else $as_nop + ac_cv_lib_bfio_libbfio_pool_get_offset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_set_value_by_index" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_set_value_by_index" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_set_value_by_index" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_offset" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_get_offset" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_get_offset" = xyes +then : + ac_cv_libbfio_dummy=yes +else $as_nop + ac_cv_libbfio=no fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_clear in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_value_clear in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_value_clear+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_pool_get_size in -lbfio" >&5 +printf %s "checking for libbfio_pool_get_size in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_pool_get_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" +LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_value_clear (); +char libbfio_pool_get_size (); int -main () +main (void) { -return libfcache_cache_value_clear (); +return libbfio_pool_get_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_value_clear=yes -else - ac_cv_lib_fcache_libfcache_cache_value_clear=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_pool_get_size=yes +else $as_nop + ac_cv_lib_bfio_libbfio_pool_get_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_clear" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_value_clear" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_value_clear" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_pool_get_size" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_pool_get_size" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_pool_get_size" = xyes +then : + ac_cv_libbfio_dummy=yes +else $as_nop + ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_get_identifier in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_value_get_identifier in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_value_get_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_value_get_identifier (); -int -main () -{ -return libfcache_cache_value_get_identifier (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_value_get_identifier=yes -else - ac_cv_lib_fcache_libfcache_cache_value_get_identifier=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_get_identifier" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_value_get_identifier" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_value_get_identifier" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_set_identifier in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_value_set_identifier in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_value_set_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_pool_open in -lbfio" >&5 +printf %s "checking for libbfio_file_pool_open in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_pool_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" +LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_value_set_identifier (); +char libbfio_file_pool_open (); int -main () +main (void) { -return libfcache_cache_value_set_identifier (); +return libbfio_file_pool_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_value_set_identifier=yes -else - ac_cv_lib_fcache_libfcache_cache_value_set_identifier=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_file_pool_open=yes +else $as_nop + ac_cv_lib_bfio_libbfio_file_pool_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_set_identifier" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_value_set_identifier" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_value_set_identifier" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_pool_open" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_pool_open" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_pool_open" = xyes +then : + ac_cv_libbfio_dummy=yes +else $as_nop + ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_get_value in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_value_get_value in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_value_get_value+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_value_get_value (); -int -main () -{ -return libfcache_cache_value_get_value (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_value_get_value=yes -else - ac_cv_lib_fcache_libfcache_cache_value_get_value=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_get_value" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_value_get_value" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_value_get_value" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_set_value in -lfcache" >&5 -$as_echo_n "checking for libfcache_cache_value_set_value in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_cache_value_set_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_enable_wide_character_type" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libbfio_file_pool_open_wide in -lbfio" >&5 +printf %s "checking for libbfio_file_pool_open_wide in -lbfio... " >&6; } +if test ${ac_cv_lib_bfio_libbfio_file_pool_open_wide+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" +LIBS="-lbfio $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_cache_value_set_value (); +char libbfio_file_pool_open_wide (); int -main () +main (void) { -return libfcache_cache_value_set_value (); +return libbfio_file_pool_open_wide (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_cache_value_set_value=yes -else - ac_cv_lib_fcache_libfcache_cache_value_set_value=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bfio_libbfio_file_pool_open_wide=yes +else $as_nop + ac_cv_lib_bfio_libbfio_file_pool_open_wide=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_set_value" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_cache_value_set_value" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_cache_value_set_value" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfio_libbfio_file_pool_open_wide" >&5 +printf "%s\n" "$ac_cv_lib_bfio_libbfio_file_pool_open_wide" >&6; } +if test "x$ac_cv_lib_bfio_libbfio_file_pool_open_wide" = xyes +then : + ac_cv_libbfio_dummy=yes +else $as_nop + ac_cv_libbfio=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfcache_date_time_get_timestamp in -lfcache" >&5 -$as_echo_n "checking for libfcache_date_time_get_timestamp in -lfcache... " >&6; } -if ${ac_cv_lib_fcache_libfcache_date_time_get_timestamp+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfcache $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfcache_date_time_get_timestamp (); -int -main () -{ -return libfcache_date_time_get_timestamp (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fcache_libfcache_date_time_get_timestamp=yes -else - ac_cv_lib_fcache_libfcache_date_time_get_timestamp=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_date_time_get_timestamp" >&5 -$as_echo "$ac_cv_lib_fcache_libfcache_date_time_get_timestamp" >&6; } -if test "x$ac_cv_lib_fcache_libfcache_date_time_get_timestamp" = xyes; then : - ac_cv_libfcache_dummy=yes -else - ac_cv_libfcache=no fi - - ac_cv_libfcache_LIBADD="-lfcache" + ac_cv_libbfio_LIBADD="-lbfio" fi fi - if test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect && test "x$ac_cv_libfcache" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 1 "unable to find supported libfcache in directory: $ac_cv_with_libfcache + if test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect && test "x$ac_cv_libbfio" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 1 "unable to find supported libbfio in directory: $ac_cv_with_libbfio See \`config.log' for more details" "$LINENO" 5; } fi fi - if test "x$ac_cv_libfcache" = xyes; then : - -$as_echo "#define HAVE_LIBFCACHE 1" >>confdefs.h - - -fi - - if test "x$ac_cv_libfcache" = xyes; then : - HAVE_LIBFCACHE=1 - -else - HAVE_LIBFCACHE=0 - - -fi - + if test "x$ac_cv_libbfio" = xyes +then : - if test "x$ac_cv_libfcache" != xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include +printf "%s\n" "#define HAVE_LIBBFIO 1" >>confdefs.h -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi + if test "x$ac_cv_libbfio" = xyes +then : + HAVE_LIBBFIO=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - +else $as_nop + HAVE_LIBBFIO=0 - for ac_func in clock_gettime time -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF fi -done - if test "x$ac_cv_func_time" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 1 "Missing function: time -See \`config.log' for more details" "$LINENO" 5; } + if test "x$ac_cv_libbfio" != xyes +then : -fi - - ac_cv_libfcache_CPPFLAGS="-I../libfcache"; - ac_cv_libfcache_LIBADD="../libfcache/libfcache.la"; + ac_cv_libbfio_CPPFLAGS="-I../libbfio"; + ac_cv_libbfio_LIBADD="../libbfio/libbfio.la"; - ac_cv_libfcache=local + ac_cv_libbfio=local -$as_echo "#define HAVE_LOCAL_LIBFCACHE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBBFIO 1" >>confdefs.h - HAVE_LOCAL_LIBFCACHE=1 + HAVE_LOCAL_LIBBFIO=1 fi - if test "x$ac_cv_libfcache" = xlocal; then - HAVE_LOCAL_LIBFCACHE_TRUE= - HAVE_LOCAL_LIBFCACHE_FALSE='#' + if test "x$ac_cv_libbfio" = xlocal; then + HAVE_LOCAL_LIBBFIO_TRUE= + HAVE_LOCAL_LIBBFIO_FALSE='#' else - HAVE_LOCAL_LIBFCACHE_TRUE='#' - HAVE_LOCAL_LIBFCACHE_FALSE= + HAVE_LOCAL_LIBBFIO_TRUE='#' + HAVE_LOCAL_LIBBFIO_FALSE= fi - if test "x$ac_cv_libfcache_CPPFLAGS" != "x"; then : - LIBFCACHE_CPPFLAGS=$ac_cv_libfcache_CPPFLAGS + if test "x$ac_cv_libbfio_CPPFLAGS" != "x" +then : + LIBBFIO_CPPFLAGS=$ac_cv_libbfio_CPPFLAGS fi - if test "x$ac_cv_libfcache_LIBADD" != "x"; then : - LIBFCACHE_LIBADD=$ac_cv_libfcache_LIBADD + if test "x$ac_cv_libbfio_LIBADD" != "x" +then : + LIBBFIO_LIBADD=$ac_cv_libbfio_LIBADD fi - if test "x$ac_cv_libfcache" = xyes; then : - ax_libfcache_pc_libs_private=-lfcache + if test "x$ac_cv_libbfio" = xyes +then : + ax_libbfio_pc_libs_private=-lbfio fi - if test "x$ac_cv_libfcache" = xyes; then : - ax_libfcache_spec_requires=libfcache + if test "x$ac_cv_libbfio" = xyes +then : + ax_libbfio_spec_requires=libbfio - ax_libfcache_spec_build_requires=libfcache-devel + ax_libbfio_spec_build_requires=libbfio-devel fi @@ -36637,72 +45558,62 @@ -# Check whether --with-libfdata was given. -if test "${with_libfdata+set}" = set; then : - withval=$with_libfdata; ac_cv_with_libfdata=$withval -else - ac_cv_with_libfdata=auto-detect +# Check whether --with-libfcache was given. +if test ${with_libfcache+y} +then : + withval=$with_libfcache; ac_cv_with_libfcache=$withval +else $as_nop + ac_cv_with_libfcache=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfdata in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libfdata in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libfdata+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_with_libfdata=auto-detect + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libfcache in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libfcache+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_with_libfcache=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfdata" >&5 -$as_echo "$ac_cv_with_libfdata" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfcache" >&5 +printf "%s\n" "$ac_cv_with_libfcache" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdata" = xno; then : - ac_cv_libfdata=no -else - if test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect; then : - if test -d "$ac_cv_with_libfdata"; then : - CFLAGS="$CFLAGS -I${ac_cv_with_libfdata}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdata}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 1 "no such directory: $ac_cv_with_libfdata + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfcache" = xno +then : + ac_cv_libfcache=no +else $as_nop + ac_cv_libfcache=check + if test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect +then : + if test -d "$ac_cv_with_libfcache" +then : + CFLAGS="$CFLAGS -I${ac_cv_with_libfcache}/include" + LDFLAGS="$LDFLAGS -L${ac_cv_with_libfcache}/lib" +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 1 "no such directory: $ac_cv_with_libfcache See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libfdata=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata" >&5 -$as_echo_n "checking for libfdata... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache >= 20191109" >&5 +printf %s "checking for libfcache >= 20191109... " >&6; } -if test -n "$libfdata_CFLAGS"; then - pkg_cv_libfdata_CFLAGS="$libfdata_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdata >= 20181009\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libfdata >= 20181009") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_libfdata_CFLAGS=`$PKG_CONFIG --cflags "libfdata >= 20181009" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$libfdata_LIBS"; then - pkg_cv_libfdata_LIBS="$libfdata_LIBS" +if test -n "$libfcache_CFLAGS"; then + pkg_cv_libfcache_CFLAGS="$libfcache_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdata >= 20181009\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libfdata >= 20181009") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfcache >= 20191109\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libfcache >= 20191109") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libfdata_LIBS=`$PKG_CONFIG --libs "libfdata >= 20181009" 2>/dev/null` + pkg_cv_libfcache_CFLAGS=`$PKG_CONFIG --cflags "libfcache >= 20191109" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -36710,3271 +45621,1035 @@ else pkg_failed=untried fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - libfdata_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfdata >= 20181009" 2>&1` - else - libfdata_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfdata >= 20181009" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$libfdata_PKG_ERRORS" >&5 - - ac_cv_libfdata=check -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libfdata=check -else - libfdata_CFLAGS=$pkg_cv_libfdata_CFLAGS - libfdata_LIBS=$pkg_cv_libfdata_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libfdata=yes -fi - -fi - if test "x$ac_cv_libfdata" = xyes; then : - ac_cv_libfdata_CPPFLAGS="$pkg_cv_libfdata_CFLAGS" - ac_cv_libfdata_LIBADD="$pkg_cv_libfdata_LIBS" -fi - -fi - - if test "x$ac_cv_libfdata" = xcheck; then : - for ac_header in libfdata.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libfdata.h" "ac_cv_header_libfdata_h" "$ac_includes_default" -if test "x$ac_cv_header_libfdata_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBFDATA_H 1 -_ACEOF - -fi - -done - - - if test "x$ac_cv_header_libfdata_h" = xno; then : - ac_cv_libfdata=no -else - ac_cv_libfdata=yes - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_get_version in -lfdata" >&5 -$as_echo_n "checking for libfdata_get_version in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_get_version (); -int -main () -{ -return libfdata_get_version (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_get_version=yes -else - ac_cv_lib_fdata_libfdata_get_version=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_get_version" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_get_version" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_get_version" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_initialize in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_initialize in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_initialize (); -int -main () -{ -return libfdata_area_initialize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_initialize=yes -else - ac_cv_lib_fdata_libfdata_area_initialize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_initialize" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_initialize" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_initialize" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_free in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_free in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_free+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_free (); -int -main () -{ -return libfdata_area_free (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_free=yes -else - ac_cv_lib_fdata_libfdata_area_free=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_free" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_free" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_free" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_clone in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_clone in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_clone (); -int -main () -{ -return libfdata_area_clone (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_clone=yes -else - ac_cv_lib_fdata_libfdata_area_clone=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_clone" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_clone" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_clone" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_empty in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_empty in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_empty (); -int -main () -{ -return libfdata_area_empty (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_empty=yes -else - ac_cv_lib_fdata_libfdata_area_empty=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_empty" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_empty" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_empty" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_resize in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_resize in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_resize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_resize (); -int -main () -{ -return libfdata_area_resize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_resize=yes -else - ac_cv_lib_fdata_libfdata_area_resize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_resize" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_resize" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_resize" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_number_of_segments in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_get_number_of_segments in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_get_number_of_segments+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_get_number_of_segments (); -int -main () -{ -return libfdata_area_get_number_of_segments (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_get_number_of_segments=yes -else - ac_cv_lib_fdata_libfdata_area_get_number_of_segments=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_number_of_segments" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_get_number_of_segments" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_get_number_of_segments" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_segment_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_get_segment_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_get_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_get_segment_by_index (); -int -main () -{ -return libfdata_area_get_segment_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_get_segment_by_index=yes -else - ac_cv_lib_fdata_libfdata_area_get_segment_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_segment_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_get_segment_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_get_segment_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_set_segment_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_set_segment_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_set_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_set_segment_by_index (); -int -main () -{ -return libfdata_area_set_segment_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_set_segment_by_index=yes -else - ac_cv_lib_fdata_libfdata_area_set_segment_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_set_segment_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_set_segment_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_set_segment_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_prepend_segment in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_prepend_segment in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_prepend_segment+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_prepend_segment (); -int -main () -{ -return libfdata_area_prepend_segment (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_prepend_segment=yes -else - ac_cv_lib_fdata_libfdata_area_prepend_segment=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_prepend_segment" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_prepend_segment" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_prepend_segment" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_append_segment in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_append_segment in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_append_segment+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_append_segment (); -int -main () -{ -return libfdata_area_append_segment (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_append_segment=yes -else - ac_cv_lib_fdata_libfdata_area_append_segment=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_append_segment" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_append_segment" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_append_segment" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_element_data_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_get_element_data_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_get_element_data_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_get_element_data_size (); -int -main () -{ -return libfdata_area_get_element_data_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_get_element_data_size=yes -else - ac_cv_lib_fdata_libfdata_area_get_element_data_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_element_data_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_get_element_data_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_get_element_data_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_element_value_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_get_element_value_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_get_element_value_at_offset (); -int -main () -{ -return libfdata_area_get_element_value_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset=yes -else - ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_get_element_value_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_set_element_value_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_set_element_value_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_set_element_value_at_offset (); -int -main () -{ -return libfdata_area_set_element_value_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset=yes -else - ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_set_element_value_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_area_get_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_area_get_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_area_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_area_get_size (); -int -main () -{ -return libfdata_area_get_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_area_get_size=yes -else - ac_cv_lib_fdata_libfdata_area_get_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_area_get_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_area_get_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_area_get_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_initialize in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_initialize in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_initialize (); -int -main () -{ -return libfdata_list_initialize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_initialize=yes -else - ac_cv_lib_fdata_libfdata_list_initialize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_initialize" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_initialize" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_initialize" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_free in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_free in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_free+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_free (); -int -main () -{ -return libfdata_list_free (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_free=yes -else - ac_cv_lib_fdata_libfdata_list_free=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_free" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_free" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_free" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_clone in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_clone in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_clone (); -int -main () -{ -return libfdata_list_clone (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_clone=yes -else - ac_cv_lib_fdata_libfdata_list_clone=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_clone" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_clone" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_clone" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_empty in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_empty in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_empty (); -int -main () -{ -return libfdata_list_empty (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_empty=yes -else - ac_cv_lib_fdata_libfdata_list_empty=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_empty" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_empty" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_empty" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_resize in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_resize in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_resize+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_resize (); -int -main () -{ -return libfdata_list_resize (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_resize=yes -else - ac_cv_lib_fdata_libfdata_list_resize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_resize" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_resize" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_resize" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_reverse in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_reverse in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_reverse+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_reverse (); -int -main () -{ -return libfdata_list_reverse (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_reverse=yes -else - ac_cv_lib_fdata_libfdata_list_reverse=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_reverse" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_reverse" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_reverse" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_number_of_elements in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_number_of_elements in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_number_of_elements+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_number_of_elements (); -int -main () -{ -return libfdata_list_get_number_of_elements (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_number_of_elements=yes -else - ac_cv_lib_fdata_libfdata_list_get_number_of_elements=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_number_of_elements" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_number_of_elements" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_number_of_elements" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_list_element_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_list_element_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_list_element_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_list_element_by_index (); -int -main () -{ -return libfdata_list_get_list_element_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_list_element_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_get_list_element_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_list_element_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_list_element_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_list_element_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_element_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_element_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_element_by_index (); -int -main () -{ -return libfdata_list_get_element_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_element_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_get_element_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_element_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_set_element_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_set_element_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_set_element_by_index (); -int -main () -{ -return libfdata_list_set_element_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_set_element_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_set_element_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_set_element_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_prepend_element in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_prepend_element in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_prepend_element+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_prepend_element (); -int -main () -{ -return libfdata_list_prepend_element (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_prepend_element=yes -else - ac_cv_lib_fdata_libfdata_list_prepend_element=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_prepend_element" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_prepend_element" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_prepend_element" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_append_element in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_append_element in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_append_element+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_append_element (); -int -main () -{ -return libfdata_list_append_element (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_append_element=yes -else - ac_cv_lib_fdata_libfdata_list_append_element=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_append_element" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_append_element" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_append_element" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_append_list in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_append_list in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_append_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_append_list (); -int -main () -{ -return libfdata_list_append_list (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_append_list=yes -else - ac_cv_lib_fdata_libfdata_list_append_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_append_list" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_append_list" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_append_list" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_is_element_set in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_is_element_set in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_is_element_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_is_element_set (); -int -main () -{ -return libfdata_list_is_element_set (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_is_element_set=yes -else - ac_cv_lib_fdata_libfdata_list_is_element_set=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_is_element_set" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_is_element_set" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_is_element_set" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_mapped_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_mapped_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_mapped_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_mapped_offset (); -int -main () -{ -return libfdata_list_get_mapped_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_mapped_offset=yes -else - ac_cv_lib_fdata_libfdata_list_get_mapped_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_mapped_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_mapped_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_mapped_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_mapped_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_set_mapped_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_set_mapped_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_set_mapped_offset (); -int -main () -{ -return libfdata_list_set_mapped_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_set_mapped_offset=yes -else - ac_cv_lib_fdata_libfdata_list_set_mapped_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_mapped_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_set_mapped_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_set_mapped_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_mapped_size_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_mapped_size_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_mapped_size_by_index (); -int -main () -{ -return libfdata_list_get_mapped_size_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_mapped_size_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_mapped_size_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_set_mapped_size_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_set_mapped_size_by_index (); -int -main () -{ -return libfdata_list_set_mapped_size_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_set_mapped_size_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_by_index_with_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_element_by_index_with_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_element_by_index_with_mapped_size (); -int -main () -{ -return libfdata_list_get_element_by_index_with_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_element_by_index_with_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_by_index_with_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_set_element_by_index_with_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_set_element_by_index_with_mapped_size (); -int -main () -{ -return libfdata_list_set_element_by_index_with_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_set_element_by_index_with_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_append_element_with_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_append_element_with_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_append_element_with_mapped_size (); -int -main () -{ -return libfdata_list_append_element_with_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_append_element_with_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_index_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_element_index_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_element_index_at_offset (); -int -main () -{ -return libfdata_list_get_element_index_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset=yes -else - ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_element_index_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_list_element_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_list_element_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_list_element_at_offset (); -int -main () -{ -return libfdata_list_get_list_element_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset=yes -else - ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_list_element_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_element_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_element_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_element_at_offset (); -int -main () -{ -return libfdata_list_get_element_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_element_at_offset=yes -else - ac_cv_lib_fdata_libfdata_list_get_element_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_element_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_cache_element_value in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_cache_element_value in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_cache_element_value+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_cache_element_value (); -int -main () -{ -return libfdata_list_cache_element_value (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_cache_element_value=yes -else - ac_cv_lib_fdata_libfdata_list_cache_element_value=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_cache_element_value" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_cache_element_value" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_cache_element_value" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_value_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_element_value_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_element_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_element_value_by_index (); -int -main () -{ -return libfdata_list_get_element_value_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_element_value_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_get_element_value_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_value_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_value_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_element_value_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_element_value_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_element_value_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_element_value_at_offset (); -int -main () -{ -return libfdata_list_get_element_value_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset=yes -else - ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_element_value_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_value_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_set_element_value_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_set_element_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_set_element_value_by_index (); -int -main () -{ -return libfdata_list_set_element_value_by_index (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_set_element_value_by_index=yes -else - ac_cv_lib_fdata_libfdata_list_set_element_value_by_index=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_value_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_value_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_set_element_value_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_set_element_value_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_set_element_value_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_set_element_value_at_offset (); -int -main () -{ -return libfdata_list_set_element_value_at_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset=yes -else - ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_set_element_value_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_get_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_get_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_get_size (); -int -main () -{ -return libfdata_list_get_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_get_size=yes -else - ac_cv_lib_fdata_libfdata_list_get_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_get_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_get_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_get_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_get_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_get_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_get_mapped_size (); -int -main () -{ -return libfdata_list_element_get_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_set_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_set_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_set_mapped_size (); -int -main () -{ -return libfdata_list_element_set_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_element_value in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_get_element_value in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_get_element_value+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_get_element_value (); -int -main () -{ -return libfdata_list_element_get_element_value (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_get_element_value=yes -else - ac_cv_lib_fdata_libfdata_list_element_get_element_value=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_get_element_value" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_element_value in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_set_element_value in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_set_element_value+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_set_element_value (); -int -main () -{ -return libfdata_list_element_set_element_value (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_set_element_value=yes -else - ac_cv_lib_fdata_libfdata_list_element_set_element_value=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_set_element_value" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_get_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_get_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_get_mapped_size (); -int -main () -{ -return libfdata_list_element_get_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_element_get_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_get_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_set_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_set_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_set_mapped_size (); -int -main () -{ -return libfdata_list_element_set_mapped_size (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_list_element_set_mapped_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_set_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_get_element_value in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_get_element_value in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_get_element_value+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_get_element_value (); -int -main () -{ -return libfdata_list_element_get_element_value (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_get_element_value=yes +if test -n "$libfcache_LIBS"; then + pkg_cv_libfcache_LIBS="$libfcache_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfcache >= 20191109\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libfcache >= 20191109") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_libfcache_LIBS=`$PKG_CONFIG --libs "libfcache >= 20191109" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - ac_cv_lib_fdata_libfdata_list_element_get_element_value=no + pkg_failed=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + else + pkg_failed=untried fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_get_element_value" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_get_element_value" = xyes; then : - ac_cv_libfdata_dummy=yes + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - ac_cv_libfdata=no + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + libfcache_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfcache >= 20191109" 2>&1` + else + libfcache_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfcache >= 20191109" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$libfcache_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_list_element_set_element_value in -lfdata" >&5 -$as_echo_n "checking for libfdata_list_element_set_element_value in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_list_element_set_element_value+:} false; then : - $as_echo_n "(cached) " >&6 + ac_cv_libfcache=check +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libfcache=check else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + libfcache_CFLAGS=$pkg_cv_libfcache_CFLAGS + libfcache_LIBS=$pkg_cv_libfcache_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libfcache=yes +fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_list_element_set_element_value (); -int -main () -{ -return libfdata_list_element_set_element_value (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_list_element_set_element_value=yes -else - ac_cv_lib_fdata_libfdata_list_element_set_element_value=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + if test "x$ac_cv_libfcache" = xyes +then : + ac_cv_libfcache_CPPFLAGS="$pkg_cv_libfcache_CFLAGS" + ac_cv_libfcache_LIBADD="$pkg_cv_libfcache_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_list_element_set_element_value" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_list_element_set_element_value" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no + +fi + + if test "x$ac_cv_libfcache" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libfcache.h" "ac_cv_header_libfcache_h" "$ac_includes_default" +if test "x$ac_cv_header_libfcache_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBFCACHE_H 1" >>confdefs.h + fi + if test "x$ac_cv_header_libfcache_h" = xno +then : + ac_cv_libfcache=no +else $as_nop + ac_cv_libfcache=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_initialize in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_initialize in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_get_version in -lfcache" >&5 +printf %s "checking for libfcache_get_version in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_initialize (); +char libfcache_get_version (); int -main () +main (void) { -return libfdata_stream_initialize (); +return libfcache_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_initialize=yes -else - ac_cv_lib_fdata_libfdata_stream_initialize=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_get_version=yes +else $as_nop + ac_cv_lib_fcache_libfcache_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_initialize" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_initialize" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_initialize" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_get_version" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_get_version" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_get_version" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_free in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_free in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_initialize in -lfcache" >&5 +printf %s "checking for libfcache_cache_initialize in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_free (); +char libfcache_cache_initialize (); int -main () +main (void) { -return libfdata_stream_free (); +return libfcache_cache_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_free=yes -else - ac_cv_lib_fdata_libfdata_stream_free=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_initialize=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_free" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_free" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_free" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_initialize" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_initialize" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_clone in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_clone in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_free in -lfcache" >&5 +printf %s "checking for libfcache_cache_free in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_clone (); +char libfcache_cache_free (); int -main () +main (void) { -return libfdata_stream_clone (); +return libfcache_cache_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_clone=yes -else - ac_cv_lib_fdata_libfdata_stream_clone=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_free=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_clone" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_clone" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_clone" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_free" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_free" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_free" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_empty in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_empty in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_empty+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clone in -lfcache" >&5 +printf %s "checking for libfcache_cache_clone in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_empty (); +char libfcache_cache_clone (); int -main () +main (void) { -return libfdata_stream_empty (); +return libfcache_cache_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_empty=yes -else - ac_cv_lib_fdata_libfdata_stream_empty=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_clone=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_empty" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_empty" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_empty" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clone" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_clone" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_clone" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_resize in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_resize in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_resize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clear in -lfcache" >&5 +printf %s "checking for libfcache_cache_clear in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_clear+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_resize (); +char libfcache_cache_clear (); int -main () +main (void) { -return libfdata_stream_resize (); +return libfcache_cache_clear (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_resize=yes -else - ac_cv_lib_fdata_libfdata_stream_resize=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_clear=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_clear=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_resize" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_resize" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_resize" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clear" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_clear" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_clear" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_reverse in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_reverse in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_reverse+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_number_of_entries in -lfcache" >&5 +printf %s "checking for libfcache_cache_get_number_of_entries in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_get_number_of_entries+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_reverse (); +char libfcache_cache_get_number_of_entries (); int -main () +main (void) { -return libfdata_stream_reverse (); +return libfcache_cache_get_number_of_entries (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_reverse=yes -else - ac_cv_lib_fdata_libfdata_stream_reverse=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_get_number_of_entries=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_get_number_of_entries=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_reverse" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_reverse" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_reverse" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_get_number_of_entries" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_number_of_segments in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_number_of_segments in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_number_of_segments+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_number_of_cache_values in -lfcache" >&5 +printf %s "checking for libfcache_cache_get_number_of_cache_values in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_number_of_segments (); +char libfcache_cache_get_number_of_cache_values (); int -main () +main (void) { -return libfdata_stream_get_number_of_segments (); +return libfcache_cache_get_number_of_cache_values (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_number_of_segments=yes -else - ac_cv_lib_fdata_libfdata_stream_get_number_of_segments=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_number_of_segments" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_number_of_segments" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_number_of_segments" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_get_number_of_cache_values" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_segment_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_clear_value_by_index in -lfcache" >&5 +printf %s "checking for libfcache_cache_clear_value_by_index in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_clear_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_segment_by_index (); +char libfcache_cache_clear_value_by_index (); int -main () +main (void) { -return libfdata_stream_get_segment_by_index (); +return libfcache_cache_clear_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_segment_by_index=yes -else - ac_cv_lib_fdata_libfdata_stream_get_segment_by_index=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_clear_value_by_index=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_clear_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_clear_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_clear_value_by_index" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_clear_value_by_index" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_set_segment_by_index in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_set_segment_by_index in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_set_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_value_by_identifier in -lfcache" >&5 +printf %s "checking for libfcache_cache_get_value_by_identifier in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_set_segment_by_index (); +char libfcache_cache_get_value_by_identifier (); int -main () +main (void) { -return libfdata_stream_set_segment_by_index (); +return libfcache_cache_get_value_by_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_set_segment_by_index=yes -else - ac_cv_lib_fdata_libfdata_stream_set_segment_by_index=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_set_segment_by_index" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_set_segment_by_index" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_set_segment_by_index" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_get_value_by_identifier" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_prepend_segment in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_prepend_segment in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_prepend_segment+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_get_value_by_index in -lfcache" >&5 +printf %s "checking for libfcache_cache_get_value_by_index in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_get_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_prepend_segment (); +char libfcache_cache_get_value_by_index (); int -main () +main (void) { -return libfdata_stream_prepend_segment (); +return libfcache_cache_get_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_prepend_segment=yes -else - ac_cv_lib_fdata_libfdata_stream_prepend_segment=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_get_value_by_index=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_get_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_prepend_segment" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_prepend_segment" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_prepend_segment" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_get_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_get_value_by_index" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_get_value_by_index" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_append_segment in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_append_segment in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_append_segment+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_set_value_by_identifier in -lfcache" >&5 +printf %s "checking for libfcache_cache_set_value_by_identifier in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_append_segment (); +char libfcache_cache_set_value_by_identifier (); int -main () +main (void) { -return libfdata_stream_append_segment (); +return libfcache_cache_set_value_by_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_append_segment=yes -else - ac_cv_lib_fdata_libfdata_stream_append_segment=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_append_segment" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_append_segment" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_append_segment" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_set_value_by_identifier" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_set_mapped_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_set_mapped_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_set_mapped_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_set_value_by_index in -lfcache" >&5 +printf %s "checking for libfcache_cache_set_value_by_index in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_set_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_set_mapped_size (); +char libfcache_cache_set_value_by_index (); int -main () +main (void) { -return libfdata_stream_set_mapped_size (); +return libfcache_cache_set_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_set_mapped_size=yes -else - ac_cv_lib_fdata_libfdata_stream_set_mapped_size=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_set_value_by_index=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_set_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_set_mapped_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_set_mapped_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_set_mapped_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_set_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_set_value_by_index" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_set_value_by_index" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_mapped_range in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_segment_mapped_range in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_free in -lfcache" >&5 +printf %s "checking for libfcache_cache_value_free in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_value_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_segment_mapped_range (); +char libfcache_cache_value_free (); int -main () +main (void) { -return libfdata_stream_get_segment_mapped_range (); +return libfcache_cache_value_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range=yes -else - ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_value_free=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_value_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_mapped_range" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_free" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_value_free" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_value_free" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_index_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_segment_index_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_clear in -lfcache" >&5 +printf %s "checking for libfcache_cache_value_clear in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_value_clear+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_segment_index_at_offset (); +char libfcache_cache_value_clear (); int -main () +main (void) { -return libfdata_stream_get_segment_index_at_offset (); +return libfcache_cache_value_clear (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset=yes -else - ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_value_clear=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_value_clear=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_index_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_clear" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_value_clear" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_value_clear" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_segment_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_segment_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_get_identifier in -lfcache" >&5 +printf %s "checking for libfcache_cache_value_get_identifier in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_value_get_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_segment_at_offset (); +char libfcache_cache_value_get_identifier (); int -main () +main (void) { -return libfdata_stream_get_segment_at_offset (); +return libfcache_cache_value_get_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset=yes -else - ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_value_get_identifier=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_value_get_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_segment_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_get_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_value_get_identifier" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_value_get_identifier" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_read_buffer in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_read_buffer in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_read_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_set_identifier in -lfcache" >&5 +printf %s "checking for libfcache_cache_value_set_identifier in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_value_set_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_read_buffer (); +char libfcache_cache_value_set_identifier (); int -main () +main (void) { -return libfdata_stream_read_buffer (); +return libfcache_cache_value_set_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_read_buffer=yes -else - ac_cv_lib_fdata_libfdata_stream_read_buffer=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_value_set_identifier=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_value_set_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_read_buffer" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_read_buffer" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_read_buffer" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_set_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_value_set_identifier" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_value_set_identifier" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_read_buffer_at_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_read_buffer_at_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_get_value in -lfcache" >&5 +printf %s "checking for libfcache_cache_value_get_value in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_value_get_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_read_buffer_at_offset (); +char libfcache_cache_value_get_value (); int -main () +main (void) { -return libfdata_stream_read_buffer_at_offset (); +return libfcache_cache_value_get_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset=yes -else - ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_value_get_value=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_value_get_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_read_buffer_at_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_get_value" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_value_get_value" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_value_get_value" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_write_buffer in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_write_buffer in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_write_buffer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_cache_value_set_value in -lfcache" >&5 +printf %s "checking for libfcache_cache_value_set_value in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_cache_value_set_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_write_buffer (); +char libfcache_cache_value_set_value (); int -main () +main (void) { -return libfdata_stream_write_buffer (); +return libfcache_cache_value_set_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_write_buffer=yes -else - ac_cv_lib_fdata_libfdata_stream_write_buffer=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_cache_value_set_value=yes +else $as_nop + ac_cv_lib_fcache_libfcache_cache_value_set_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_write_buffer" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_write_buffer" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_write_buffer" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_cache_value_set_value" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_cache_value_set_value" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_cache_value_set_value" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_seek_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_seek_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_seek_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfcache_date_time_get_timestamp in -lfcache" >&5 +printf %s "checking for libfcache_date_time_get_timestamp in -lfcache... " >&6; } +if test ${ac_cv_lib_fcache_libfcache_date_time_get_timestamp+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" +LIBS="-lfcache $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_seek_offset (); +char libfcache_date_time_get_timestamp (); int -main () +main (void) { -return libfdata_stream_seek_offset (); +return libfcache_date_time_get_timestamp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_seek_offset=yes -else - ac_cv_lib_fdata_libfdata_stream_seek_offset=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fcache_libfcache_date_time_get_timestamp=yes +else $as_nop + ac_cv_lib_fcache_libfcache_date_time_get_timestamp=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_seek_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_seek_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_seek_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fcache_libfcache_date_time_get_timestamp" >&5 +printf "%s\n" "$ac_cv_lib_fcache_libfcache_date_time_get_timestamp" >&6; } +if test "x$ac_cv_lib_fcache_libfcache_date_time_get_timestamp" = xyes +then : + ac_cv_libfcache_dummy=yes +else $as_nop + ac_cv_libfcache=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_offset in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_offset in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_offset+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_offset (); -int -main () -{ -return libfdata_stream_get_offset (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_offset=yes -else - ac_cv_lib_fdata_libfdata_stream_get_offset=no + ac_cv_libfcache_LIBADD="-lfcache" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_offset" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_offset" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_offset" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no + if test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect && test "x$ac_cv_libfcache" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 1 "unable to find supported libfcache in directory: $ac_cv_with_libfcache +See \`config.log' for more details" "$LINENO" 5; } + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdata_stream_get_size in -lfdata" >&5 -$as_echo_n "checking for libfdata_stream_get_size in -lfdata... " >&6; } -if ${ac_cv_lib_fdata_libfdata_stream_get_size+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfdata $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi + + if test "x$ac_cv_libfcache" = xyes +then : + +printf "%s\n" "#define HAVE_LIBFCACHE 1" >>confdefs.h + + +fi + + if test "x$ac_cv_libfcache" = xyes +then : + HAVE_LIBFCACHE=1 + +else $as_nop + HAVE_LIBFCACHE=0 + + +fi + + + if test "x$ac_cv_libfcache" != xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libfdata_stream_get_size (); int -main () +main (void) { -return libfdata_stream_get_size (); +struct tm tm; + int *p = &tm.tm_sec; + return !p; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_fdata_libfdata_stream_get_size=yes -else - ac_cv_lib_fdata_libfdata_stream_get_size=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_struct_tm=time.h +else $as_nop + ac_cv_struct_tm=sys/time.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdata_libfdata_stream_get_size" >&5 -$as_echo "$ac_cv_lib_fdata_libfdata_stream_get_size" >&6; } -if test "x$ac_cv_lib_fdata_libfdata_stream_get_size" = xyes; then : - ac_cv_libfdata_dummy=yes -else - ac_cv_libfdata=no +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h - - - ac_cv_libfdata_LIBADD="-lfdata" fi -fi - if test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect && test "x$ac_cv_libfdata" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 1 "unable to find supported libfdata in directory: $ac_cv_with_libfdata -See \`config.log' for more details" "$LINENO" 5; } -fi + ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi - if test "x$ac_cv_libfdata" = xyes; then : - -$as_echo "#define HAVE_LIBFDATA 1" >>confdefs.h + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "time" "ac_cv_func_time" +if test "x$ac_cv_func_time" = xyes +then : + printf "%s\n" "#define HAVE_TIME 1" >>confdefs.h - if test "x$ac_cv_libfdata" = xyes; then : - HAVE_LIBFDATA=1 +fi -else - HAVE_LIBFDATA=0 + if test "x$ac_cv_func_time" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 1 "Missing function: time +See \`config.log' for more details" "$LINENO" 5; } fi + ac_cv_libfcache_CPPFLAGS="-I../libfcache"; + ac_cv_libfcache_LIBADD="../libfcache/libfcache.la"; - if test "x$ac_cv_libfdata" != xyes; then : - - ac_cv_libfdata_CPPFLAGS="-I../libfdata"; - ac_cv_libfdata_LIBADD="../libfdata/libfdata.la"; - - ac_cv_libfdata=local + ac_cv_libfcache=local -$as_echo "#define HAVE_LOCAL_LIBFDATA 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBFCACHE 1" >>confdefs.h - HAVE_LOCAL_LIBFDATA=1 + HAVE_LOCAL_LIBFCACHE=1 fi - if test "x$ac_cv_libfdata" = xlocal; then - HAVE_LOCAL_LIBFDATA_TRUE= - HAVE_LOCAL_LIBFDATA_FALSE='#' + if test "x$ac_cv_libfcache" = xlocal; then + HAVE_LOCAL_LIBFCACHE_TRUE= + HAVE_LOCAL_LIBFCACHE_FALSE='#' else - HAVE_LOCAL_LIBFDATA_TRUE='#' - HAVE_LOCAL_LIBFDATA_FALSE= + HAVE_LOCAL_LIBFCACHE_TRUE='#' + HAVE_LOCAL_LIBFCACHE_FALSE= fi - if test "x$ac_cv_libfdata_CPPFLAGS" != "x"; then : - LIBFDATA_CPPFLAGS=$ac_cv_libfdata_CPPFLAGS + if test "x$ac_cv_libfcache_CPPFLAGS" != "x" +then : + LIBFCACHE_CPPFLAGS=$ac_cv_libfcache_CPPFLAGS fi - if test "x$ac_cv_libfdata_LIBADD" != "x"; then : - LIBFDATA_LIBADD=$ac_cv_libfdata_LIBADD + if test "x$ac_cv_libfcache_LIBADD" != "x" +then : + LIBFCACHE_LIBADD=$ac_cv_libfcache_LIBADD fi - if test "x$ac_cv_libfdata" = xyes; then : - ax_libfdata_pc_libs_private=-lfdata + if test "x$ac_cv_libfcache" = xyes +then : + ax_libfcache_pc_libs_private=-lfcache fi - if test "x$ac_cv_libfdata" = xyes; then : - ax_libfdata_spec_requires=libfdata + if test "x$ac_cv_libfcache" = xyes +then : + ax_libfcache_spec_requires=libfcache - ax_libfdata_spec_build_requires=libfdata-devel + ax_libfcache_spec_build_requires=libfcache-devel fi @@ -39983,52 +46658,59 @@ # Check whether --with-libfdatetime was given. -if test "${with_libfdatetime+set}" = set; then : +if test ${with_libfdatetime+y} +then : withval=$with_libfdatetime; ac_cv_with_libfdatetime=$withval -else +else $as_nop ac_cv_with_libfdatetime=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfdatetime in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libfdatetime in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libfdatetime+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfdatetime in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libfdatetime in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libfdatetime+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libfdatetime=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfdatetime" >&5 -$as_echo "$ac_cv_with_libfdatetime" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfdatetime" >&5 +printf "%s\n" "$ac_cv_with_libfdatetime" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdatetime" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdatetime" = xno +then : ac_cv_libfdatetime=no -else - if test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect; then : - if test -d "$ac_cv_with_libfdatetime"; then : +else $as_nop + ac_cv_libfdatetime=check + if test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect +then : + if test -d "$ac_cv_with_libfdatetime" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libfdatetime}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdatetime}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libfdatetime See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libfdatetime=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime" >&5 -$as_echo_n "checking for libfdatetime... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime >= 20180910" >&5 +printf %s "checking for libfdatetime >= 20180910... " >&6; } if test -n "$libfdatetime_CFLAGS"; then pkg_cv_libfdatetime_CFLAGS="$libfdatetime_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdatetime >= 20180910\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdatetime >= 20180910\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfdatetime >= 20180910") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfdatetime_CFLAGS=`$PKG_CONFIG --cflags "libfdatetime >= 20180910" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -40042,10 +46724,10 @@ pkg_cv_libfdatetime_LIBS="$libfdatetime_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdatetime >= 20180910\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfdatetime >= 20180910\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfdatetime >= 20180910") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfdatetime_LIBS=`$PKG_CONFIG --libs "libfdatetime >= 20180910" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -40059,8 +46741,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -40068,58 +46750,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libfdatetime_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfdatetime >= 20180910" 2>&1` + libfdatetime_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfdatetime >= 20180910" 2>&1` else - libfdatetime_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfdatetime >= 20180910" 2>&1` + libfdatetime_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfdatetime >= 20180910" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libfdatetime_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libfdatetime_PKG_ERRORS" >&5 - ac_cv_libfdatetime=check + ac_cv_libfdatetime=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libfdatetime=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libfdatetime=check else - libfdatetime_CFLAGS=$pkg_cv_libfdatetime_CFLAGS - libfdatetime_LIBS=$pkg_cv_libfdatetime_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libfdatetime=yes + libfdatetime_CFLAGS=$pkg_cv_libfdatetime_CFLAGS + libfdatetime_LIBS=$pkg_cv_libfdatetime_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libfdatetime=yes fi fi - if test "x$ac_cv_libfdatetime" = xyes; then : + if test "x$ac_cv_libfdatetime" = xyes +then : ac_cv_libfdatetime_CPPFLAGS="$pkg_cv_libfdatetime_CFLAGS" ac_cv_libfdatetime_LIBADD="$pkg_cv_libfdatetime_LIBS" fi fi - if test "x$ac_cv_libfdatetime" = xcheck; then : - for ac_header in libfdatetime.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libfdatetime.h" "ac_cv_header_libfdatetime_h" "$ac_includes_default" -if test "x$ac_cv_header_libfdatetime_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBFDATETIME_H 1 -_ACEOF + if test "x$ac_cv_libfdatetime" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libfdatetime.h" "ac_cv_header_libfdatetime_h" "$ac_includes_default" +if test "x$ac_cv_header_libfdatetime_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBFDATETIME_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libfdatetime_h" = xno; then : + if test "x$ac_cv_header_libfdatetime_h" = xno +then : ac_cv_libfdatetime=no -else +else $as_nop ac_cv_libfdatetime=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_get_version in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_get_version in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_get_version in -lfdatetime" >&5 +printf %s "checking for libfdatetime_get_version in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40128,41 +46809,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_get_version (); int -main () +main (void) { return libfdatetime_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_get_version=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_get_version" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_get_version" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_get_version" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_get_version" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_get_version" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40171,40 +46852,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_initialize (); int -main () +main (void) { return libfdatetime_fat_date_time_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40213,40 +46894,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_free (); int -main () +main (void) { return libfdatetime_fat_date_time_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40255,40 +46936,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_from_32bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_from_32bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_from_32bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_from_32bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40297,40 +46978,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_from_32bit (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_from_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_from_32bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_32bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_32bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_32bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_32bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40339,40 +47020,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_32bit (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_32bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40381,40 +47062,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40423,40 +47104,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40465,40 +47146,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40507,40 +47188,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40549,40 +47230,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_fat_date_time_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_fat_date_time_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_fat_date_time_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40591,41 +47272,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_fat_date_time_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_fat_date_time_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_fat_date_time_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40634,40 +47315,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_initialize (); int -main () +main (void) { return libfdatetime_filetime_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40676,40 +47357,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_free (); int -main () +main (void) { return libfdatetime_filetime_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40718,40 +47399,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_filetime_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_from_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_from_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_from_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_from_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40760,40 +47441,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_from_64bit (); int -main () +main (void) { return libfdatetime_filetime_copy_from_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_from_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40802,40 +47483,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_64bit (); int -main () +main (void) { return libfdatetime_filetime_copy_to_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40844,40 +47525,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_filetime_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40886,40 +47567,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_filetime_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40928,40 +47609,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_filetime_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -40970,40 +47651,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_filetime_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41012,40 +47693,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_filetime_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41054,40 +47735,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_filetime_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_add in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_filetime_add in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_filetime_add+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_filetime_add in -lfdatetime" >&5 +printf %s "checking for libfdatetime_filetime_add in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_filetime_add+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41096,41 +47777,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_filetime_add (); int -main () +main (void) { return libfdatetime_filetime_add (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_filetime_add=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_filetime_add=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_add" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_filetime_add" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_add" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_filetime_add" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_filetime_add" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_filetime_add" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41139,40 +47820,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_initialize (); int -main () +main (void) { return libfdatetime_floatingtime_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41181,40 +47862,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_free (); int -main () +main (void) { return libfdatetime_floatingtime_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41223,40 +47904,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_floatingtime_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_from_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_from_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_from_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_from_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41265,40 +47946,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_from_64bit (); int -main () +main (void) { return libfdatetime_floatingtime_copy_from_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_from_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41307,40 +47988,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_64bit (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41349,40 +48030,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41391,40 +48072,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41433,40 +48114,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41475,40 +48156,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41517,40 +48198,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_floatingtime_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_floatingtime_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_floatingtime_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41559,41 +48240,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_floatingtime_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_floatingtime_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_floatingtime_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41602,40 +48283,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_initialize (); int -main () +main (void) { return libfdatetime_hfs_time_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41644,40 +48325,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_free (); int -main () +main (void) { return libfdatetime_hfs_time_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41686,40 +48367,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_hfs_time_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_from_32bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_from_32bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_from_32bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_from_32bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41728,40 +48409,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_from_32bit (); int -main () +main (void) { return libfdatetime_hfs_time_copy_from_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_from_32bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_32bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_32bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_32bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_32bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41770,40 +48451,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_32bit (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_32bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41812,40 +48493,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41854,40 +48535,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41896,40 +48577,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41938,40 +48619,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -41980,40 +48661,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_hfs_time_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_hfs_time_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_hfs_time_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42022,41 +48703,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_hfs_time_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_hfs_time_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_hfs_time_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42065,40 +48746,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_initialize (); int -main () +main (void) { return libfdatetime_nsf_timedate_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42107,40 +48788,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_free (); int -main () +main (void) { return libfdatetime_nsf_timedate_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42149,40 +48830,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_from_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_from_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_from_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_from_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42191,40 +48872,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_from_64bit (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_from_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_from_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42233,40 +48914,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_64bit (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42275,40 +48956,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42317,40 +48998,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42359,40 +49040,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42401,40 +49082,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42443,40 +49124,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_nsf_timedate_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_nsf_timedate_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_nsf_timedate_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42485,41 +49166,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_nsf_timedate_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_nsf_timedate_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_nsf_timedate_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42528,40 +49209,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_initialize (); int -main () +main (void) { return libfdatetime_posix_time_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42570,40 +49251,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_free (); int -main () +main (void) { return libfdatetime_posix_time_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42612,40 +49293,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_posix_time_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_from_32bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_from_32bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_from_32bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_from_32bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42654,40 +49335,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_from_32bit (); int -main () +main (void) { return libfdatetime_posix_time_copy_from_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_32bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_32bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_32bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_32bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_32bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42696,40 +49377,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_32bit (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_32bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_from_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_from_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_from_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_from_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42738,40 +49419,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_from_64bit (); int -main () +main (void) { return libfdatetime_posix_time_copy_from_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_from_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_64bit in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_64bit in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_64bit in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_64bit in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42780,40 +49461,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_64bit (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_64bit" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42822,40 +49503,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42864,40 +49545,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42906,40 +49587,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42948,40 +49629,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -42990,40 +49671,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_posix_time_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_posix_time_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_posix_time_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43032,41 +49713,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_posix_time_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_posix_time_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_posix_time_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_initialize in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_initialize in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_initialize in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_initialize in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43075,40 +49756,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_initialize (); int -main () +main (void) { return libfdatetime_systemetime_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_initialize" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_free in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_free in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_free in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_free in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43117,40 +49798,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_free (); int -main () +main (void) { return libfdatetime_systemetime_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_free=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_free" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_free" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_free" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_free" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_free" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_from_byte_stream in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_from_byte_stream in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_from_byte_stream in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_from_byte_stream in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43159,40 +49840,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_from_byte_stream (); int -main () +main (void) { return libfdatetime_systemetime_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_from_byte_stream" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf8_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_to_utf8_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf8_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_to_utf8_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43201,40 +49882,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_to_utf8_string (); int -main () +main (void) { return libfdatetime_systemetime_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf8_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf8_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_to_utf8_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43243,40 +49924,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfdatetime_systemetime_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf16_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_to_utf16_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf16_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_to_utf16_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43285,40 +49966,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_to_utf16_string (); int -main () +main (void) { return libfdatetime_systemetime_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf16_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf16_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_to_utf16_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43327,40 +50008,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfdatetime_systemetime_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf32_string in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_to_utf32_string in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf32_string in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_to_utf32_string in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43369,40 +50050,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_to_utf32_string (); int -main () +main (void) { return libfdatetime_systemetime_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf32_string_with_index in -lfdatetime" >&5 -$as_echo_n "checking for libfdatetime_systemetime_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } -if ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfdatetime_systemetime_copy_to_utf32_string_with_index in -lfdatetime" >&5 +printf %s "checking for libfdatetime_systemetime_copy_to_utf32_string_with_index in -lfdatetime... " >&6; } +if test ${ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfdatetime $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43411,32 +50092,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfdatetime_systemetime_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfdatetime_systemetime_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fdatetime_libfdatetime_systemetime_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfdatetime_dummy=yes -else +else $as_nop ac_cv_libfdatetime=no fi @@ -43445,9 +50125,10 @@ fi fi - if test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect && test "x$ac_cv_libfdatetime" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect && test "x$ac_cv_libfdatetime" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libfdatetime in directory: $ac_cv_with_libfdatetime See \`config.log' for more details" "$LINENO" 5; } @@ -43455,24 +50136,27 @@ fi - if test "x$ac_cv_libfdatetime" = xyes; then : + if test "x$ac_cv_libfdatetime" = xyes +then : -$as_echo "#define HAVE_LIBFDATETIME 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBFDATETIME 1" >>confdefs.h fi - if test "x$ac_cv_libfdatetime" = xyes; then : + if test "x$ac_cv_libfdatetime" = xyes +then : HAVE_LIBFDATETIME=1 -else +else $as_nop HAVE_LIBFDATETIME=0 fi - if test "x$ac_cv_libfdatetime" != xyes; then : + if test "x$ac_cv_libfdatetime" != xyes +then : ac_cv_libfdatetime_CPPFLAGS="-I../libfdatetime"; ac_cv_libfdatetime_LIBADD="../libfdatetime/libfdatetime.la"; @@ -43481,7 +50165,7 @@ -$as_echo "#define HAVE_LOCAL_LIBFDATETIME 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBFDATETIME 1" >>confdefs.h HAVE_LOCAL_LIBFDATETIME=1 @@ -43496,24 +50180,28 @@ HAVE_LOCAL_LIBFDATETIME_FALSE= fi - if test "x$ac_cv_libfdatetime_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libfdatetime_CPPFLAGS" != "x" +then : LIBFDATETIME_CPPFLAGS=$ac_cv_libfdatetime_CPPFLAGS fi - if test "x$ac_cv_libfdatetime_LIBADD" != "x"; then : + if test "x$ac_cv_libfdatetime_LIBADD" != "x" +then : LIBFDATETIME_LIBADD=$ac_cv_libfdatetime_LIBADD fi - if test "x$ac_cv_libfdatetime" = xyes; then : + if test "x$ac_cv_libfdatetime" = xyes +then : ax_libfdatetime_pc_libs_private=-lfdatetime fi - if test "x$ac_cv_libfdatetime" = xyes; then : + if test "x$ac_cv_libfdatetime" = xyes +then : ax_libfdatetime_spec_requires=libfdatetime ax_libfdatetime_spec_build_requires=libfdatetime-devel @@ -43525,52 +50213,59 @@ # Check whether --with-libfguid was given. -if test "${with_libfguid+set}" = set; then : +if test ${with_libfguid+y} +then : withval=$with_libfguid; ac_cv_with_libfguid=$withval -else +else $as_nop ac_cv_with_libfguid=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfguid in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libfguid in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libfguid+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfguid in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libfguid in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libfguid+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libfguid=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfguid" >&5 -$as_echo "$ac_cv_with_libfguid" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfguid" >&5 +printf "%s\n" "$ac_cv_with_libfguid" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfguid" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfguid" = xno +then : ac_cv_libfguid=no -else - if test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect; then : - if test -d "$ac_cv_with_libfguid"; then : +else $as_nop + ac_cv_libfguid=check + if test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect +then : + if test -d "$ac_cv_with_libfguid" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libfguid}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfguid}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libfguid See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libfguid=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid" >&5 -$as_echo_n "checking for libfguid... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid >= 20120426" >&5 +printf %s "checking for libfguid >= 20120426... " >&6; } if test -n "$libfguid_CFLAGS"; then pkg_cv_libfguid_CFLAGS="$libfguid_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfguid >= 20120426\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfguid >= 20120426\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfguid >= 20120426") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfguid_CFLAGS=`$PKG_CONFIG --cflags "libfguid >= 20120426" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -43584,10 +50279,10 @@ pkg_cv_libfguid_LIBS="$libfguid_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfguid >= 20120426\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfguid >= 20120426\""; } >&5 ($PKG_CONFIG --exists --print-errors "libfguid >= 20120426") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libfguid_LIBS=`$PKG_CONFIG --libs "libfguid >= 20120426" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -43601,8 +50296,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -43610,58 +50305,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libfguid_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfguid >= 20120426" 2>&1` + libfguid_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfguid >= 20120426" 2>&1` else - libfguid_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfguid >= 20120426" 2>&1` + libfguid_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfguid >= 20120426" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libfguid_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libfguid_PKG_ERRORS" >&5 - ac_cv_libfguid=check + ac_cv_libfguid=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libfguid=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libfguid=check else - libfguid_CFLAGS=$pkg_cv_libfguid_CFLAGS - libfguid_LIBS=$pkg_cv_libfguid_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libfguid=yes + libfguid_CFLAGS=$pkg_cv_libfguid_CFLAGS + libfguid_LIBS=$pkg_cv_libfguid_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libfguid=yes fi fi - if test "x$ac_cv_libfguid" = xyes; then : + if test "x$ac_cv_libfguid" = xyes +then : ac_cv_libfguid_CPPFLAGS="$pkg_cv_libfguid_CFLAGS" ac_cv_libfguid_LIBADD="$pkg_cv_libfguid_LIBS" fi fi - if test "x$ac_cv_libfguid" = xcheck; then : - for ac_header in libfguid.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libfguid.h" "ac_cv_header_libfguid_h" "$ac_includes_default" -if test "x$ac_cv_header_libfguid_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBFGUID_H 1 -_ACEOF + if test "x$ac_cv_libfguid" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libfguid.h" "ac_cv_header_libfguid_h" "$ac_includes_default" +if test "x$ac_cv_header_libfguid_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBFGUID_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libfguid_h" = xno; then : + if test "x$ac_cv_header_libfguid_h" = xno +then : ac_cv_libfguid=no -else +else $as_nop ac_cv_libfguid=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_get_version in -lfguid" >&5 -$as_echo_n "checking for libfguid_get_version in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_get_version in -lfguid" >&5 +printf %s "checking for libfguid_get_version in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43670,41 +50364,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_get_version (); int -main () +main (void) { return libfguid_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_get_version=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_get_version" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_get_version" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_get_version" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_get_version" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_get_version" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_initialize in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_initialize in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_initialize in -lfguid" >&5 +printf %s "checking for libfguid_identifier_initialize in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43713,40 +50407,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_initialize (); int -main () +main (void) { return libfguid_identifier_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_initialize=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_initialize" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_initialize" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_initialize" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_initialize" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_free in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_free in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_free in -lfguid" >&5 +printf %s "checking for libfguid_identifier_free in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43755,40 +50449,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_free (); int -main () +main (void) { return libfguid_identifier_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_free=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_free" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_free" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_free" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_free" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_free" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_from_byte_stream in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_from_byte_stream in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_from_byte_stream in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_from_byte_stream in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43797,40 +50491,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_from_byte_stream (); int -main () +main (void) { return libfguid_identifier_copy_from_byte_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_from_byte_stream" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_get_string_size in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_get_string_size in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_get_string_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_get_string_size in -lfguid" >&5 +printf %s "checking for libfguid_identifier_get_string_size in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_get_string_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43839,40 +50533,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_get_string_size (); int -main () +main (void) { return libfguid_identifier_get_string_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_get_string_size=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_get_string_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_get_string_size" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_get_string_size" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_get_string_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_get_string_size" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_get_string_size" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_get_string_size" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf8_string in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_to_utf8_string in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf8_string in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_to_utf8_string in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43881,40 +50575,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_to_utf8_string (); int -main () +main (void) { return libfguid_identifier_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf8_string_with_index in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_to_utf8_string_with_index in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf8_string_with_index in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_to_utf8_string_with_index in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43923,40 +50617,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfguid_identifier_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf16_string in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_to_utf16_string in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf16_string in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_to_utf16_string in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -43965,40 +50659,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_to_utf16_string (); int -main () +main (void) { return libfguid_identifier_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf16_string_with_index in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_to_utf16_string_with_index in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf16_string_with_index in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_to_utf16_string_with_index in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44007,40 +50701,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfguid_identifier_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf32_string in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_to_utf32_string in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf32_string in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_to_utf32_string in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44049,40 +50743,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_to_utf32_string (); int -main () +main (void) { return libfguid_identifier_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf32_string_with_index in -lfguid" >&5 -$as_echo_n "checking for libfguid_identifier_copy_to_utf32_string_with_index in -lfguid... " >&6; } -if ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfguid_identifier_copy_to_utf32_string_with_index in -lfguid" >&5 +printf %s "checking for libfguid_identifier_copy_to_utf32_string_with_index in -lfguid... " >&6; } +if test ${ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfguid $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44091,32 +50785,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfguid_identifier_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfguid_identifier_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fguid_libfguid_identifier_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfguid_dummy=yes -else +else $as_nop ac_cv_libfguid=no fi @@ -44125,9 +50818,10 @@ fi fi - if test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect && test "x$ac_cv_libfguid" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect && test "x$ac_cv_libfguid" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libfguid in directory: $ac_cv_with_libfguid See \`config.log' for more details" "$LINENO" 5; } @@ -44135,24 +50829,27 @@ fi - if test "x$ac_cv_libfguid" = xyes; then : + if test "x$ac_cv_libfguid" = xyes +then : -$as_echo "#define HAVE_LIBFGUID 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBFGUID 1" >>confdefs.h fi - if test "x$ac_cv_libfguid" = xyes; then : + if test "x$ac_cv_libfguid" = xyes +then : HAVE_LIBFGUID=1 -else +else $as_nop HAVE_LIBFGUID=0 fi - if test "x$ac_cv_libfguid" != xyes; then : + if test "x$ac_cv_libfguid" != xyes +then : ac_cv_libfguid_CPPFLAGS="-I../libfguid"; ac_cv_libfguid_LIBADD="../libfguid/libfguid.la"; @@ -44161,7 +50858,7 @@ -$as_echo "#define HAVE_LOCAL_LIBFGUID 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBFGUID 1" >>confdefs.h HAVE_LOCAL_LIBFGUID=1 @@ -44176,24 +50873,28 @@ HAVE_LOCAL_LIBFGUID_FALSE= fi - if test "x$ac_cv_libfguid_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libfguid_CPPFLAGS" != "x" +then : LIBFGUID_CPPFLAGS=$ac_cv_libfguid_CPPFLAGS fi - if test "x$ac_cv_libfguid_LIBADD" != "x"; then : + if test "x$ac_cv_libfguid_LIBADD" != "x" +then : LIBFGUID_LIBADD=$ac_cv_libfguid_LIBADD fi - if test "x$ac_cv_libfguid" = xyes; then : + if test "x$ac_cv_libfguid" = xyes +then : ax_libfguid_pc_libs_private=-lfguid fi - if test "x$ac_cv_libfguid" = xyes; then : + if test "x$ac_cv_libfguid" = xyes +then : ax_libfguid_spec_requires=libfguid ax_libfguid_spec_build_requires=libfguid-devel @@ -44205,54 +50906,61 @@ # Check whether --with-libfvalue was given. -if test "${with_libfvalue+set}" = set; then : +if test ${with_libfvalue+y} +then : withval=$with_libfvalue; ac_cv_with_libfvalue=$withval -else +else $as_nop ac_cv_with_libfvalue=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libfvalue+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libfvalue in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libfvalue+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libfvalue=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfvalue" >&5 -$as_echo "$ac_cv_with_libfvalue" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfvalue" >&5 +printf "%s\n" "$ac_cv_with_libfvalue" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfvalue" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfvalue" = xno +then : ac_cv_libfvalue=no -else - if test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect; then : - if test -d "$ac_cv_with_libfvalue"; then : +else $as_nop + ac_cv_libfvalue=check + if test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect +then : + if test -d "$ac_cv_with_libfvalue" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libfvalue}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfvalue}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libfvalue See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libfvalue=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue" >&5 -$as_echo_n "checking for libfvalue... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue >= 20200711" >&5 +printf %s "checking for libfvalue >= 20200711... " >&6; } if test -n "$libfvalue_CFLAGS"; then pkg_cv_libfvalue_CFLAGS="$libfvalue_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfvalue >= 20160131\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libfvalue >= 20160131") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfvalue >= 20200711\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libfvalue >= 20200711") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libfvalue_CFLAGS=`$PKG_CONFIG --cflags "libfvalue >= 20160131" 2>/dev/null` + pkg_cv_libfvalue_CFLAGS=`$PKG_CONFIG --cflags "libfvalue >= 20200711" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -44264,12 +50972,12 @@ pkg_cv_libfvalue_LIBS="$libfvalue_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfvalue >= 20160131\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libfvalue >= 20160131") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfvalue >= 20200711\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libfvalue >= 20200711") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libfvalue_LIBS=`$PKG_CONFIG --libs "libfvalue >= 20160131" 2>/dev/null` + pkg_cv_libfvalue_LIBS=`$PKG_CONFIG --libs "libfvalue >= 20200711" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -44281,8 +50989,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -44290,58 +50998,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libfvalue_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfvalue >= 20160131" 2>&1` + libfvalue_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfvalue >= 20200711" 2>&1` else - libfvalue_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfvalue >= 20160131" 2>&1` + libfvalue_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfvalue >= 20200711" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libfvalue_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libfvalue_PKG_ERRORS" >&5 - ac_cv_libfvalue=check + ac_cv_libfvalue=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libfvalue=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libfvalue=check else - libfvalue_CFLAGS=$pkg_cv_libfvalue_CFLAGS - libfvalue_LIBS=$pkg_cv_libfvalue_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libfvalue=yes + libfvalue_CFLAGS=$pkg_cv_libfvalue_CFLAGS + libfvalue_LIBS=$pkg_cv_libfvalue_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libfvalue=yes fi fi - if test "x$ac_cv_libfvalue" = xyes; then : + if test "x$ac_cv_libfvalue" = xyes +then : ac_cv_libfvalue_CPPFLAGS="$pkg_cv_libfvalue_CFLAGS" ac_cv_libfvalue_LIBADD="$pkg_cv_libfvalue_LIBS" fi fi - if test "x$ac_cv_libfvalue" = xcheck; then : - for ac_header in libfvalue.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libfvalue.h" "ac_cv_header_libfvalue_h" "$ac_includes_default" -if test "x$ac_cv_header_libfvalue_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBFVALUE_H 1 -_ACEOF + if test "x$ac_cv_libfvalue" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libfvalue.h" "ac_cv_header_libfvalue_h" "$ac_includes_default" +if test "x$ac_cv_header_libfvalue_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBFVALUE_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libfvalue_h" = xno; then : + if test "x$ac_cv_header_libfvalue_h" = xno +then : ac_cv_libfvalue=no -else +else $as_nop ac_cv_libfvalue=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_get_version in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_get_version in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_get_version in -lfvalue" >&5 +printf %s "checking for libfvalue_get_version in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44350,41 +51057,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_get_version (); int -main () +main (void) { return libfvalue_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_get_version=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_get_version" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_get_version" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_get_version" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_get_version" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_get_version" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_initialize in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_initialize in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_initialize in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_initialize in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44393,40 +51100,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_initialize (); int -main () +main (void) { return libfvalue_data_handle_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_initialize=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_initialize" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_initialize" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_initialize" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_initialize" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_free in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_free in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_free in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_free in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44435,40 +51142,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_free (); int -main () +main (void) { return libfvalue_data_handle_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_free=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_free" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_free" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_free" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_free" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_free" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_clone in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_clone in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_clone in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_clone in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44477,40 +51184,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_clone (); int -main () +main (void) { return libfvalue_data_handle_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_clone=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_clone" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_clone" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_clone" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_clone" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_clone" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_clear in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_clear in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_clear+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_clear in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_clear in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_clear+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44519,41 +51226,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_clear (); int -main () +main (void) { return libfvalue_data_handle_clear (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_clear=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_clear=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_clear" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_clear" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_clear" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_clear" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_clear" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_clear" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_data in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_get_data in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_data in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_get_data in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_get_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44562,40 +51269,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_get_data (); int -main () +main (void) { return libfvalue_data_handle_get_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_get_data=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_get_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_data" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_data" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_data" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_get_data" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_data" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_data in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_set_data in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_set_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_data in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_set_data in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_set_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44604,41 +51311,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_set_data (); int -main () +main (void) { return libfvalue_data_handle_set_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_set_data=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_set_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_data" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_set_data" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_data" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_set_data" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_data" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_data_flags in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_get_data_flags in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_data_flags in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_get_data_flags in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44647,40 +51354,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_get_data_flags (); int -main () +main (void) { return libfvalue_data_handle_get_data_flags (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_data_flags" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_data_flags in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_set_data_flags in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_data_flags in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_set_data_flags in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44689,41 +51396,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_set_data_flags (); int -main () +main (void) { return libfvalue_data_handle_set_data_flags (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_data_flags" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_number_of_value_entries in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_get_number_of_value_entries in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_number_of_value_entries in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_get_number_of_value_entries in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44732,40 +51439,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_get_number_of_value_entries (); int -main () +main (void) { return libfvalue_data_handle_get_number_of_value_entries (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_number_of_value_entries" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_value_entry in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_get_value_entry in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_get_value_entry in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_get_value_entry in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44774,40 +51481,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_get_value_entry (); int -main () +main (void) { return libfvalue_data_handle_get_value_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_get_value_entry" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_value_entry in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_set_value_entry in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_set_value_entry in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_set_value_entry in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44816,40 +51523,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_set_value_entry (); int -main () +main (void) { return libfvalue_data_handle_set_value_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_set_value_entry" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_append_value_entry in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_data_handle_append_value_entry in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_data_handle_append_value_entry in -lfvalue" >&5 +printf %s "checking for libfvalue_data_handle_append_value_entry in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44858,41 +51565,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_data_handle_append_value_entry (); int -main () +main (void) { return libfvalue_data_handle_append_value_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_data_handle_append_value_entry" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_string_size_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_string_size_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_string_size_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_string_size_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_string_size_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_string_size_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44901,41 +51608,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_string_size_from_integer (); int -main () +main (void) { return libfvalue_string_size_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_string_size_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_string_size_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_string_size_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_string_size_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_string_size_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_string_size_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_string_size_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_string_size_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_copy_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf8_string_copy_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_copy_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf8_string_copy_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44944,40 +51651,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf8_string_copy_from_integer (); int -main () +main (void) { return libfvalue_utf8_string_copy_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_with_index_copy_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf8_string_with_index_copy_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_with_index_copy_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf8_string_with_index_copy_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -44986,40 +51693,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf8_string_with_index_copy_from_integer (); int -main () +main (void) { return libfvalue_utf8_string_with_index_copy_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_copy_to_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf8_string_copy_to_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_copy_to_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf8_string_copy_to_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45028,40 +51735,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf8_string_copy_to_integer (); int -main () +main (void) { return libfvalue_utf8_string_copy_to_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_copy_to_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_with_index_copy_to_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf8_string_with_index_copy_to_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_with_index_copy_to_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf8_string_with_index_copy_to_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45070,41 +51777,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf8_string_with_index_copy_to_integer (); int -main () +main (void) { return libfvalue_utf8_string_with_index_copy_to_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_with_index_copy_to_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_copy_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf16_string_copy_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_copy_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf16_string_copy_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45113,40 +51820,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf16_string_copy_from_integer (); int -main () +main (void) { return libfvalue_utf16_string_copy_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_with_index_copy_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf16_string_with_index_copy_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_with_index_copy_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf16_string_with_index_copy_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45155,40 +51862,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf16_string_with_index_copy_from_integer (); int -main () +main (void) { return libfvalue_utf16_string_with_index_copy_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_copy_to_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf16_string_copy_to_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_copy_to_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf16_string_copy_to_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45197,40 +51904,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf16_string_copy_to_integer (); int -main () +main (void) { return libfvalue_utf16_string_copy_to_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_copy_to_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_with_index_copy_to_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf16_string_with_index_copy_to_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_with_index_copy_to_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf16_string_with_index_copy_to_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45239,41 +51946,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf16_string_with_index_copy_to_integer (); int -main () +main (void) { return libfvalue_utf16_string_with_index_copy_to_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_with_index_copy_to_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_copy_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf32_string_copy_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_copy_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf32_string_copy_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45282,40 +51989,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf32_string_copy_from_integer (); int -main () +main (void) { return libfvalue_utf32_string_copy_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_with_index_copy_from_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf32_string_with_index_copy_from_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_with_index_copy_from_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf32_string_with_index_copy_from_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45324,40 +52031,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf32_string_with_index_copy_from_integer (); int -main () +main (void) { return libfvalue_utf32_string_with_index_copy_from_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_from_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_copy_to_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf32_string_copy_to_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_copy_to_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf32_string_copy_to_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45366,40 +52073,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf32_string_copy_to_integer (); int -main () +main (void) { return libfvalue_utf32_string_copy_to_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_copy_to_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_with_index_copy_to_integer in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf32_string_with_index_copy_to_integer in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf32_string_with_index_copy_to_integer in -lfvalue" >&5 +printf %s "checking for libfvalue_utf32_string_with_index_copy_to_integer in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45408,41 +52115,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf32_string_with_index_copy_to_integer (); int -main () +main (void) { return libfvalue_utf32_string_with_index_copy_to_integer (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf32_string_with_index_copy_to_integer" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_split in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf8_string_split in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf8_string_split+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf8_string_split in -lfvalue" >&5 +printf %s "checking for libfvalue_utf8_string_split in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf8_string_split+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45451,41 +52158,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf8_string_split (); int -main () +main (void) { return libfvalue_utf8_string_split (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf8_string_split=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf8_string_split=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_split" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf8_string_split" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_split" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf8_string_split" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf8_string_split" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf8_string_split" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_split in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_utf16_string_split in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_utf16_string_split+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_utf16_string_split in -lfvalue" >&5 +printf %s "checking for libfvalue_utf16_string_split in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_utf16_string_split+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45494,41 +52201,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_utf16_string_split (); int -main () +main (void) { return libfvalue_utf16_string_split (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_utf16_string_split=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_utf16_string_split=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_split" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_utf16_string_split" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_split" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_utf16_string_split" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_utf16_string_split" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_utf16_string_split" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_free in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf8_string_free in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_free in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf8_string_free in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45537,40 +52244,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf8_string_free (); int -main () +main (void) { return libfvalue_split_utf8_string_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_free=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf8_string_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_free" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf8_string_get_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_string in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf8_string_get_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45579,40 +52286,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf8_string_get_string (); int -main () +main (void) { return libfvalue_split_utf8_string_get_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_number_of_segments in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf8_string_get_number_of_segments in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_number_of_segments in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf8_string_get_number_of_segments in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45621,40 +52328,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf8_string_get_number_of_segments (); int -main () +main (void) { return libfvalue_split_utf8_string_get_number_of_segments (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_number_of_segments" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_segment_by_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf8_string_get_segment_by_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf8_string_get_segment_by_index in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf8_string_get_segment_by_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45663,41 +52370,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf8_string_get_segment_by_index (); int -main () +main (void) { return libfvalue_split_utf8_string_get_segment_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf8_string_get_segment_by_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_free in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf16_string_free in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_free in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf16_string_free in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45706,40 +52413,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf16_string_free (); int -main () +main (void) { return libfvalue_split_utf16_string_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_free=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf16_string_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_free" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf16_string_get_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_string in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf16_string_get_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45748,40 +52455,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf16_string_get_string (); int -main () +main (void) { return libfvalue_split_utf16_string_get_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_number_of_segments in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf16_string_get_number_of_segments in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_number_of_segments in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf16_string_get_number_of_segments in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45790,40 +52497,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf16_string_get_number_of_segments (); int -main () +main (void) { return libfvalue_split_utf16_string_get_number_of_segments (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_number_of_segments" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_segment_by_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_split_utf16_string_get_segment_by_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_split_utf16_string_get_segment_by_index in -lfvalue" >&5 +printf %s "checking for libfvalue_split_utf16_string_get_segment_by_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45832,41 +52539,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_split_utf16_string_get_segment_by_index (); int -main () +main (void) { return libfvalue_split_utf16_string_get_segment_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_split_utf16_string_get_segment_by_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_initialize in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_initialize in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_initialize in -lfvalue" >&5 +printf %s "checking for libfvalue_table_initialize in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45875,40 +52582,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_initialize (); int -main () +main (void) { return libfvalue_table_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_initialize=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_initialize" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_initialize" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_initialize" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_initialize" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_free in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_free in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_free in -lfvalue" >&5 +printf %s "checking for libfvalue_table_free in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45917,40 +52624,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_free (); int -main () +main (void) { return libfvalue_table_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_free=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_free" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_free" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_free" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_free" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_free" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_resize in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_resize in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_resize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_resize in -lfvalue" >&5 +printf %s "checking for libfvalue_table_resize in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_resize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -45959,40 +52666,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_resize (); int -main () +main (void) { return libfvalue_table_resize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_resize=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_resize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_resize" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_resize" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_resize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_resize" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_resize" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_resize" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_clone in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_clone in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_clone in -lfvalue" >&5 +printf %s "checking for libfvalue_table_clone in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46001,41 +52708,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_clone (); int -main () +main (void) { return libfvalue_table_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_clone=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_clone" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_clone" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_clone" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_clone" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_clone" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_number_of_values in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_get_number_of_values in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_get_number_of_values+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_number_of_values in -lfvalue" >&5 +printf %s "checking for libfvalue_table_get_number_of_values in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_get_number_of_values+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46044,41 +52751,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_get_number_of_values (); int -main () +main (void) { return libfvalue_table_get_number_of_values (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_get_number_of_values=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_get_number_of_values=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_get_number_of_values" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_index_by_identifier in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_get_index_by_identifier in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_index_by_identifier in -lfvalue" >&5 +printf %s "checking for libfvalue_table_get_index_by_identifier in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46087,41 +52794,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_get_index_by_identifier (); int -main () +main (void) { return libfvalue_table_get_index_by_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_get_index_by_identifier" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_value_by_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_get_value_by_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_get_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_value_by_index in -lfvalue" >&5 +printf %s "checking for libfvalue_table_get_value_by_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_get_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46130,40 +52837,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_get_value_by_index (); int -main () +main (void) { return libfvalue_table_get_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_get_value_by_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_get_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_get_value_by_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_value_by_identifier in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_get_value_by_identifier in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_get_value_by_identifier in -lfvalue" >&5 +printf %s "checking for libfvalue_table_get_value_by_identifier in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46172,40 +52879,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_get_value_by_identifier (); int -main () +main (void) { return libfvalue_table_get_value_by_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_get_value_by_identifier" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_set_value_by_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_set_value_by_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_set_value_by_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_set_value_by_index in -lfvalue" >&5 +printf %s "checking for libfvalue_table_set_value_by_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_set_value_by_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46214,40 +52921,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_set_value_by_index (); int -main () +main (void) { return libfvalue_table_set_value_by_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_set_value_by_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_set_value_by_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_set_value_by_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_set_value in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_set_value in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_set_value+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_set_value in -lfvalue" >&5 +printf %s "checking for libfvalue_table_set_value in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_set_value+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46256,41 +52963,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_set_value (); int -main () +main (void) { return libfvalue_table_set_value (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_set_value=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_set_value=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_set_value" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_set_value" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_set_value" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_set_value" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_set_value" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_set_value" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_copy_from_utf8_xml_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_table_copy_from_utf8_xml_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_table_copy_from_utf8_xml_string in -lfvalue" >&5 +printf %s "checking for libfvalue_table_copy_from_utf8_xml_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46299,41 +53006,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_table_copy_from_utf8_xml_string (); int -main () +main (void) { return libfvalue_table_copy_from_utf8_xml_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_table_copy_from_utf8_xml_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_initialize in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_initialize in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_initialize in -lfvalue" >&5 +printf %s "checking for libfvalue_value_initialize in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46342,40 +53049,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_initialize (); int -main () +main (void) { return libfvalue_value_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_initialize=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_initialize" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_initialize" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_initialize" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_initialize" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_free in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_free in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_free in -lfvalue" >&5 +printf %s "checking for libfvalue_value_free in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46384,40 +53091,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_free (); int -main () +main (void) { return libfvalue_value_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_free=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_free" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_free" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_free" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_free" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_free" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_clone in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_clone in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_clone+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_clone in -lfvalue" >&5 +printf %s "checking for libfvalue_value_clone in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_clone+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46426,40 +53133,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_clone (); int -main () +main (void) { return libfvalue_value_clone (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_clone=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_clone=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_clone" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_clone" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_clone" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_clone" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_clone" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_clone" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_clear in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_clear in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_clear+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_clear in -lfvalue" >&5 +printf %s "checking for libfvalue_value_clear in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_clear+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46468,41 +53175,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_clear (); int -main () +main (void) { return libfvalue_value_clear (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_clear=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_clear=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_clear" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_clear" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_clear" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_clear" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_clear" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_clear" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_type in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_type in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_type in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_type in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46511,41 +53218,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_type (); int -main () +main (void) { return libfvalue_value_get_type (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_type=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_type=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_type" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_type" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_type" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_type" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_type" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_type" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_identifier in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_identifier in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_identifier in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_identifier in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46554,40 +53261,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_identifier (); int -main () +main (void) { return libfvalue_value_get_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_identifier=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_identifier" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_identifier" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_identifier" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_identifier" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_identifier" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_identifier in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_set_identifier in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_set_identifier+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_identifier in -lfvalue" >&5 +printf %s "checking for libfvalue_value_set_identifier in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_set_identifier+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46596,41 +53303,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_set_identifier (); int -main () +main (void) { return libfvalue_value_set_identifier (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_set_identifier=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_set_identifier=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_identifier" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_identifier" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_set_identifier" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_identifier" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_set_identifier" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_set_identifier" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data_handle in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_data_handle in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_data_handle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data_handle in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_data_handle in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_data_handle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46639,40 +53346,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_data_handle (); int -main () +main (void) { return libfvalue_value_get_data_handle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_data_handle=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_data_handle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data_handle" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_data_handle" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data_handle" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data_handle" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_data_handle" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data_handle" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_has_data in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_has_data in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_has_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_has_data in -lfvalue" >&5 +printf %s "checking for libfvalue_value_has_data in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_has_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46681,40 +53388,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_has_data (); int -main () +main (void) { return libfvalue_value_has_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_has_data=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_has_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_has_data" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_has_data" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_has_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_has_data" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_has_data" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_has_data" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data_size in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_data_size in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_data_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data_size in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_data_size in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_data_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46723,40 +53430,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_data_size (); int -main () +main (void) { return libfvalue_value_get_data_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_data_size=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_data_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data_size" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_data_size" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data_size" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_data_size" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data_size" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_data in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_data in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_data in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46765,40 +53472,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_data (); int -main () +main (void) { return libfvalue_value_get_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_data=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_data" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_data" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_data" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_data" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_data in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_set_data in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_set_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_data in -lfvalue" >&5 +printf %s "checking for libfvalue_value_set_data in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_set_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46807,40 +53514,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_set_data (); int -main () +main (void) { return libfvalue_value_set_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_set_data=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_set_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_data" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_data" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_set_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_data" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_set_data" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_set_data" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_data in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_data in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_data+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_data in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_data in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_data+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46849,41 +53556,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_data (); int -main () +main (void) { return libfvalue_value_copy_data (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_data=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_data=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_data" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_data" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_data" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_data" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_data" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_data" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_format_flags in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_format_flags in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_format_flags+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_format_flags in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_format_flags in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_format_flags+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46892,40 +53599,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_format_flags (); int -main () +main (void) { return libfvalue_value_get_format_flags (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_format_flags=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_format_flags=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_format_flags" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_format_flags" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_format_flags" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_format_flags" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_format_flags" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_format_flags" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_format_flags in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_set_format_flags in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_set_format_flags+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_format_flags in -lfvalue" >&5 +printf %s "checking for libfvalue_value_set_format_flags in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_set_format_flags+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46934,41 +53641,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_set_format_flags (); int -main () +main (void) { return libfvalue_value_set_format_flags (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_set_format_flags=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_set_format_flags=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_format_flags" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_format_flags" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_set_format_flags" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_format_flags" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_set_format_flags" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_set_format_flags" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_number_of_value_entries in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_number_of_value_entries in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_number_of_value_entries in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_number_of_value_entries in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -46977,40 +53684,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_number_of_value_entries (); int -main () +main (void) { return libfvalue_value_get_number_of_value_entries (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_number_of_value_entries" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_value_entry in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_value_entry in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_value_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_value_entry in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_value_entry in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_value_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47019,40 +53726,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_value_entry (); int -main () +main (void) { return libfvalue_value_get_value_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_value_entry=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_value_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_value_entry" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_value_entry" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_value_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_value_entry" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_value_entry" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_value_entry" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_value_entry in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_set_value_entry in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_set_value_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_set_value_entry in -lfvalue" >&5 +printf %s "checking for libfvalue_value_set_value_entry in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_set_value_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47061,40 +53768,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_set_value_entry (); int -main () +main (void) { return libfvalue_value_set_value_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_set_value_entry=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_set_value_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_value_entry" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_set_value_entry" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_set_value_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_set_value_entry" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_set_value_entry" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_set_value_entry" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_append_value_entry in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_append_value_entry in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_append_value_entry+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_append_value_entry in -lfvalue" >&5 +printf %s "checking for libfvalue_value_append_value_entry in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_append_value_entry+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47103,41 +53810,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_append_value_entry (); int -main () +main (void) { return libfvalue_value_append_value_entry (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_append_value_entry=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_append_value_entry=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_append_value_entry" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_append_value_entry" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_append_value_entry" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_append_value_entry" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_append_value_entry" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_append_value_entry" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_boolean in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_boolean in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_boolean in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_boolean in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47146,40 +53853,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_boolean (); int -main () +main (void) { return libfvalue_value_copy_from_boolean (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_boolean" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_boolean in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_boolean in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_boolean in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_boolean in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47188,41 +53895,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_boolean (); int -main () +main (void) { return libfvalue_value_copy_to_boolean (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_boolean" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_8bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_8bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_8bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_8bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47231,40 +53938,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_8bit (); int -main () +main (void) { return libfvalue_value_copy_from_8bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_8bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_8bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_8bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_8bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_8bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47273,41 +53980,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_8bit (); int -main () +main (void) { return libfvalue_value_copy_to_8bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_8bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_16bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_16bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_16bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_16bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47316,40 +54023,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_16bit (); int -main () +main (void) { return libfvalue_value_copy_from_16bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_16bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_16bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_16bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_16bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_16bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47358,41 +54065,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_16bit (); int -main () +main (void) { return libfvalue_value_copy_to_16bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_16bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_32bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_32bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_32bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_32bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47401,40 +54108,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_32bit (); int -main () +main (void) { return libfvalue_value_copy_from_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_32bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_32bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_32bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_32bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_32bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47443,41 +54150,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_32bit (); int -main () +main (void) { return libfvalue_value_copy_to_32bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_32bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_64bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_64bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_64bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_64bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47486,40 +54193,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_64bit (); int -main () +main (void) { return libfvalue_value_copy_from_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_64bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_64bit in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_64bit in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_64bit in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_64bit in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47528,41 +54235,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_64bit (); int -main () +main (void) { return libfvalue_value_copy_to_64bit (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_64bit" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_float in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_float in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_float+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_float in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_float in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_float+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47571,40 +54278,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_float (); int -main () +main (void) { return libfvalue_value_copy_from_float (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_float=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_float=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_float" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_float" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_float" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_float" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_float" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_float" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_float in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_float in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_float+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_float in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_float in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_float+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47613,41 +54320,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_float (); int -main () +main (void) { return libfvalue_value_copy_to_float (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_float=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_float=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_float" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_float" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_float" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_float" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_float" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_float" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_double in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_double in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_double+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_double in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_double in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47656,40 +54363,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_double (); int -main () +main (void) { return libfvalue_value_copy_from_double (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_double=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_double=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_double" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_double" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_double" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_double" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_double" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_double" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_double in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_double in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_double+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_double in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_double in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47698,41 +54405,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_double (); int -main () +main (void) { return libfvalue_value_copy_to_double (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_double=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_double=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_double" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_double" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_double" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_double" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_double" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_double" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf8_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_utf8_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf8_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_utf8_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47741,40 +54448,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_utf8_string (); int -main () +main (void) { return libfvalue_value_copy_from_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf8_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf8_string_size in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_utf8_string_size in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf8_string_size in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_utf8_string_size in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47783,40 +54490,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_utf8_string_size (); int -main () +main (void) { return libfvalue_value_get_utf8_string_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf8_string_size" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf8_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_utf8_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf8_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_utf8_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47825,40 +54532,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_utf8_string (); int -main () +main (void) { return libfvalue_value_copy_to_utf8_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf8_string_with_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_utf8_string_with_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf8_string_with_index in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_utf8_string_with_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47867,41 +54574,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_utf8_string_with_index (); int -main () +main (void) { return libfvalue_value_copy_to_utf8_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf8_string_with_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf16_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_utf16_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf16_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_utf16_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47910,40 +54617,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_utf16_string (); int -main () +main (void) { return libfvalue_value_copy_from_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf16_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf16_string_size in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_utf16_string_size in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf16_string_size in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_utf16_string_size in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47952,40 +54659,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_utf16_string_size (); int -main () +main (void) { return libfvalue_value_get_utf16_string_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf16_string_size" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf16_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_utf16_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf16_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_utf16_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -47994,40 +54701,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_utf16_string (); int -main () +main (void) { return libfvalue_value_copy_to_utf16_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf16_string_with_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_utf16_string_with_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf16_string_with_index in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_utf16_string_with_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48036,41 +54743,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_utf16_string_with_index (); int -main () +main (void) { return libfvalue_value_copy_to_utf16_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf16_string_with_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf32_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_from_utf32_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_from_utf32_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_from_utf32_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48079,40 +54786,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_from_utf32_string (); int -main () +main (void) { return libfvalue_value_copy_from_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_from_utf32_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf32_string_size in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_get_utf32_string_size in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_get_utf32_string_size in -lfvalue" >&5 +printf %s "checking for libfvalue_value_get_utf32_string_size in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48121,40 +54828,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_get_utf32_string_size (); int -main () +main (void) { return libfvalue_value_get_utf32_string_size (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_get_utf32_string_size" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf32_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_utf32_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf32_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_utf32_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48163,40 +54870,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_utf32_string (); int -main () +main (void) { return libfvalue_value_copy_to_utf32_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf32_string_with_index in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_copy_to_utf32_string_with_index in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_copy_to_utf32_string_with_index in -lfvalue" >&5 +printf %s "checking for libfvalue_value_copy_to_utf32_string_with_index in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48205,41 +54912,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_copy_to_utf32_string_with_index (); int -main () +main (void) { return libfvalue_value_copy_to_utf32_string_with_index (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_copy_to_utf32_string_with_index" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_read_from_file_stream in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_read_from_file_stream in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_read_from_file_stream in -lfvalue" >&5 +printf %s "checking for libfvalue_value_read_from_file_stream in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48248,40 +54955,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_read_from_file_stream (); int -main () +main (void) { return libfvalue_value_read_from_file_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_read_from_file_stream" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_write_to_file_stream in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_write_to_file_stream in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_write_to_file_stream in -lfvalue" >&5 +printf %s "checking for libfvalue_value_write_to_file_stream in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48290,41 +54997,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_write_to_file_stream (); int -main () +main (void) { return libfvalue_value_write_to_file_stream (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_write_to_file_stream" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_initialize in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_type_initialize in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_type_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_initialize in -lfvalue" >&5 +printf %s "checking for libfvalue_value_type_initialize in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_type_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48333,40 +55040,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_type_initialize (); int -main () +main (void) { return libfvalue_value_type_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_type_initialize=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_type_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_initialize" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_initialize" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_type_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_initialize" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_type_initialize" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_type_initialize" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_initialize_with_data_handle in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_type_initialize_with_data_handle in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_initialize_with_data_handle in -lfvalue" >&5 +printf %s "checking for libfvalue_value_type_initialize_with_data_handle in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48375,41 +55082,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_type_initialize_with_data_handle (); int -main () +main (void) { return libfvalue_value_type_initialize_with_data_handle (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_type_initialize_with_data_handle" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_set_data_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_type_set_data_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_type_set_data_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_set_data_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_type_set_data_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_type_set_data_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48418,40 +55125,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_type_set_data_string (); int -main () +main (void) { return libfvalue_value_type_set_data_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_type_set_data_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_type_set_data_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_type_set_data_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_append_data_string in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_type_append_data_string in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_type_append_data_string+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_append_data_string in -lfvalue" >&5 +printf %s "checking for libfvalue_value_type_append_data_string in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_type_append_data_string+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48460,41 +55167,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_type_append_data_string (); int -main () +main (void) { return libfvalue_value_type_append_data_string (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_type_append_data_string=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_type_append_data_string=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_type_append_data_string" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_set_data_strings_array in -lfvalue" >&5 -$as_echo_n "checking for libfvalue_value_type_set_data_strings_array in -lfvalue... " >&6; } -if ${ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libfvalue_value_type_set_data_strings_array in -lfvalue" >&5 +printf %s "checking for libfvalue_value_type_set_data_strings_array in -lfvalue... " >&6; } +if test ${ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfvalue $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48503,32 +55210,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libfvalue_value_type_set_data_strings_array (); int -main () +main (void) { return libfvalue_value_type_set_data_strings_array (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array=yes -else +else $as_nop ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" >&5 -$as_echo "$ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" >&6; } -if test "x$ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" >&5 +printf "%s\n" "$ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" >&6; } +if test "x$ac_cv_lib_fvalue_libfvalue_value_type_set_data_strings_array" = xyes +then : ac_cv_libfvalue_dummy=yes -else +else $as_nop ac_cv_libfvalue=no fi @@ -48537,9 +55243,10 @@ fi fi - if test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect && test "x$ac_cv_libfvalue" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect && test "x$ac_cv_libfvalue" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libfvalue in directory: $ac_cv_with_libfvalue See \`config.log' for more details" "$LINENO" 5; } @@ -48547,24 +55254,27 @@ fi - if test "x$ac_cv_libfvalue" = xyes; then : + if test "x$ac_cv_libfvalue" = xyes +then : -$as_echo "#define HAVE_LIBFVALUE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBFVALUE 1" >>confdefs.h fi - if test "x$ac_cv_libfvalue" = xyes; then : + if test "x$ac_cv_libfvalue" = xyes +then : HAVE_LIBFVALUE=1 -else +else $as_nop HAVE_LIBFVALUE=0 fi - if test "x$ac_cv_libfvalue" != xyes; then : + if test "x$ac_cv_libfvalue" != xyes +then : ac_cv_libfvalue_CPPFLAGS="-I../libfvalue"; ac_cv_libfvalue_LIBADD="../libfvalue/libfvalue.la"; @@ -48573,7 +55283,7 @@ -$as_echo "#define HAVE_LOCAL_LIBFVALUE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBFVALUE 1" >>confdefs.h HAVE_LOCAL_LIBFVALUE=1 @@ -48588,24 +55298,28 @@ HAVE_LOCAL_LIBFVALUE_FALSE= fi - if test "x$ac_cv_libfvalue_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libfvalue_CPPFLAGS" != "x" +then : LIBFVALUE_CPPFLAGS=$ac_cv_libfvalue_CPPFLAGS fi - if test "x$ac_cv_libfvalue_LIBADD" != "x"; then : + if test "x$ac_cv_libfvalue_LIBADD" != "x" +then : LIBFVALUE_LIBADD=$ac_cv_libfvalue_LIBADD fi - if test "x$ac_cv_libfvalue" = xyes; then : + if test "x$ac_cv_libfvalue" = xyes +then : ax_libfvalue_pc_libs_private=-lfvalue fi - if test "x$ac_cv_libfvalue" = xyes; then : + if test "x$ac_cv_libfvalue" = xyes +then : ax_libfvalue_spec_requires=libfvalue ax_libfvalue_spec_build_requires=libfvalue-devel @@ -48617,54 +55331,61 @@ # Check whether --with-libhmac was given. -if test "${with_libhmac+set}" = set; then : +if test ${with_libhmac+y} +then : withval=$with_libhmac; ac_cv_with_libhmac=$withval -else +else $as_nop ac_cv_with_libhmac=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libhmac+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libhmac in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libhmac+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libhmac=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libhmac" >&5 -$as_echo "$ac_cv_with_libhmac" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libhmac" >&5 +printf "%s\n" "$ac_cv_with_libhmac" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libhmac" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libhmac" = xno +then : ac_cv_libhmac=no -else - if test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect; then : - if test -d "$ac_cv_with_libhmac"; then : +else $as_nop + ac_cv_libhmac=check + if test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect +then : + if test -d "$ac_cv_with_libhmac" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libhmac}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libhmac}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libhmac See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libhmac=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac" >&5 -$as_echo_n "checking for libhmac... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac >= 20200104" >&5 +printf %s "checking for libhmac >= 20200104... " >&6; } if test -n "$libhmac_CFLAGS"; then pkg_cv_libhmac_CFLAGS="$libhmac_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libhmac >= 20160802\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libhmac >= 20160802") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libhmac >= 20200104\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libhmac >= 20200104") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libhmac_CFLAGS=`$PKG_CONFIG --cflags "libhmac >= 20160802" 2>/dev/null` + pkg_cv_libhmac_CFLAGS=`$PKG_CONFIG --cflags "libhmac >= 20200104" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -48676,12 +55397,12 @@ pkg_cv_libhmac_LIBS="$libhmac_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libhmac >= 20160802\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libhmac >= 20160802") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libhmac >= 20200104\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libhmac >= 20200104") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libhmac_LIBS=`$PKG_CONFIG --libs "libhmac >= 20160802" 2>/dev/null` + pkg_cv_libhmac_LIBS=`$PKG_CONFIG --libs "libhmac >= 20200104" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -48693,8 +55414,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -48702,58 +55423,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libhmac_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libhmac >= 20160802" 2>&1` + libhmac_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libhmac >= 20200104" 2>&1` else - libhmac_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libhmac >= 20160802" 2>&1` + libhmac_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libhmac >= 20200104" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libhmac_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libhmac_PKG_ERRORS" >&5 - ac_cv_libhmac=check + ac_cv_libhmac=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libhmac=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libhmac=check else - libhmac_CFLAGS=$pkg_cv_libhmac_CFLAGS - libhmac_LIBS=$pkg_cv_libhmac_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libhmac=yes + libhmac_CFLAGS=$pkg_cv_libhmac_CFLAGS + libhmac_LIBS=$pkg_cv_libhmac_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libhmac=yes fi fi - if test "x$ac_cv_libhmac" = xyes; then : + if test "x$ac_cv_libhmac" = xyes +then : ac_cv_libhmac_CPPFLAGS="$pkg_cv_libhmac_CFLAGS" ac_cv_libhmac_LIBADD="$pkg_cv_libhmac_LIBS" fi fi - if test "x$ac_cv_libhmac" = xcheck; then : - for ac_header in libhmac.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libhmac.h" "ac_cv_header_libhmac_h" "$ac_includes_default" -if test "x$ac_cv_header_libhmac_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBHMAC_H 1 -_ACEOF + if test "x$ac_cv_libhmac" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libhmac.h" "ac_cv_header_libhmac_h" "$ac_includes_default" +if test "x$ac_cv_header_libhmac_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBHMAC_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libhmac_h" = xno; then : + if test "x$ac_cv_header_libhmac_h" = xno +then : ac_cv_libhmac=no -else +else $as_nop ac_cv_libhmac=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_get_version in -lhmac" >&5 -$as_echo_n "checking for libhmac_get_version in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_get_version in -lhmac" >&5 +printf %s "checking for libhmac_get_version in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48762,41 +55482,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_get_version (); int -main () +main (void) { return libhmac_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_get_version=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_get_version" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_get_version" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_get_version" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_get_version" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_get_version" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_initialize in -lhmac" >&5 -$as_echo_n "checking for libhmac_md5_initialize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_md5_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_initialize in -lhmac" >&5 +printf %s "checking for libhmac_md5_initialize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_md5_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48805,40 +55525,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_md5_initialize (); int -main () +main (void) { return libhmac_md5_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_md5_initialize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_md5_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_initialize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_md5_initialize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_md5_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_initialize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_md5_initialize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_md5_initialize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_update in -lhmac" >&5 -$as_echo_n "checking for libhmac_md5_update in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_md5_update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_update in -lhmac" >&5 +printf %s "checking for libhmac_md5_update in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_md5_update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48847,40 +55567,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_md5_update (); int -main () +main (void) { return libhmac_md5_update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_md5_update=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_md5_update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_update" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_md5_update" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_md5_update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_update" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_md5_update" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_md5_update" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_finalize in -lhmac" >&5 -$as_echo_n "checking for libhmac_md5_finalize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_md5_finalize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_finalize in -lhmac" >&5 +printf %s "checking for libhmac_md5_finalize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_md5_finalize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48889,40 +55609,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_md5_finalize (); int -main () +main (void) { return libhmac_md5_finalize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_md5_finalize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_md5_finalize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_finalize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_md5_finalize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_md5_finalize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_finalize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_md5_finalize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_md5_finalize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_free in -lhmac" >&5 -$as_echo_n "checking for libhmac_md5_free in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_md5_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_md5_free in -lhmac" >&5 +printf %s "checking for libhmac_md5_free in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_md5_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48931,41 +55651,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_md5_free (); int -main () +main (void) { return libhmac_md5_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_md5_free=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_md5_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_free" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_md5_free" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_md5_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_md5_free" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_md5_free" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_md5_free" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_initialize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha1_initialize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha1_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_initialize in -lhmac" >&5 +printf %s "checking for libhmac_sha1_initialize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha1_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -48974,40 +55694,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha1_initialize (); int -main () +main (void) { return libhmac_sha1_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha1_initialize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha1_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_initialize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha1_initialize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha1_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_initialize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha1_initialize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha1_initialize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_update in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha1_update in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha1_update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_update in -lhmac" >&5 +printf %s "checking for libhmac_sha1_update in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha1_update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49016,40 +55736,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha1_update (); int -main () +main (void) { return libhmac_sha1_update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha1_update=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha1_update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_update" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha1_update" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha1_update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_update" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha1_update" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha1_update" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_finalize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha1_finalize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha1_finalize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_finalize in -lhmac" >&5 +printf %s "checking for libhmac_sha1_finalize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha1_finalize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49058,40 +55778,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha1_finalize (); int -main () +main (void) { return libhmac_sha1_finalize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha1_finalize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha1_finalize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_finalize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha1_finalize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha1_finalize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_finalize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha1_finalize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha1_finalize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_free in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha1_free in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha1_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha1_free in -lhmac" >&5 +printf %s "checking for libhmac_sha1_free in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha1_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49100,41 +55820,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha1_free (); int -main () +main (void) { return libhmac_sha1_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha1_free=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha1_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_free" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha1_free" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha1_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha1_free" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha1_free" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha1_free" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_initialize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha224_initialize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha224_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_initialize in -lhmac" >&5 +printf %s "checking for libhmac_sha224_initialize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha224_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49143,40 +55863,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha224_initialize (); int -main () +main (void) { return libhmac_sha224_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha224_initialize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha224_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_initialize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha224_initialize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha224_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_initialize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha224_initialize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha224_initialize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_update in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha224_update in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha224_update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_update in -lhmac" >&5 +printf %s "checking for libhmac_sha224_update in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha224_update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49185,40 +55905,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha224_update (); int -main () +main (void) { return libhmac_sha224_update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha224_update=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha224_update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_update" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha224_update" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha224_update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_update" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha224_update" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha224_update" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_finalize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha224_finalize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha224_finalize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_finalize in -lhmac" >&5 +printf %s "checking for libhmac_sha224_finalize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha224_finalize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49227,40 +55947,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha224_finalize (); int -main () +main (void) { return libhmac_sha224_finalize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha224_finalize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha224_finalize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_finalize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha224_finalize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha224_finalize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_finalize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha224_finalize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha224_finalize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_free in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha224_free in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha224_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha224_free in -lhmac" >&5 +printf %s "checking for libhmac_sha224_free in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha224_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49269,41 +55989,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha224_free (); int -main () +main (void) { return libhmac_sha224_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha224_free=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha224_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_free" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha224_free" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha224_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha224_free" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha224_free" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha224_free" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_initialize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha256_initialize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha256_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_initialize in -lhmac" >&5 +printf %s "checking for libhmac_sha256_initialize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha256_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49312,40 +56032,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha256_initialize (); int -main () +main (void) { return libhmac_sha256_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha256_initialize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha256_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_initialize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha256_initialize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha256_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_initialize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha256_initialize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha256_initialize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_update in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha256_update in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha256_update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_update in -lhmac" >&5 +printf %s "checking for libhmac_sha256_update in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha256_update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49354,40 +56074,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha256_update (); int -main () +main (void) { return libhmac_sha256_update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha256_update=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha256_update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_update" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha256_update" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha256_update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_update" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha256_update" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha256_update" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_finalize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha256_finalize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha256_finalize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_finalize in -lhmac" >&5 +printf %s "checking for libhmac_sha256_finalize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha256_finalize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49396,40 +56116,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha256_finalize (); int -main () +main (void) { return libhmac_sha256_finalize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha256_finalize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha256_finalize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_finalize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha256_finalize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha256_finalize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_finalize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha256_finalize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha256_finalize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_free in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha256_free in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha256_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha256_free in -lhmac" >&5 +printf %s "checking for libhmac_sha256_free in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha256_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49438,41 +56158,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha256_free (); int -main () +main (void) { return libhmac_sha256_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha256_free=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha256_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_free" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha256_free" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha256_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha256_free" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha256_free" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha256_free" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_initialize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha512_initialize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha512_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_initialize in -lhmac" >&5 +printf %s "checking for libhmac_sha512_initialize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha512_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49481,40 +56201,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha512_initialize (); int -main () +main (void) { return libhmac_sha512_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha512_initialize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha512_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_initialize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha512_initialize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha512_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_initialize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha512_initialize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha512_initialize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_update in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha512_update in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha512_update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_update in -lhmac" >&5 +printf %s "checking for libhmac_sha512_update in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha512_update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49523,40 +56243,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha512_update (); int -main () +main (void) { return libhmac_sha512_update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha512_update=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha512_update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_update" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha512_update" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha512_update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_update" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha512_update" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha512_update" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_finalize in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha512_finalize in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha512_finalize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_finalize in -lhmac" >&5 +printf %s "checking for libhmac_sha512_finalize in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha512_finalize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49565,40 +56285,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha512_finalize (); int -main () +main (void) { return libhmac_sha512_finalize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha512_finalize=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha512_finalize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_finalize" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha512_finalize" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha512_finalize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_finalize" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha512_finalize" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha512_finalize" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_free in -lhmac" >&5 -$as_echo_n "checking for libhmac_sha512_free in -lhmac... " >&6; } -if ${ac_cv_lib_hmac_libhmac_sha512_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libhmac_sha512_free in -lhmac" >&5 +printf %s "checking for libhmac_sha512_free in -lhmac... " >&6; } +if test ${ac_cv_lib_hmac_libhmac_sha512_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lhmac $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49607,32 +56327,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libhmac_sha512_free (); int -main () +main (void) { return libhmac_sha512_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_hmac_libhmac_sha512_free=yes -else +else $as_nop ac_cv_lib_hmac_libhmac_sha512_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_free" >&5 -$as_echo "$ac_cv_lib_hmac_libhmac_sha512_free" >&6; } -if test "x$ac_cv_lib_hmac_libhmac_sha512_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hmac_libhmac_sha512_free" >&5 +printf "%s\n" "$ac_cv_lib_hmac_libhmac_sha512_free" >&6; } +if test "x$ac_cv_lib_hmac_libhmac_sha512_free" = xyes +then : ac_cv_libhmac_dummy=yes -else +else $as_nop ac_cv_libhmac=no fi @@ -49641,9 +56360,10 @@ fi fi - if test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect && test "x$ac_cv_libhmac" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect && test "x$ac_cv_libhmac" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libhmac in directory: $ac_cv_with_libhmac See \`config.log' for more details" "$LINENO" 5; } @@ -49651,20 +56371,22 @@ fi - if test "x$ac_cv_libhmac" = xyes; then : + if test "x$ac_cv_libhmac" = xyes +then : -$as_echo "#define HAVE_LIBHMAC 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBHMAC 1" >>confdefs.h fi - if test "x$ac_cv_libhmac" = xyes; then : + if test "x$ac_cv_libhmac" = xyes +then : ac_cv_libhmac_md5=libhmac ac_cv_libhmac_sha1=libhmac ac_cv_libhmac_sha224=libhmac ac_cv_libhmac_sha256=libhmac ac_cv_libhmac_sha512=libhmac -else +else $as_nop ac_cv_libhmac_md5=no ac_cv_libhmac_sha1=no ac_cv_libhmac_sha224=no @@ -49672,101 +56394,115 @@ ac_cv_libhmac_sha512=no fi - if test "x$ac_cv_libhmac" = xyes; then : + if test "x$ac_cv_libhmac" = xyes +then : HAVE_LIBHMAC=1 -else +else $as_nop HAVE_LIBHMAC=0 fi - if test "x$ac_cv_libhmac" != xyes; then : + if test "x$ac_cv_libhmac" != xyes +then : # Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then : +if test ${with_openssl+y} +then : withval=$with_openssl; ac_cv_with_openssl=$withval -else +else $as_nop ac_cv_with_openssl=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL" >&5 -$as_echo_n "checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL... " >&6; } -if ${ac_cv_with_openssl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL" >&5 +printf %s "checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL... " >&6; } +if test ${ac_cv_with_openssl+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_openssl=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_openssl" >&5 -$as_echo "$ac_cv_with_openssl" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_openssl" >&5 +printf "%s\n" "$ac_cv_with_openssl" >&6; } # Check whether --enable-openssl-evp-cipher was given. -if test "${enable_openssl_evp_cipher+set}" = set; then : +if test ${enable_openssl_evp_cipher+y} +then : enableval=$enable_openssl_evp_cipher; ac_cv_enable_openssl_evp_cipher=$enableval -else +else $as_nop ac_cv_enable_openssl_evp_cipher=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable" >&5 -$as_echo_n "checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable... " >&6; } -if ${ac_cv_enable_openssl_evp_cipher+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable" >&5 +printf %s "checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable... " >&6; } +if test ${ac_cv_enable_openssl_evp_cipher+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_openssl_evp_cipher=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_cipher" >&5 -$as_echo "$ac_cv_enable_openssl_evp_cipher" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_cipher" >&5 +printf "%s\n" "$ac_cv_enable_openssl_evp_cipher" >&6; } # Check whether --enable-openssl-evp-md was given. -if test "${enable_openssl_evp_md+set}" = set; then : +if test ${enable_openssl_evp_md+y} +then : enableval=$enable_openssl_evp_md; ac_cv_enable_openssl_evp_md=$enableval -else +else $as_nop ac_cv_enable_openssl_evp_md=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP MD support, or no to disable" >&5 -$as_echo_n "checking whether to enable enable OpenSSL EVP MD support, or no to disable... " >&6; } -if ${ac_cv_enable_openssl_evp_md+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP MD support, or no to disable" >&5 +printf %s "checking whether to enable enable OpenSSL EVP MD support, or no to disable... " >&6; } +if test ${ac_cv_enable_openssl_evp_md+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_openssl_evp_md=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_md" >&5 -$as_echo "$ac_cv_enable_openssl_evp_md" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_md" >&5 +printf "%s\n" "$ac_cv_enable_openssl_evp_md" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_openssl" = xno; then : + if test "x$ac_cv_enable_static_executables" != xyes +then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_openssl" = xno +then : ac_cv_libcrypto=no -else - if test "x$ac_cv_with_openssl" != x && test "x$ac_cv_with_openssl" != xauto-detect; then : - if test -d "$ac_cv_with_openssl"; then : +else $as_nop + if test "x$ac_cv_with_openssl" != x && test "x$ac_cv_with_openssl" != xauto-detect +then : + if test -d "$ac_cv_with_openssl" +then : CFLAGS="$CFLAGS -I${ac_cv_with_openssl}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_openssl}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_openssl See \`config.log' for more details" "$LINENO" 5; } fi -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl" >&5 -$as_echo_n "checking for openssl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl >= 1.0" >&5 +printf %s "checking for openssl >= 1.0... " >&6; } if test -n "$openssl_CFLAGS"; then pkg_cv_openssl_CFLAGS="$openssl_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_openssl_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -49780,10 +56516,10 @@ pkg_cv_openssl_LIBS="$openssl_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_openssl_LIBS=`$PKG_CONFIG --libs "openssl >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -49797,8 +56533,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -49806,73 +56542,67 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.0" 2>&1` + openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.0" 2>&1` else - openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.0" 2>&1` + openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.0" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$openssl_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$openssl_PKG_ERRORS" >&5 - ac_cv_libcrypto=no + ac_cv_libcrypto=no ac_cv_libcrypto_evp=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcrypto=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcrypto=no ac_cv_libcrypto_evp=no else - openssl_CFLAGS=$pkg_cv_openssl_CFLAGS - openssl_LIBS=$pkg_cv_openssl_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcrypto=yes + openssl_CFLAGS=$pkg_cv_openssl_CFLAGS + openssl_LIBS=$pkg_cv_openssl_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes fi fi - if test "x$ac_cv_libcrypto" = xyes; then : + if test "x$ac_cv_libcrypto" = xyes +then : ac_cv_libcrypto_CPPFLAGS="$pkg_cv_openssl_CFLAGS" ac_cv_libcrypto_LIBADD="$pkg_cv_openssl_LIBS" fi fi - if test "x$ac_cv_libcrypto" != xyes; then : - for ac_header in openssl/opensslv.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/opensslv.h" "ac_cv_header_openssl_opensslv_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_opensslv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_OPENSSLV_H 1 -_ACEOF + if test "x$ac_cv_libcrypto" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/opensslv.h" "ac_cv_header_openssl_opensslv_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_opensslv_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_OPENSSLV_H 1" >>confdefs.h fi -done - - for ac_header in openssl/evp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_evp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_EVP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_evp_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_evp_h" = xno; then : + if test "x$ac_cv_header_openssl_evp_h" = xno +then : ac_cv_libcrypto=no ac_cv_libcrypto_evp=no -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openssl/evp.h can be used in combination with zlib.h" >&5 -$as_echo_n "checking if openssl/evp.h can be used in combination with zlib.h... " >&6; } -if ${ac_cv_openssl_evp_zlib_compatible+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if openssl/evp.h can be used in combination with zlib.h" >&5 +printf %s "checking if openssl/evp.h can be used in combination with zlib.h... " >&6; } +if test ${ac_cv_openssl_evp_zlib_compatible+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -49884,19 +56614,20 @@ #include #include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_openssl_evp_zlib_compatible=yes -else +else $as_nop ac_cv_openssl_evp_zlib_compatible=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -49905,14 +56636,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_openssl_evp_zlib_compatible" >&5 -$as_echo "$ac_cv_openssl_evp_zlib_compatible" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_openssl_evp_zlib_compatible" >&5 +printf "%s\n" "$ac_cv_openssl_evp_zlib_compatible" >&6; } - if test "x$ac_cv_openssl_evp_zlib_compatible" = xyes; then : + if test "x$ac_cv_openssl_evp_zlib_compatible" = xyes +then : ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes -else +else $as_nop ac_cv_libcrypto=no ac_cv_libcrypto_evp=no fi @@ -49920,36 +56652,53 @@ fi - if test "x$ac_cv_libcrypto_evp" != xyes && test "$ac_cv_header_openssl_opensslv" = xyes; then : + if test "x$ac_cv_libcrypto_evp" != xyes && test "$ac_cv_header_openssl_opensslv" = xyes +then : ac_cv_libcrypto=yes fi fi - if test "x$ac_cv_libcrypto" = xyes && test "x$ac_cv_libcrypto_evp" = xyes; then : + if test "x$ac_cv_libcrypto" = xyes && test "x$ac_cv_libcrypto_evp" = xyes +then : -$as_echo "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h HAVE_OPENSSL_EVP_H=1 -else +else $as_nop HAVE_OPENSSL_EVP_H=0 fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : -$as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h - ac_cv_libcrypto_LIBADD="-lcrypto" + ac_cv_libcrypto_CPPFLAGS="$openssl_CFLAGS" + ac_cv_libcrypto_LIBADD="$openssl_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_LIBADD" = x +then : + ac_cv_libcrypto_LIBADD="-lcrypto" +fi + + case $host in #( + *cygwin*) : + ac_cv_libcrypto_LIBADD="$ac_cv_libcrypto_LIBADD -lz" ;; #( + *) : + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -49958,30 +56707,29 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : LIBDL_LIBADD="-ldl" fi @@ -49991,25 +56739,30 @@ fi +fi - if test "x$ac_cv_libcrypto_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcrypto_CPPFLAGS" != "x" +then : LIBCRYPTO_CPPFLAGS=$ac_cv_libcrypto_CPPFLAGS fi - if test "x$ac_cv_libcrypto_LIBADD" != "x"; then : + if test "x$ac_cv_libcrypto_LIBADD" != "x" +then : LIBCRYPTO_LIBADD=$ac_cv_libcrypto_LIBADD fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : ax_libcrypto_pc_libs_private=-lcrypto fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : ax_libcrypto_spec_requires=openssl ax_libcrypto_spec_build_requires=openssl-devel @@ -50018,17 +56771,20 @@ fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : ac_cv_libcrypto_md5=no - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_libcrypto_evp_md" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_libcrypto_evp_md" != xyes +then : ac_cv_libcrypto_evp_md=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50037,42 +56793,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_new (); int -main () +main (void) { return EVP_MD_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50081,42 +56838,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_free (); int -main () +main (void) { return EVP_MD_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50125,40 +56882,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_init (); int -main () +main (void) { return EVP_MD_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50167,41 +56924,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_cleanup (); int -main () +main (void) { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50210,43 +56967,216 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_DigestInit_ex2 (); +int +main (void) +{ +return EVP_DigestInit_ex2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_DigestInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_DigestInit_ex2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_CTX_reset (); +int +main (void) +{ +return EVP_MD_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_fetch in -lcrypto" >&5 +printf %s "checking for EVP_MD_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_fetch (); +int +main (void) +{ +return EVP_MD_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_free (); +int +main (void) +{ +return EVP_MD_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50255,40 +57185,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestInit_ex (); int -main () +main (void) { return EVP_DigestInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 +printf %s "checking for EVP_DigestUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50297,40 +57230,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestUpdate (); int -main () +main (void) { return EVP_DigestUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50339,66 +57272,78 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestFinal_ex (); int -main () +main (void) { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_md" = xyes && test "x$ac_cv_libcrypto_evp_md" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_DIGESTINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_md" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_md5 in -lcrypto" >&5 -$as_echo_n "checking for EVP_md5 in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_md5+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_evp_md" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_md5 in -lcrypto" >&5 +printf %s "checking for EVP_md5 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_md5+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50407,69 +57352,67 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_md5 (); int -main () +main (void) { return EVP_md5 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_md5=yes -else +else $as_nop ac_cv_lib_crypto_EVP_md5=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_md5" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_md5" >&6; } -if test "x$ac_cv_lib_crypto_EVP_md5" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_md5" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_md5" >&6; } +if test "x$ac_cv_lib_crypto_EVP_md5" = xyes +then : ac_cv_libcrypto_md5=libcrypto_evp -else +else $as_nop ac_cv_libcrypto_md5=no fi - if test "x$ac_cv_libcrypto_md5" = xlibcrypto_evp; then : + if test "x$ac_cv_libcrypto_md5" = xlibcrypto_evp +then : -$as_echo "#define HAVE_EVP_MD5 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_MD5 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_md5" = xno; then : - for ac_header in openssl/md5.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_md5_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_MD5_H 1 -_ACEOF + if test "x$ac_cv_libcrypto_md5" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_md5_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_MD5_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_md5_h" = xno; then : + if test "x$ac_cv_header_openssl_md5_h" = xno +then : ac_cv_libcrypto_md5=no -else +else $as_nop ac_cv_libcrypto_md5=libcrypto - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Init in -lcrypto" >&5 -$as_echo_n "checking for MD5_Init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_MD5_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MD5_Init in -lcrypto" >&5 +printf %s "checking for MD5_Init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_MD5_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50478,40 +57421,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char MD5_Init (); int -main () +main (void) { return MD5_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_MD5_Init=yes -else +else $as_nop ac_cv_lib_crypto_MD5_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Init" >&5 -$as_echo "$ac_cv_lib_crypto_MD5_Init" >&6; } -if test "x$ac_cv_lib_crypto_MD5_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_MD5_Init" >&6; } +if test "x$ac_cv_lib_crypto_MD5_Init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_md5=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5 -$as_echo_n "checking for MD5_Update in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_MD5_Update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5 +printf %s "checking for MD5_Update in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_MD5_Update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50520,40 +57463,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char MD5_Update (); int -main () +main (void) { return MD5_Update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_MD5_Update=yes -else +else $as_nop ac_cv_lib_crypto_MD5_Update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5 -$as_echo "$ac_cv_lib_crypto_MD5_Update" >&6; } -if test "x$ac_cv_lib_crypto_MD5_Update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5 +printf "%s\n" "$ac_cv_lib_crypto_MD5_Update" >&6; } +if test "x$ac_cv_lib_crypto_MD5_Update" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_md5=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Final in -lcrypto" >&5 -$as_echo_n "checking for MD5_Final in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_MD5_Final+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MD5_Final in -lcrypto" >&5 +printf %s "checking for MD5_Final in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_MD5_Final+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50562,39 +57505,39 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char MD5_Final (); int -main () +main (void) { return MD5_Final (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_MD5_Final=yes -else +else $as_nop ac_cv_lib_crypto_MD5_Final=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Final" >&5 -$as_echo "$ac_cv_lib_crypto_MD5_Final" >&6; } -if test "x$ac_cv_lib_crypto_MD5_Final" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Final" >&5 +printf "%s\n" "$ac_cv_lib_crypto_MD5_Final" >&6; } +if test "x$ac_cv_lib_crypto_MD5_Final" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_md5=no fi fi - if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_md5" = xlibcrypto; then : + if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_md5" = xlibcrypto +then : ac_cv_libcrypto=yes fi @@ -50602,14 +57545,16 @@ ac_cv_libcrypto_sha1=no - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes +then : ac_cv_libcrypto_evp_md=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50618,42 +57563,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_new (); int -main () +main (void) { return EVP_MD_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50662,42 +57608,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_free (); int -main () +main (void) { return EVP_MD_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50706,40 +57652,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_init (); int -main () +main (void) { return EVP_MD_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50748,41 +57694,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_cleanup (); int -main () +main (void) { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50791,43 +57737,216 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_DigestInit_ex2 (); +int +main (void) +{ +return EVP_DigestInit_ex2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_DigestInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_DigestInit_ex2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_CTX_reset (); +int +main (void) +{ +return EVP_MD_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_fetch in -lcrypto" >&5 +printf %s "checking for EVP_MD_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_fetch (); +int +main (void) +{ +return EVP_MD_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_free (); +int +main (void) +{ +return EVP_MD_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50836,40 +57955,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestInit_ex (); int -main () +main (void) { return EVP_DigestInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 +printf %s "checking for EVP_DigestUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50878,40 +58000,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestUpdate (); int -main () +main (void) { return EVP_DigestUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50920,66 +58042,78 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestFinal_ex (); int -main () +main (void) { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_md" = xyes && test "x$ac_cv_libcrypto_evp_md" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_DIGESTINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_md" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha1 in -lcrypto" >&5 -$as_echo_n "checking for EVP_sha1 in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_sha1+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_evp_md" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_sha1 in -lcrypto" >&5 +printf %s "checking for EVP_sha1 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_sha1+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -50988,69 +58122,67 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_sha1 (); int -main () +main (void) { return EVP_sha1 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_sha1=yes -else +else $as_nop ac_cv_lib_crypto_EVP_sha1=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha1" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_sha1" >&6; } -if test "x$ac_cv_lib_crypto_EVP_sha1" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha1" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_sha1" >&6; } +if test "x$ac_cv_lib_crypto_EVP_sha1" = xyes +then : ac_cv_libcrypto_sha1=libcrypto_evp -else +else $as_nop ac_cv_libcrypto_sha1=no fi - if test "x$ac_cv_libcrypto_sha1" = xlibcrypto_evp; then : + if test "x$ac_cv_libcrypto_sha1" = xlibcrypto_evp +then : -$as_echo "#define HAVE_EVP_SHA1 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_SHA1 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_sha1" = xno; then : - for ac_header in openssl/sha.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_sha_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_SHA_H 1 -_ACEOF + if test "x$ac_cv_libcrypto_sha1" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_SHA_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_sha_h" = xno; then : + if test "x$ac_cv_header_openssl_sha_h" = xno +then : ac_cv_libcrypto_sha1=no -else +else $as_nop ac_cv_libcrypto_sha1=libcrypto - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Init in -lcrypto" >&5 -$as_echo_n "checking for SHA1_Init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA1_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA1_Init in -lcrypto" >&5 +printf %s "checking for SHA1_Init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA1_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51059,40 +58191,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA1_Init (); int -main () +main (void) { return SHA1_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA1_Init=yes -else +else $as_nop ac_cv_lib_crypto_SHA1_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Init" >&5 -$as_echo "$ac_cv_lib_crypto_SHA1_Init" >&6; } -if test "x$ac_cv_lib_crypto_SHA1_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA1_Init" >&6; } +if test "x$ac_cv_lib_crypto_SHA1_Init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha1=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Update in -lcrypto" >&5 -$as_echo_n "checking for SHA1_Update in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA1_Update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA1_Update in -lcrypto" >&5 +printf %s "checking for SHA1_Update in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA1_Update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51101,40 +58233,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA1_Update (); int -main () +main (void) { return SHA1_Update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA1_Update=yes -else +else $as_nop ac_cv_lib_crypto_SHA1_Update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Update" >&5 -$as_echo "$ac_cv_lib_crypto_SHA1_Update" >&6; } -if test "x$ac_cv_lib_crypto_SHA1_Update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Update" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA1_Update" >&6; } +if test "x$ac_cv_lib_crypto_SHA1_Update" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha1=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1_Final in -lcrypto" >&5 -$as_echo_n "checking for SHA1_Final in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA1_Final+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA1_Final in -lcrypto" >&5 +printf %s "checking for SHA1_Final in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA1_Final+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51143,39 +58275,39 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA1_Final (); int -main () +main (void) { return SHA1_Final (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA1_Final=yes -else +else $as_nop ac_cv_lib_crypto_SHA1_Final=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Final" >&5 -$as_echo "$ac_cv_lib_crypto_SHA1_Final" >&6; } -if test "x$ac_cv_lib_crypto_SHA1_Final" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1_Final" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA1_Final" >&6; } +if test "x$ac_cv_lib_crypto_SHA1_Final" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha1=no fi fi - if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha1" = xlibcrypto; then : + if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha1" = xlibcrypto +then : ac_cv_libcrypto=yes fi @@ -51183,14 +58315,16 @@ ac_cv_libcrypto_sha224=no - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes +then : ac_cv_libcrypto_evp_md=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51199,42 +58333,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_new (); int -main () +main (void) { return EVP_MD_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51243,42 +58378,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_free (); int -main () +main (void) { return EVP_MD_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51287,40 +58422,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_init (); int -main () +main (void) { return EVP_MD_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51329,41 +58464,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_cleanup (); int -main () +main (void) { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51372,43 +58507,216 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_DigestInit_ex2 (); +int +main (void) +{ +return EVP_DigestInit_ex2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_DigestInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_DigestInit_ex2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_CTX_reset (); +int +main (void) +{ +return EVP_MD_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_fetch in -lcrypto" >&5 +printf %s "checking for EVP_MD_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_fetch (); +int +main (void) +{ +return EVP_MD_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_free (); +int +main (void) +{ +return EVP_MD_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51417,40 +58725,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestInit_ex (); int -main () +main (void) { return EVP_DigestInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 +printf %s "checking for EVP_DigestUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51459,40 +58770,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestUpdate (); int -main () +main (void) { return EVP_DigestUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51501,66 +58812,78 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestFinal_ex (); int -main () +main (void) { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_md" = xyes && test "x$ac_cv_libcrypto_evp_md" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_DIGESTINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_md" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha224 in -lcrypto" >&5 -$as_echo_n "checking for EVP_sha224 in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_sha224+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_evp_md" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_sha224 in -lcrypto" >&5 +printf %s "checking for EVP_sha224 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_sha224+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51569,69 +58892,67 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_sha224 (); int -main () +main (void) { return EVP_sha224 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_sha224=yes -else +else $as_nop ac_cv_lib_crypto_EVP_sha224=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha224" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_sha224" >&6; } -if test "x$ac_cv_lib_crypto_EVP_sha224" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha224" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_sha224" >&6; } +if test "x$ac_cv_lib_crypto_EVP_sha224" = xyes +then : ac_cv_libcrypto_sha224=libcrypto_evp -else +else $as_nop ac_cv_libcrypto_sha224=no fi - if test "x$ac_cv_libcrypto_sha224" = xlibcrypto_evp; then : + if test "x$ac_cv_libcrypto_sha224" = xlibcrypto_evp +then : -$as_echo "#define HAVE_EVP_SHA224 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_SHA224 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_sha224" = xno; then : - for ac_header in openssl/sha.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_sha_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_SHA_H 1 -_ACEOF + if test "x$ac_cv_libcrypto_sha224" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_SHA_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_sha_h" = xno; then : + if test "x$ac_cv_header_openssl_sha_h" = xno +then : ac_cv_libcrypto_sha224=no -else +else $as_nop ac_cv_libcrypto_sha224=libcrypto - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5 -$as_echo_n "checking for SHA224_Init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA224_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA224_Init in -lcrypto" >&5 +printf %s "checking for SHA224_Init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA224_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51640,40 +58961,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA224_Init (); int -main () +main (void) { return SHA224_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA224_Init=yes -else +else $as_nop ac_cv_lib_crypto_SHA224_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5 -$as_echo "$ac_cv_lib_crypto_SHA224_Init" >&6; } -if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA224_Init" >&6; } +if test "x$ac_cv_lib_crypto_SHA224_Init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha224=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Update in -lcrypto" >&5 -$as_echo_n "checking for SHA224_Update in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA224_Update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA224_Update in -lcrypto" >&5 +printf %s "checking for SHA224_Update in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA224_Update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51682,40 +59003,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA224_Update (); int -main () +main (void) { return SHA224_Update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA224_Update=yes -else +else $as_nop ac_cv_lib_crypto_SHA224_Update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Update" >&5 -$as_echo "$ac_cv_lib_crypto_SHA224_Update" >&6; } -if test "x$ac_cv_lib_crypto_SHA224_Update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Update" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA224_Update" >&6; } +if test "x$ac_cv_lib_crypto_SHA224_Update" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha224=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA224_Final in -lcrypto" >&5 -$as_echo_n "checking for SHA224_Final in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA224_Final+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA224_Final in -lcrypto" >&5 +printf %s "checking for SHA224_Final in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA224_Final+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51724,39 +59045,39 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA224_Final (); int -main () +main (void) { return SHA224_Final (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA224_Final=yes -else +else $as_nop ac_cv_lib_crypto_SHA224_Final=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Final" >&5 -$as_echo "$ac_cv_lib_crypto_SHA224_Final" >&6; } -if test "x$ac_cv_lib_crypto_SHA224_Final" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA224_Final" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA224_Final" >&6; } +if test "x$ac_cv_lib_crypto_SHA224_Final" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha224=no fi fi - if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha224" = xlibcrypto; then : + if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha224" = xlibcrypto +then : ac_cv_libcrypto=yes fi @@ -51764,14 +59085,16 @@ ac_cv_libcrypto_sha256=no - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes +then : ac_cv_libcrypto_evp_md=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51780,42 +59103,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_new (); int -main () +main (void) { return EVP_MD_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51824,42 +59148,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_free (); int -main () +main (void) { return EVP_MD_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51868,40 +59192,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_init (); int -main () +main (void) { return EVP_MD_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51910,41 +59234,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_cleanup (); int -main () +main (void) { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51953,43 +59277,216 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_DigestInit_ex2 (); +int +main (void) +{ +return EVP_DigestInit_ex2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_DigestInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_DigestInit_ex2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_CTX_reset (); +int +main (void) +{ +return EVP_MD_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_fetch in -lcrypto" >&5 +printf %s "checking for EVP_MD_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_fetch (); +int +main (void) +{ +return EVP_MD_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_free (); +int +main (void) +{ +return EVP_MD_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -51998,40 +59495,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestInit_ex (); int -main () +main (void) { return EVP_DigestInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 +printf %s "checking for EVP_DigestUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52040,40 +59540,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestUpdate (); int -main () +main (void) { return EVP_DigestUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52082,66 +59582,78 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestFinal_ex (); int -main () +main (void) { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_md" = xyes && test "x$ac_cv_libcrypto_evp_md" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_DIGESTINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_md" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 -$as_echo_n "checking for EVP_sha256 in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_sha256+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_evp_md" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lcrypto" >&5 +printf %s "checking for EVP_sha256 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_sha256+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52150,69 +59662,67 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_sha256 (); int -main () +main (void) { return EVP_sha256 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_sha256=yes -else +else $as_nop ac_cv_lib_crypto_EVP_sha256=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha256" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_sha256" >&6; } -if test "x$ac_cv_lib_crypto_EVP_sha256" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha256" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_sha256" >&6; } +if test "x$ac_cv_lib_crypto_EVP_sha256" = xyes +then : ac_cv_libcrypto_sha256=libcrypto_evp -else +else $as_nop ac_cv_libcrypto_sha256=no fi - if test "x$ac_cv_libcrypto_sha256" = xlibcrypto_evp; then : + if test "x$ac_cv_libcrypto_sha256" = xlibcrypto_evp +then : -$as_echo "#define HAVE_EVP_SHA256 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_SHA256 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_sha256" = xno; then : - for ac_header in openssl/sha.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_sha_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_SHA_H 1 -_ACEOF + if test "x$ac_cv_libcrypto_sha256" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_SHA_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_sha_h" = xno; then : + if test "x$ac_cv_header_openssl_sha_h" = xno +then : ac_cv_libcrypto_sha256=no -else +else $as_nop ac_cv_libcrypto_sha256=libcrypto - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5 -$as_echo_n "checking for SHA256_Init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA256_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA256_Init in -lcrypto" >&5 +printf %s "checking for SHA256_Init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA256_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52221,40 +59731,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA256_Init (); int -main () +main (void) { return SHA256_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA256_Init=yes -else +else $as_nop ac_cv_lib_crypto_SHA256_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5 -$as_echo "$ac_cv_lib_crypto_SHA256_Init" >&6; } -if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA256_Init" >&6; } +if test "x$ac_cv_lib_crypto_SHA256_Init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha256=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Update in -lcrypto" >&5 -$as_echo_n "checking for SHA256_Update in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA256_Update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA256_Update in -lcrypto" >&5 +printf %s "checking for SHA256_Update in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA256_Update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52263,40 +59773,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA256_Update (); int -main () +main (void) { return SHA256_Update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA256_Update=yes -else +else $as_nop ac_cv_lib_crypto_SHA256_Update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Update" >&5 -$as_echo "$ac_cv_lib_crypto_SHA256_Update" >&6; } -if test "x$ac_cv_lib_crypto_SHA256_Update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Update" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA256_Update" >&6; } +if test "x$ac_cv_lib_crypto_SHA256_Update" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha256=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256_Final in -lcrypto" >&5 -$as_echo_n "checking for SHA256_Final in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA256_Final+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA256_Final in -lcrypto" >&5 +printf %s "checking for SHA256_Final in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA256_Final+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52305,39 +59815,39 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA256_Final (); int -main () +main (void) { return SHA256_Final (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA256_Final=yes -else +else $as_nop ac_cv_lib_crypto_SHA256_Final=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Final" >&5 -$as_echo "$ac_cv_lib_crypto_SHA256_Final" >&6; } -if test "x$ac_cv_lib_crypto_SHA256_Final" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256_Final" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA256_Final" >&6; } +if test "x$ac_cv_lib_crypto_SHA256_Final" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha256=no fi fi - if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha256" = xlibcrypto; then : + if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha256" = xlibcrypto +then : ac_cv_libcrypto=yes fi @@ -52345,14 +59855,16 @@ ac_cv_libcrypto_sha512=no - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_md" != xno && test "x$ac_cv_libcrypto_evp_md" != xyes +then : ac_cv_libcrypto_evp_md=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52361,42 +59873,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_new (); int -main () +main (void) { return EVP_MD_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52405,42 +59918,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_free (); int -main () +main (void) { return EVP_MD_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52449,40 +59962,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_init (); int -main () +main (void) { return EVP_MD_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52491,41 +60004,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_MD_CTX_cleanup (); int -main () +main (void) { return EVP_MD_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_MD_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_MD_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52534,43 +60047,216 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_DigestInit_ex2 (); +int +main (void) +{ +return EVP_DigestInit_ex2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_DigestInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_DigestInit_ex2=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_MD_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_CTX_reset (); +int +main (void) +{ +return EVP_MD_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_fetch in -lcrypto" >&5 +printf %s "checking for EVP_MD_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_fetch (); +int +main (void) +{ +return EVP_MD_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_free in -lcrypto" >&5 +printf %s "checking for EVP_MD_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_MD_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_MD_free (); +int +main (void) +{ +return EVP_MD_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_MD_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_MD_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_MD_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_MD_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_MD_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_md=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52579,40 +60265,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestInit_ex (); int -main () +main (void) { return EVP_DigestInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestUpdate in -lcrypto" >&5 +printf %s "checking for EVP_DigestUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52621,40 +60310,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestUpdate (); int -main () +main (void) { return EVP_DigestUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_DigestFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_DigestFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_DigestFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_DigestFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52663,66 +60352,78 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_DigestFinal_ex (); int -main () +main (void) { return EVP_DigestFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_DigestFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_DigestFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_DigestFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_DigestFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_DigestFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_md=no fi - if test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_md" = xyes && test "x$ac_cv_libcrypto_evp_md" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP MD support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_MD_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_MD_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_DIGESTINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_md" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha512 in -lcrypto" >&5 -$as_echo_n "checking for EVP_sha512 in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_sha512+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_evp_md" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_sha512 in -lcrypto" >&5 +printf %s "checking for EVP_sha512 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_sha512+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52731,69 +60432,67 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_sha512 (); int -main () +main (void) { return EVP_sha512 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_sha512=yes -else +else $as_nop ac_cv_lib_crypto_EVP_sha512=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha512" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_sha512" >&6; } -if test "x$ac_cv_lib_crypto_EVP_sha512" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_sha512" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_sha512" >&6; } +if test "x$ac_cv_lib_crypto_EVP_sha512" = xyes +then : ac_cv_libcrypto_sha512=libcrypto_evp -else +else $as_nop ac_cv_libcrypto_sha512=no fi - if test "x$ac_cv_libcrypto_sha512" = xlibcrypto_evp; then : + if test "x$ac_cv_libcrypto_sha512" = xlibcrypto_evp +then : -$as_echo "#define HAVE_EVP_SHA512 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_SHA512 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_sha512" = xno; then : - for ac_header in openssl/sha.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_sha_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_SHA_H 1 -_ACEOF + if test "x$ac_cv_libcrypto_sha512" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_SHA_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_sha_h" = xno; then : + if test "x$ac_cv_header_openssl_sha_h" = xno +then : ac_cv_libcrypto_sha512=no -else +else $as_nop ac_cv_libcrypto_sha512=libcrypto - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5 -$as_echo_n "checking for SHA512_Init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA512_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA512_Init in -lcrypto" >&5 +printf %s "checking for SHA512_Init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA512_Init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52802,40 +60501,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA512_Init (); int -main () +main (void) { return SHA512_Init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA512_Init=yes -else +else $as_nop ac_cv_lib_crypto_SHA512_Init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5 -$as_echo "$ac_cv_lib_crypto_SHA512_Init" >&6; } -if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA512_Init" >&6; } +if test "x$ac_cv_lib_crypto_SHA512_Init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha512=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Update in -lcrypto" >&5 -$as_echo_n "checking for SHA512_Update in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA512_Update+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA512_Update in -lcrypto" >&5 +printf %s "checking for SHA512_Update in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA512_Update+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52844,40 +60543,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA512_Update (); int -main () +main (void) { return SHA512_Update (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA512_Update=yes -else +else $as_nop ac_cv_lib_crypto_SHA512_Update=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Update" >&5 -$as_echo "$ac_cv_lib_crypto_SHA512_Update" >&6; } -if test "x$ac_cv_lib_crypto_SHA512_Update" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Update" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA512_Update" >&6; } +if test "x$ac_cv_lib_crypto_SHA512_Update" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha512=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA512_Final in -lcrypto" >&5 -$as_echo_n "checking for SHA512_Final in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_SHA512_Final+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SHA512_Final in -lcrypto" >&5 +printf %s "checking for SHA512_Final in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_SHA512_Final+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -52886,39 +60585,39 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char SHA512_Final (); int -main () +main (void) { return SHA512_Final (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_SHA512_Final=yes -else +else $as_nop ac_cv_lib_crypto_SHA512_Final=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Final" >&5 -$as_echo "$ac_cv_lib_crypto_SHA512_Final" >&6; } -if test "x$ac_cv_lib_crypto_SHA512_Final" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512_Final" >&5 +printf "%s\n" "$ac_cv_lib_crypto_SHA512_Final" >&6; } +if test "x$ac_cv_lib_crypto_SHA512_Final" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_sha512=no fi fi - if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha512" = xlibcrypto; then : + if test "x$ac_cv_libcrypto" = xno && test "x$ac_cv_libcrypto_sha512" = xlibcrypto +then : ac_cv_libcrypto=yes fi @@ -52926,33 +60625,38 @@ fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_md5" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_md5" = xno +then : ac_cv_libhmac_md5=local -else +else $as_nop ac_cv_libhmac_md5=$ac_cv_libcrypto_md5 fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha1" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha1" = xno +then : ac_cv_libhmac_sha1=local -else +else $as_nop ac_cv_libhmac_sha1=$ac_cv_libcrypto_sha1 fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha224" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha224" = xno +then : ac_cv_libhmac_sha224=local -else +else $as_nop ac_cv_libhmac_sha224=$ac_cv_libcrypto_sha224 fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha256" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha256" = xno +then : ac_cv_libhmac_sha256=local -else +else $as_nop ac_cv_libhmac_sha256=$ac_cv_libcrypto_sha256 fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha512" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_sha512" = xno +then : ac_cv_libhmac_sha512=local -else +else $as_nop ac_cv_libhmac_sha512=$ac_cv_libcrypto_sha512 fi @@ -52963,7 +60667,7 @@ -$as_echo "#define HAVE_LOCAL_LIBHMAC 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBHMAC 1" >>confdefs.h HAVE_LOCAL_LIBHMAC=1 @@ -52978,24 +60682,28 @@ HAVE_LOCAL_LIBHMAC_FALSE= fi - if test "x$ac_cv_libhmac_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libhmac_CPPFLAGS" != "x" +then : LIBHMAC_CPPFLAGS=$ac_cv_libhmac_CPPFLAGS fi - if test "x$ac_cv_libhmac_LIBADD" != "x"; then : + if test "x$ac_cv_libhmac_LIBADD" != "x" +then : LIBHMAC_LIBADD=$ac_cv_libhmac_LIBADD fi - if test "x$ac_cv_libhmac" = xyes; then : + if test "x$ac_cv_libhmac" = xyes +then : ax_libhmac_pc_libs_private=-lhmac fi - if test "x$ac_cv_libhmac" = xyes; then : + if test "x$ac_cv_libhmac" = xyes +then : ax_libhmac_spec_requires=libhmac ax_libhmac_spec_build_requires=libhmac-devel @@ -53007,54 +60715,61 @@ # Check whether --with-libcaes was given. -if test "${with_libcaes+set}" = set; then : +if test ${with_libcaes+y} +then : withval=$with_libcaes; ac_cv_with_libcaes=$withval -else +else $as_nop ac_cv_with_libcaes=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcaes in includedir and libdir or in the specified DIR, or no if to use local version" >&5 -$as_echo_n "checking whether to use search for libcaes in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } -if ${ac_cv_with_libcaes+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libcaes in includedir and libdir or in the specified DIR, or no if to use local version" >&5 +printf %s "checking whether to use search for libcaes in includedir and libdir or in the specified DIR, or no if to use local version... " >&6; } +if test ${ac_cv_with_libcaes+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libcaes=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcaes" >&5 -$as_echo "$ac_cv_with_libcaes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libcaes" >&5 +printf "%s\n" "$ac_cv_with_libcaes" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcaes" = xno; then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcaes" = xno +then : ac_cv_libcaes=no -else - if test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect; then : - if test -d "$ac_cv_with_libcaes"; then : +else $as_nop + ac_cv_libcaes=check + if test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect +then : + if test -d "$ac_cv_with_libcaes" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libcaes}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libcaes}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_libcaes See \`config.log' for more details" "$LINENO" 5; } fi - ac_cv_libcaes=check -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes" >&5 -$as_echo_n "checking for libcaes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes >= 20220529" >&5 +printf %s "checking for libcaes >= 20220529... " >&6; } if test -n "$libcaes_CFLAGS"; then pkg_cv_libcaes_CFLAGS="$libcaes_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcaes >= 20161025\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libcaes >= 20161025") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcaes >= 20220529\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcaes >= 20220529") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libcaes_CFLAGS=`$PKG_CONFIG --cflags "libcaes >= 20161025" 2>/dev/null` + pkg_cv_libcaes_CFLAGS=`$PKG_CONFIG --cflags "libcaes >= 20220529" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -53066,12 +60781,12 @@ pkg_cv_libcaes_LIBS="$libcaes_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcaes >= 20161025\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libcaes >= 20161025") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcaes >= 20220529\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcaes >= 20220529") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libcaes_LIBS=`$PKG_CONFIG --libs "libcaes >= 20161025" 2>/dev/null` + pkg_cv_libcaes_LIBS=`$PKG_CONFIG --libs "libcaes >= 20220529" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -53083,8 +60798,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -53092,58 +60807,57 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libcaes_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcaes >= 20161025" 2>&1` + libcaes_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcaes >= 20220529" 2>&1` else - libcaes_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcaes >= 20161025" 2>&1` + libcaes_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcaes >= 20220529" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libcaes_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libcaes_PKG_ERRORS" >&5 - ac_cv_libcaes=check + ac_cv_libcaes=check elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcaes=check + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcaes=check else - libcaes_CFLAGS=$pkg_cv_libcaes_CFLAGS - libcaes_LIBS=$pkg_cv_libcaes_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcaes=yes + libcaes_CFLAGS=$pkg_cv_libcaes_CFLAGS + libcaes_LIBS=$pkg_cv_libcaes_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcaes=yes fi fi - if test "x$ac_cv_libcaes" = xyes; then : + if test "x$ac_cv_libcaes" = xyes +then : ac_cv_libcaes_CPPFLAGS="$pkg_cv_libcaes_CFLAGS" ac_cv_libcaes_LIBADD="$pkg_cv_libcaes_LIBS" fi fi - if test "x$ac_cv_libcaes" = xcheck; then : - for ac_header in libcaes.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libcaes.h" "ac_cv_header_libcaes_h" "$ac_includes_default" -if test "x$ac_cv_header_libcaes_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCAES_H 1 -_ACEOF + if test "x$ac_cv_libcaes" = xcheck +then : + ac_fn_c_check_header_compile "$LINENO" "libcaes.h" "ac_cv_header_libcaes_h" "$ac_includes_default" +if test "x$ac_cv_header_libcaes_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBCAES_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_libcaes_h" = xno; then : + if test "x$ac_cv_header_libcaes_h" = xno +then : ac_cv_libcaes=no -else +else $as_nop ac_cv_libcaes=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_get_version in -lcaes" >&5 -$as_echo_n "checking for libcaes_get_version in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_get_version+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_get_version in -lcaes" >&5 +printf %s "checking for libcaes_get_version in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_get_version+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53152,41 +60866,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_get_version (); int -main () +main (void) { return libcaes_get_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_get_version=yes -else +else $as_nop ac_cv_lib_caes_libcaes_get_version=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_get_version" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_get_version" >&6; } -if test "x$ac_cv_lib_caes_libcaes_get_version" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_get_version" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_get_version" >&6; } +if test "x$ac_cv_lib_caes_libcaes_get_version" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_context_initialize in -lcaes" >&5 -$as_echo_n "checking for libcaes_context_initialize in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_context_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_context_initialize in -lcaes" >&5 +printf %s "checking for libcaes_context_initialize in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_context_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53195,40 +60909,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_context_initialize (); int -main () +main (void) { return libcaes_context_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_context_initialize=yes -else +else $as_nop ac_cv_lib_caes_libcaes_context_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_context_initialize" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_context_initialize" >&6; } -if test "x$ac_cv_lib_caes_libcaes_context_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_context_initialize" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_context_initialize" >&6; } +if test "x$ac_cv_lib_caes_libcaes_context_initialize" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_context_free in -lcaes" >&5 -$as_echo_n "checking for libcaes_context_free in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_context_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_context_free in -lcaes" >&5 +printf %s "checking for libcaes_context_free in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_context_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53237,40 +60951,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_context_free (); int -main () +main (void) { return libcaes_context_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_context_free=yes -else +else $as_nop ac_cv_lib_caes_libcaes_context_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_context_free" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_context_free" >&6; } -if test "x$ac_cv_lib_caes_libcaes_context_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_context_free" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_context_free" >&6; } +if test "x$ac_cv_lib_caes_libcaes_context_free" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_context_set_key in -lcaes" >&5 -$as_echo_n "checking for libcaes_context_set_key in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_context_set_key+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_context_set_key in -lcaes" >&5 +printf %s "checking for libcaes_context_set_key in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_context_set_key+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53279,41 +60993,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_context_set_key (); int -main () +main (void) { return libcaes_context_set_key (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_context_set_key=yes -else +else $as_nop ac_cv_lib_caes_libcaes_context_set_key=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_context_set_key" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_context_set_key" >&6; } -if test "x$ac_cv_lib_caes_libcaes_context_set_key" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_context_set_key" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_context_set_key" >&6; } +if test "x$ac_cv_lib_caes_libcaes_context_set_key" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_tweaked_context_initialize in -lcaes" >&5 -$as_echo_n "checking for libcaes_tweaked_context_initialize in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_tweaked_context_initialize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_tweaked_context_initialize in -lcaes" >&5 +printf %s "checking for libcaes_tweaked_context_initialize in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_tweaked_context_initialize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53322,40 +61036,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_tweaked_context_initialize (); int -main () +main (void) { return libcaes_tweaked_context_initialize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_tweaked_context_initialize=yes -else +else $as_nop ac_cv_lib_caes_libcaes_tweaked_context_initialize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_tweaked_context_initialize" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_tweaked_context_initialize" >&6; } -if test "x$ac_cv_lib_caes_libcaes_tweaked_context_initialize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_tweaked_context_initialize" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_tweaked_context_initialize" >&6; } +if test "x$ac_cv_lib_caes_libcaes_tweaked_context_initialize" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_tweaked_context_free in -lcaes" >&5 -$as_echo_n "checking for libcaes_tweaked_context_free in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_tweaked_context_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_tweaked_context_free in -lcaes" >&5 +printf %s "checking for libcaes_tweaked_context_free in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_tweaked_context_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53364,40 +61078,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_tweaked_context_free (); int -main () +main (void) { return libcaes_tweaked_context_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_tweaked_context_free=yes -else +else $as_nop ac_cv_lib_caes_libcaes_tweaked_context_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_tweaked_context_free" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_tweaked_context_free" >&6; } -if test "x$ac_cv_lib_caes_libcaes_tweaked_context_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_tweaked_context_free" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_tweaked_context_free" >&6; } +if test "x$ac_cv_lib_caes_libcaes_tweaked_context_free" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_tweaked_context_set_keys in -lcaes" >&5 -$as_echo_n "checking for libcaes_tweaked_context_set_keys in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_tweaked_context_set_keys+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_tweaked_context_set_keys in -lcaes" >&5 +printf %s "checking for libcaes_tweaked_context_set_keys in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_tweaked_context_set_keys+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53406,41 +61120,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_tweaked_context_set_keys (); int -main () +main (void) { return libcaes_tweaked_context_set_keys (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_tweaked_context_set_keys=yes -else +else $as_nop ac_cv_lib_caes_libcaes_tweaked_context_set_keys=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_tweaked_context_set_keys" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_tweaked_context_set_keys" >&6; } -if test "x$ac_cv_lib_caes_libcaes_tweaked_context_set_keys" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_tweaked_context_set_keys" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_tweaked_context_set_keys" >&6; } +if test "x$ac_cv_lib_caes_libcaes_tweaked_context_set_keys" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_cbc in -lcaes" >&5 -$as_echo_n "checking for libcaes_crypt_cbc in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_crypt_cbc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_cbc in -lcaes" >&5 +printf %s "checking for libcaes_crypt_cbc in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_crypt_cbc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53449,40 +61163,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_crypt_cbc (); int -main () +main (void) { return libcaes_crypt_cbc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_crypt_cbc=yes -else +else $as_nop ac_cv_lib_caes_libcaes_crypt_cbc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_cbc" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_crypt_cbc" >&6; } -if test "x$ac_cv_lib_caes_libcaes_crypt_cbc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_cbc" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_crypt_cbc" >&6; } +if test "x$ac_cv_lib_caes_libcaes_crypt_cbc" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_ccm in -lcaes" >&5 -$as_echo_n "checking for libcaes_crypt_ccm in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_crypt_ccm+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_ccm in -lcaes" >&5 +printf %s "checking for libcaes_crypt_ccm in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_crypt_ccm+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53491,40 +61205,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_crypt_ccm (); int -main () +main (void) { return libcaes_crypt_ccm (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_crypt_ccm=yes -else +else $as_nop ac_cv_lib_caes_libcaes_crypt_ccm=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_ccm" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_crypt_ccm" >&6; } -if test "x$ac_cv_lib_caes_libcaes_crypt_ccm" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_ccm" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_crypt_ccm" >&6; } +if test "x$ac_cv_lib_caes_libcaes_crypt_ccm" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_ecb in -lcaes" >&5 -$as_echo_n "checking for libcaes_crypt_ecb in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_crypt_ecb+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_ecb in -lcaes" >&5 +printf %s "checking for libcaes_crypt_ecb in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_crypt_ecb+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53533,40 +61247,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_crypt_ecb (); int -main () +main (void) { return libcaes_crypt_ecb (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_crypt_ecb=yes -else +else $as_nop ac_cv_lib_caes_libcaes_crypt_ecb=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_ecb" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_crypt_ecb" >&6; } -if test "x$ac_cv_lib_caes_libcaes_crypt_ecb" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_ecb" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_crypt_ecb" >&6; } +if test "x$ac_cv_lib_caes_libcaes_crypt_ecb" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_xts in -lcaes" >&5 -$as_echo_n "checking for libcaes_crypt_xts in -lcaes... " >&6; } -if ${ac_cv_lib_caes_libcaes_crypt_xts+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcaes_crypt_xts in -lcaes" >&5 +printf %s "checking for libcaes_crypt_xts in -lcaes... " >&6; } +if test ${ac_cv_lib_caes_libcaes_crypt_xts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcaes $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53575,32 +61289,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char libcaes_crypt_xts (); int -main () +main (void) { return libcaes_crypt_xts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_caes_libcaes_crypt_xts=yes -else +else $as_nop ac_cv_lib_caes_libcaes_crypt_xts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_xts" >&5 -$as_echo "$ac_cv_lib_caes_libcaes_crypt_xts" >&6; } -if test "x$ac_cv_lib_caes_libcaes_crypt_xts" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_caes_libcaes_crypt_xts" >&5 +printf "%s\n" "$ac_cv_lib_caes_libcaes_crypt_xts" >&6; } +if test "x$ac_cv_lib_caes_libcaes_crypt_xts" = xyes +then : ac_cv_libcaes_dummy=yes -else +else $as_nop ac_cv_libcaes=no fi @@ -53609,9 +61322,10 @@ fi fi - if test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect && test "x$ac_cv_libcaes" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect && test "x$ac_cv_libcaes" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "unable to find supported libcaes in directory: $ac_cv_with_libcaes See \`config.log' for more details" "$LINENO" 5; } @@ -53619,114 +61333,130 @@ fi - if test "x$ac_cv_libcaes" = xyes; then : + if test "x$ac_cv_libcaes" = xyes +then : -$as_echo "#define HAVE_LIBCAES 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCAES 1" >>confdefs.h fi - if test "x$ac_cv_libcaes" = xyes; then : + if test "x$ac_cv_libcaes" = xyes +then : ac_cv_libcaes_aes=libcaes -else +else $as_nop ac_cv_libcaes_aes=no fi - if test "x$ac_cv_libcaes" = xyes; then : + if test "x$ac_cv_libcaes" = xyes +then : HAVE_LIBCAES=1 -else +else $as_nop HAVE_LIBCAES=0 fi - if test "x$ac_cv_libcaes" != xyes; then : + if test "x$ac_cv_libcaes" != xyes +then : # Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then : +if test ${with_openssl+y} +then : withval=$with_openssl; ac_cv_with_openssl=$withval -else +else $as_nop ac_cv_with_openssl=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL" >&5 -$as_echo_n "checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL... " >&6; } -if ${ac_cv_with_openssl+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL" >&5 +printf %s "checking whether to use search for OpenSSL in includedir and libdir or in the specified DIR, or no if not to use OpenSSL... " >&6; } +if test ${ac_cv_with_openssl+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_openssl=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_openssl" >&5 -$as_echo "$ac_cv_with_openssl" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_openssl" >&5 +printf "%s\n" "$ac_cv_with_openssl" >&6; } # Check whether --enable-openssl-evp-cipher was given. -if test "${enable_openssl_evp_cipher+set}" = set; then : +if test ${enable_openssl_evp_cipher+y} +then : enableval=$enable_openssl_evp_cipher; ac_cv_enable_openssl_evp_cipher=$enableval -else +else $as_nop ac_cv_enable_openssl_evp_cipher=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable" >&5 -$as_echo_n "checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable... " >&6; } -if ${ac_cv_enable_openssl_evp_cipher+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable" >&5 +printf %s "checking whether to enable enable OpenSSL EVP CIPHER support, or no to disable... " >&6; } +if test ${ac_cv_enable_openssl_evp_cipher+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_openssl_evp_cipher=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_cipher" >&5 -$as_echo "$ac_cv_enable_openssl_evp_cipher" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_cipher" >&5 +printf "%s\n" "$ac_cv_enable_openssl_evp_cipher" >&6; } # Check whether --enable-openssl-evp-md was given. -if test "${enable_openssl_evp_md+set}" = set; then : +if test ${enable_openssl_evp_md+y} +then : enableval=$enable_openssl_evp_md; ac_cv_enable_openssl_evp_md=$enableval -else +else $as_nop ac_cv_enable_openssl_evp_md=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP MD support, or no to disable" >&5 -$as_echo_n "checking whether to enable enable OpenSSL EVP MD support, or no to disable... " >&6; } -if ${ac_cv_enable_openssl_evp_md+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable enable OpenSSL EVP MD support, or no to disable" >&5 +printf %s "checking whether to enable enable OpenSSL EVP MD support, or no to disable... " >&6; } +if test ${ac_cv_enable_openssl_evp_md+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_openssl_evp_md=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_md" >&5 -$as_echo "$ac_cv_enable_openssl_evp_md" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_openssl_evp_md" >&5 +printf "%s\n" "$ac_cv_enable_openssl_evp_md" >&6; } - if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_openssl" = xno; then : + if test "x$ac_cv_enable_static_executables" != xyes +then : + if test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_openssl" = xno +then : ac_cv_libcrypto=no -else - if test "x$ac_cv_with_openssl" != x && test "x$ac_cv_with_openssl" != xauto-detect; then : - if test -d "$ac_cv_with_openssl"; then : +else $as_nop + if test "x$ac_cv_with_openssl" != x && test "x$ac_cv_with_openssl" != xauto-detect +then : + if test -d "$ac_cv_with_openssl" +then : CFLAGS="$CFLAGS -I${ac_cv_with_openssl}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_openssl}/lib" -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "no such directory: $ac_cv_with_openssl See \`config.log' for more details" "$LINENO" 5; } fi -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl" >&5 -$as_echo_n "checking for openssl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl >= 1.0" >&5 +printf %s "checking for openssl >= 1.0... " >&6; } if test -n "$openssl_CFLAGS"; then pkg_cv_openssl_CFLAGS="$openssl_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_openssl_CFLAGS=`$PKG_CONFIG --cflags "openssl >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -53740,10 +61470,10 @@ pkg_cv_openssl_LIBS="$openssl_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl >= 1.0") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_openssl_LIBS=`$PKG_CONFIG --libs "openssl >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -53757,8 +61487,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -53766,73 +61496,67 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.0" 2>&1` + openssl_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl >= 1.0" 2>&1` else - openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.0" 2>&1` + openssl_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl >= 1.0" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$openssl_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$openssl_PKG_ERRORS" >&5 - ac_cv_libcrypto=no + ac_cv_libcrypto=no ac_cv_libcrypto_evp=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libcrypto=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libcrypto=no ac_cv_libcrypto_evp=no else - openssl_CFLAGS=$pkg_cv_openssl_CFLAGS - openssl_LIBS=$pkg_cv_openssl_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libcrypto=yes + openssl_CFLAGS=$pkg_cv_openssl_CFLAGS + openssl_LIBS=$pkg_cv_openssl_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes fi fi - if test "x$ac_cv_libcrypto" = xyes; then : + if test "x$ac_cv_libcrypto" = xyes +then : ac_cv_libcrypto_CPPFLAGS="$pkg_cv_openssl_CFLAGS" ac_cv_libcrypto_LIBADD="$pkg_cv_openssl_LIBS" fi fi - if test "x$ac_cv_libcrypto" != xyes; then : - for ac_header in openssl/opensslv.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/opensslv.h" "ac_cv_header_openssl_opensslv_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_opensslv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_OPENSSLV_H 1 -_ACEOF + if test "x$ac_cv_libcrypto" != xyes +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/opensslv.h" "ac_cv_header_openssl_opensslv_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_opensslv_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_OPENSSLV_H 1" >>confdefs.h fi -done - - for ac_header in openssl/evp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_evp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_EVP_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_evp_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_evp_h" = xno; then : + if test "x$ac_cv_header_openssl_evp_h" = xno +then : ac_cv_libcrypto=no ac_cv_libcrypto_evp=no -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openssl/evp.h can be used in combination with zlib.h" >&5 -$as_echo_n "checking if openssl/evp.h can be used in combination with zlib.h... " >&6; } -if ${ac_cv_openssl_evp_zlib_compatible+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if openssl/evp.h can be used in combination with zlib.h" >&5 +printf %s "checking if openssl/evp.h can be used in combination with zlib.h... " >&6; } +if test ${ac_cv_openssl_evp_zlib_compatible+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -53844,19 +61568,20 @@ #include #include int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_openssl_evp_zlib_compatible=yes -else +else $as_nop ac_cv_openssl_evp_zlib_compatible=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -53865,14 +61590,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_openssl_evp_zlib_compatible" >&5 -$as_echo "$ac_cv_openssl_evp_zlib_compatible" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_openssl_evp_zlib_compatible" >&5 +printf "%s\n" "$ac_cv_openssl_evp_zlib_compatible" >&6; } - if test "x$ac_cv_openssl_evp_zlib_compatible" = xyes; then : + if test "x$ac_cv_openssl_evp_zlib_compatible" = xyes +then : ac_cv_libcrypto=yes ac_cv_libcrypto_evp=yes -else +else $as_nop ac_cv_libcrypto=no ac_cv_libcrypto_evp=no fi @@ -53880,36 +61606,53 @@ fi - if test "x$ac_cv_libcrypto_evp" != xyes && test "$ac_cv_header_openssl_opensslv" = xyes; then : + if test "x$ac_cv_libcrypto_evp" != xyes && test "$ac_cv_header_openssl_opensslv" = xyes +then : ac_cv_libcrypto=yes fi fi - if test "x$ac_cv_libcrypto" = xyes && test "x$ac_cv_libcrypto_evp" = xyes; then : + if test "x$ac_cv_libcrypto" = xyes && test "x$ac_cv_libcrypto_evp" = xyes +then : -$as_echo "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_OPENSSL_EVP_H 1" >>confdefs.h HAVE_OPENSSL_EVP_H=1 -else +else $as_nop HAVE_OPENSSL_EVP_H=0 fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : -$as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h - ac_cv_libcrypto_LIBADD="-lcrypto" + ac_cv_libcrypto_CPPFLAGS="$openssl_CFLAGS" + ac_cv_libcrypto_LIBADD="$openssl_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_libcrypto_LIBADD" = x +then : + ac_cv_libcrypto_LIBADD="-lcrypto" +fi + + case $host in #( + *cygwin*) : + ac_cv_libcrypto_LIBADD="$ac_cv_libcrypto_LIBADD -lz" ;; #( + *) : + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53918,30 +61661,29 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : LIBDL_LIBADD="-ldl" fi @@ -53951,25 +61693,30 @@ fi +fi - if test "x$ac_cv_libcrypto_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcrypto_CPPFLAGS" != "x" +then : LIBCRYPTO_CPPFLAGS=$ac_cv_libcrypto_CPPFLAGS fi - if test "x$ac_cv_libcrypto_LIBADD" != "x"; then : + if test "x$ac_cv_libcrypto_LIBADD" != "x" +then : LIBCRYPTO_LIBADD=$ac_cv_libcrypto_LIBADD fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : ax_libcrypto_pc_libs_private=-lcrypto fi - if test "x$ac_cv_libcrypto" != xno; then : + if test "x$ac_cv_libcrypto" != xno +then : ax_libcrypto_spec_requires=openssl ax_libcrypto_spec_build_requires=openssl-devel @@ -53978,15 +61725,18 @@ fi - if test "x$ac_cv_libcrypto" != xno; then : - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes; then : + if test "x$ac_cv_libcrypto" != xno +then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes +then : ac_cv_libcrypto_evp_cipher=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -53995,42 +61745,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_new (); int -main () +main (void) { return EVP_CIPHER_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54039,42 +61790,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_free (); int -main () +main (void) { return EVP_CIPHER_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54083,40 +61834,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_init (); int -main () +main (void) { return EVP_CIPHER_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54125,41 +61876,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_cleanup (); int -main () +main (void) { return EVP_CIPHER_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54168,43 +61919,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_CipherInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54213,41 +61964,171 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char EVP_CIPHER_CTX_set_padding (); +char EVP_CipherInit_ex2 (); int -main () +main (void) { -return EVP_CIPHER_CTX_set_padding (); +return EVP_CipherInit_ex2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes -else - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CipherInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_CipherInit_ex2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_CTX_reset (); +int +main (void) +{ +return EVP_CIPHER_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop ac_cv_libcrypto_evp_cipher=no fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_fetch in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_fetch (); +int +main (void) +{ +return EVP_CIPHER_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_free in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_free (); +int +main (void) +{ +return EVP_CIPHER_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_CipherInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54256,40 +62137,85 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherInit_ex (); int -main () +main (void) { return EVP_CipherInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_CTX_set_padding (); +int +main (void) +{ +return EVP_CIPHER_CTX_set_padding (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherUpdate in -lcrypto" >&5 +printf %s "checking for EVP_CipherUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54298,40 +62224,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherUpdate (); int -main () +main (void) { return EVP_CipherUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_CipherFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54340,70 +62266,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherFinal_ex (); int -main () +main (void) { return EVP_CipherFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - if test "x$ac_cv_enable_openssl_evp_cipher" = xyes && "x$ac_cv_libcrypto_evp_cipher" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_cipher" = xyes && test "x$ac_cv_libcrypto_evp_cipher" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP CIPHER support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes +then : -$as_echo "#define HAVE_EVP_CIPHER_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CIPHER_CTX_INIT 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_CIPHER_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CIPHER_CTX_CLEANUP 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_CIPHERINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_cipher" != xyes; then : + if test "x$ac_cv_libcrypto_evp_cipher" != xyes +then : ac_cv_libcrypto_aes_cbc=no -else +else $as_nop ac_cv_libcrypto_aes_cbc=libcrypto_evp - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_cbc in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_128_cbc in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_128_cbc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_cbc in -lcrypto" >&5 +printf %s "checking for EVP_aes_128_cbc in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_128_cbc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54412,40 +62350,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_128_cbc (); int -main () +main (void) { return EVP_aes_128_cbc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_128_cbc=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_128_cbc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_cbc" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_128_cbc" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_cbc" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_128_cbc" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_cbc=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_192_cbc in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_192_cbc in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_192_cbc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_192_cbc in -lcrypto" >&5 +printf %s "checking for EVP_aes_192_cbc in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_192_cbc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54454,40 +62392,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_192_cbc (); int -main () +main (void) { return EVP_aes_192_cbc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_192_cbc=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_192_cbc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_192_cbc" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_192_cbc" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_192_cbc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_192_cbc" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_192_cbc" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_192_cbc" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_cbc=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_256_cbc in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_256_cbc in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_256_cbc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_256_cbc in -lcrypto" >&5 +printf %s "checking for EVP_aes_256_cbc in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_256_cbc+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54496,53 +62434,55 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_256_cbc (); int -main () +main (void) { return EVP_aes_256_cbc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_256_cbc=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_256_cbc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_256_cbc" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_256_cbc" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_256_cbc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_256_cbc" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_256_cbc" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_256_cbc" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_cbc=no fi - if test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_192_cbc" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_cbc" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_aes_128_cbc" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_192_cbc" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_cbc" = xyes +then : -$as_echo "#define HAVE_EVP_CRYPTO_AES_CBC 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CRYPTO_AES_CBC 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes +then : ac_cv_libcrypto_evp_cipher=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54551,42 +62491,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_new (); int -main () +main (void) { return EVP_CIPHER_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54595,42 +62536,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_free (); int -main () +main (void) { return EVP_CIPHER_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54639,40 +62580,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_init (); int -main () +main (void) { return EVP_CIPHER_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54681,41 +62622,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_cleanup (); int -main () +main (void) { return EVP_CIPHER_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54724,43 +62665,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_CipherInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54769,41 +62710,171 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char EVP_CIPHER_CTX_set_padding (); +char EVP_CipherInit_ex2 (); int -main () +main (void) { -return EVP_CIPHER_CTX_set_padding (); +return EVP_CipherInit_ex2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes -else - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CipherInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_CipherInit_ex2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_CTX_reset (); +int +main (void) +{ +return EVP_CIPHER_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop ac_cv_libcrypto_evp_cipher=no fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_fetch in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_fetch (); +int +main (void) +{ +return EVP_CIPHER_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_free in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_free (); +int +main (void) +{ +return EVP_CIPHER_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_CipherInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54812,40 +62883,85 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherInit_ex (); int -main () +main (void) { return EVP_CipherInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_CTX_set_padding (); +int +main (void) +{ +return EVP_CIPHER_CTX_set_padding (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherUpdate in -lcrypto" >&5 +printf %s "checking for EVP_CipherUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54854,40 +62970,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherUpdate (); int -main () +main (void) { return EVP_CipherUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_CipherFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54896,70 +63012,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherFinal_ex (); int -main () +main (void) { return EVP_CipherFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - if test "x$ac_cv_enable_openssl_evp_cipher" = xyes && "x$ac_cv_libcrypto_evp_cipher" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_cipher" = xyes && test "x$ac_cv_libcrypto_evp_cipher" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP CIPHER support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_CIPHER_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_CIPHER_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CIPHER_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_CIPHER_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CIPHERINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_cipher" != xyes; then : + if test "x$ac_cv_libcrypto_evp_cipher" != xyes +then : ac_cv_libcrypto_aes_ecb=no -else +else $as_nop ac_cv_libcrypto_aes_ecb=libcrypto_evp - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_ecb in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_128_ecb in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_128_ecb+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_ecb in -lcrypto" >&5 +printf %s "checking for EVP_aes_128_ecb in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_128_ecb+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -54968,40 +63096,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_128_ecb (); int -main () +main (void) { return EVP_aes_128_ecb (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_128_ecb=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_128_ecb=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_ecb" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_128_ecb" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_128_ecb" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_ecb" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_128_ecb" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_128_ecb" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_ecb=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_192_ecb in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_192_ecb in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_192_ecb+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_192_ecb in -lcrypto" >&5 +printf %s "checking for EVP_aes_192_ecb in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_192_ecb+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55010,40 +63138,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_192_ecb (); int -main () +main (void) { return EVP_aes_192_ecb (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_192_ecb=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_192_ecb=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_192_ecb" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_192_ecb" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_192_ecb" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_192_ecb" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_192_ecb" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_192_ecb" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_ecb=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_256_ecb in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_256_ecb in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_256_ecb+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_256_ecb in -lcrypto" >&5 +printf %s "checking for EVP_aes_256_ecb in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_256_ecb+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55052,39 +63180,39 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_256_ecb (); int -main () +main (void) { return EVP_aes_256_ecb (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_256_ecb=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_256_ecb=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_256_ecb" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_256_ecb" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_256_ecb" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_256_ecb" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_256_ecb" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_256_ecb" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_ecb=no fi - if test "x$ac_cv_lib_crypto_EVP_aes_128_ecb" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_192_ecb" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_ecb" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_aes_128_ecb" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_192_ecb" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_ecb" = xyes +then : -$as_echo "#define HAVE_EVP_CRYPTO_AES_ECB 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CRYPTO_AES_ECB 1" >>confdefs.h fi @@ -55092,38 +63220,37 @@ fi - if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno; then : + if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno +then : ac_cv_libcrypto_aes=no -else +else $as_nop ac_cv_libcrypto_aes=libcrypto_evp fi - if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno; then : - for ac_header in openssl/aes.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "openssl/aes.h" "ac_cv_header_openssl_aes_h" "$ac_includes_default" -if test "x$ac_cv_header_openssl_aes_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENSSL_AES_H 1 -_ACEOF + if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno +then : + ac_fn_c_check_header_compile "$LINENO" "openssl/aes.h" "ac_cv_header_openssl_aes_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_aes_h" = xyes +then : + printf "%s\n" "#define HAVE_OPENSSL_AES_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_openssl_aes_h" = xno; then : + if test "x$ac_cv_header_openssl_aes_h" = xno +then : ac_cv_libcrypto_aes_cbc=no ac_cv_libcrypto_aes_ecb=no -else +else $as_nop ac_cv_libcrypto_aes_cbc=libcrypto ac_cv_libcrypto_aes_ecb=libcrypto - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_set_decrypt_key in -lcrypto" >&5 -$as_echo_n "checking for AES_set_decrypt_key in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_AES_set_decrypt_key+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AES_set_decrypt_key in -lcrypto" >&5 +printf %s "checking for AES_set_decrypt_key in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_AES_set_decrypt_key+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55132,41 +63259,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char AES_set_decrypt_key (); int -main () +main (void) { return AES_set_decrypt_key (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_AES_set_decrypt_key=yes -else +else $as_nop ac_cv_lib_crypto_AES_set_decrypt_key=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_set_decrypt_key" >&5 -$as_echo "$ac_cv_lib_crypto_AES_set_decrypt_key" >&6; } -if test "x$ac_cv_lib_crypto_AES_set_decrypt_key" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_set_decrypt_key" >&5 +printf "%s\n" "$ac_cv_lib_crypto_AES_set_decrypt_key" >&6; } +if test "x$ac_cv_lib_crypto_AES_set_decrypt_key" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_cbc=no, ac_cv_libcrypto_aes_ecb=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_set_encrypt_key in -lcrypto" >&5 -$as_echo_n "checking for AES_set_encrypt_key in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_AES_set_encrypt_key+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AES_set_encrypt_key in -lcrypto" >&5 +printf %s "checking for AES_set_encrypt_key in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_AES_set_encrypt_key+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55175,42 +63302,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char AES_set_encrypt_key (); int -main () +main (void) { return AES_set_encrypt_key (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_AES_set_encrypt_key=yes -else +else $as_nop ac_cv_lib_crypto_AES_set_encrypt_key=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_set_encrypt_key" >&5 -$as_echo "$ac_cv_lib_crypto_AES_set_encrypt_key" >&6; } -if test "x$ac_cv_lib_crypto_AES_set_encrypt_key" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_set_encrypt_key" >&5 +printf "%s\n" "$ac_cv_lib_crypto_AES_set_encrypt_key" >&6; } +if test "x$ac_cv_lib_crypto_AES_set_encrypt_key" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_cbc=no, ac_cv_libcrypto_aes_ecb=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_cbc_encrypt in -lcrypto" >&5 -$as_echo_n "checking for AES_cbc_encrypt in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_AES_cbc_encrypt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AES_cbc_encrypt in -lcrypto" >&5 +printf %s "checking for AES_cbc_encrypt in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_AES_cbc_encrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55219,41 +63346,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char AES_cbc_encrypt (); int -main () +main (void) { return AES_cbc_encrypt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_AES_cbc_encrypt=yes -else +else $as_nop ac_cv_lib_crypto_AES_cbc_encrypt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_cbc_encrypt" >&5 -$as_echo "$ac_cv_lib_crypto_AES_cbc_encrypt" >&6; } -if test "x$ac_cv_lib_crypto_AES_cbc_encrypt" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_cbc_encrypt" >&5 +printf "%s\n" "$ac_cv_lib_crypto_AES_cbc_encrypt" >&6; } +if test "x$ac_cv_lib_crypto_AES_cbc_encrypt" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_cbc=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_ecb_encrypt in -lcrypto" >&5 -$as_echo_n "checking for AES_ecb_encrypt in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_AES_ecb_encrypt+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AES_ecb_encrypt in -lcrypto" >&5 +printf %s "checking for AES_ecb_encrypt in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_AES_ecb_encrypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55262,75 +63389,81 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char AES_ecb_encrypt (); int -main () +main (void) { return AES_ecb_encrypt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_AES_ecb_encrypt=yes -else +else $as_nop ac_cv_lib_crypto_AES_ecb_encrypt=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_ecb_encrypt" >&5 -$as_echo "$ac_cv_lib_crypto_AES_ecb_encrypt" >&6; } -if test "x$ac_cv_lib_crypto_AES_ecb_encrypt" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_AES_ecb_encrypt" >&5 +printf "%s\n" "$ac_cv_lib_crypto_AES_ecb_encrypt" >&6; } +if test "x$ac_cv_lib_crypto_AES_ecb_encrypt" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_ecb=no fi - if test "x$ac_cv_lib_crypto_AES_cbc_encrypt" = xyes; then : + if test "x$ac_cv_lib_crypto_AES_cbc_encrypt" = xyes +then : -$as_echo "#define HAVE_AES_CBC_ENCRYPT 1" >>confdefs.h +printf "%s\n" "#define HAVE_AES_CBC_ENCRYPT 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_AES_ecb_encrypt" = xyes; then : + if test "x$ac_cv_lib_crypto_AES_ecb_encrypt" = xyes +then : -$as_echo "#define HAVE_AES_ECB_ENCRYPT 1" >>confdefs.h +printf "%s\n" "#define HAVE_AES_ECB_ENCRYPT 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto" = xno; then : - if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno; then : + if test "x$ac_cv_libcrypto" = xno +then : + if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno +then : ac_cv_libcrypto=yes fi fi - if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno; then : + if test "x$ac_cv_libcrypto_aes_cbc" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno +then : ac_cv_libcrypto_aes=no -else +else $as_nop ac_cv_libcrypto_aes=libcrypto fi fi - if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes; then : + if test "x$ac_cv_libcrypto_evp" = xyes && test "x$ac_cv_enable_openssl_evp_cipher" != xno && test "x$ac_cv_libcrypto_evp_cipher" != xyes +then : ac_cv_libcrypto_evp_cipher=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_new in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_new in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_new in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55339,42 +63472,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_new (); int -main () +main (void) { return EVP_CIPHER_CTX_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_new=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_dummy=no fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_free in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_free in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_free+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_new" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_free in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55383,42 +63517,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_free (); int -main () +main (void) { return EVP_CIPHER_CTX_free (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_free=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_free=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_free" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55427,40 +63561,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_init (); int -main () +main (void) { return EVP_CIPHER_CTX_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_init=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_init=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_cleanup in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_cleanup in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_cleanup in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_cleanup in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55469,41 +63603,41 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CIPHER_CTX_cleanup (); int -main () +main (void) { return EVP_CIPHER_CTX_cleanup (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 -$as_echo_n "checking for ERR_remove_thread_state in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_ERR_remove_thread_state+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ERR_remove_thread_state in -lcrypto" >&5 +printf %s "checking for ERR_remove_thread_state in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_ERR_remove_thread_state+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55512,43 +63646,43 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ERR_remove_thread_state (); int -main () +main (void) { return ERR_remove_thread_state (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_ERR_remove_thread_state=yes -else +else $as_nop ac_cv_lib_crypto_ERR_remove_thread_state=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 -$as_echo "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } -if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_ERR_remove_thread_state" >&5 +printf "%s\n" "$ac_cv_lib_crypto_ERR_remove_thread_state" >&6; } +if test "x$ac_cv_lib_crypto_ERR_remove_thread_state" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 -$as_echo_n "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex2 in -lcrypto" >&5 +printf %s "checking for EVP_CipherInit_ex2 in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherInit_ex2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55557,41 +63691,171 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char EVP_CIPHER_CTX_set_padding (); +char EVP_CipherInit_ex2 (); int -main () +main (void) { -return EVP_CIPHER_CTX_set_padding (); +return EVP_CipherInit_ex2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes -else - ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CipherInit_ex2=yes +else $as_nop + ac_cv_lib_crypto_EVP_CipherInit_ex2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex2" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherInit_ex2" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop + ac_cv_libcrypto_dummy=no +fi + + + if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_reset in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_reset in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_reset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_CTX_reset (); +int +main (void) +{ +return EVP_CIPHER_CTX_reset (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_CTX_reset=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_CTX_reset=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop ac_cv_libcrypto_evp_cipher=no fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_fetch in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_fetch in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_fetch+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherInit_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherInit_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_fetch (); +int +main (void) +{ +return EVP_CIPHER_fetch (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_fetch=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_fetch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_fetch" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_fetch" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_fetch" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_free in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_free in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_free+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_free (); +int +main (void) +{ +return EVP_CIPHER_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_free=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_free=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_free" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_free" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_free" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherInit_ex in -lcrypto" >&5 +printf %s "checking for EVP_CipherInit_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherInit_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55600,40 +63864,85 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherInit_ex (); int -main () +main (void) { return EVP_CipherInit_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherInit_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherInit_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherInit_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherInit_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherInit_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherUpdate in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherUpdate in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherUpdate+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_set_padding in -lcrypto" >&5 +printf %s "checking for EVP_CIPHER_CTX_set_padding in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char EVP_CIPHER_CTX_set_padding (); +int +main (void) +{ +return EVP_CIPHER_CTX_set_padding (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=yes +else $as_nop + ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_set_padding" = xyes +then : + ac_cv_libcrypto_dummy=yes +else $as_nop + ac_cv_libcrypto_evp_cipher=no +fi + + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherUpdate in -lcrypto" >&5 +printf %s "checking for EVP_CipherUpdate in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherUpdate+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55642,40 +63951,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherUpdate (); int -main () +main (void) { return EVP_CipherUpdate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherUpdate=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherUpdate=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherUpdate" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherUpdate" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherUpdate" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherUpdate" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherUpdate" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherUpdate" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherFinal_ex in -lcrypto" >&5 -$as_echo_n "checking for EVP_CipherFinal_ex in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_CipherFinal_ex+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_CipherFinal_ex in -lcrypto" >&5 +printf %s "checking for EVP_CipherFinal_ex in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_CipherFinal_ex+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55684,70 +63993,82 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_CipherFinal_ex (); int -main () +main (void) { return EVP_CipherFinal_ex (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_CipherFinal_ex=yes -else +else $as_nop ac_cv_lib_crypto_EVP_CipherFinal_ex=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherFinal_ex" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_CipherFinal_ex" >&6; } -if test "x$ac_cv_lib_crypto_EVP_CipherFinal_ex" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CipherFinal_ex" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_CipherFinal_ex" >&6; } +if test "x$ac_cv_lib_crypto_EVP_CipherFinal_ex" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_evp_cipher=no fi - if test "x$ac_cv_enable_openssl_evp_cipher" = xyes && "x$ac_cv_libcrypto_evp_cipher" = xno; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_enable_openssl_evp_cipher" = xyes && test "x$ac_cv_libcrypto_evp_cipher" = xno +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing OpenSSL EVP CIPHER support See \`config.log' for more details" "$LINENO" 5; } fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_CIPHER_CTX_INIT 1" >>confdefs.h + + +fi + + if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes +then : -$as_echo "#define HAVE_EVP_CIPHER_CTX_INIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CIPHER_CTX_CLEANUP 1" >>confdefs.h fi - if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_cleanup" = xyes; then : + if test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes +then : -$as_echo "#define HAVE_EVP_CIPHER_CTX_CLEANUP 1" >>confdefs.h +printf "%s\n" "#define HAVE_EVP_CIPHERINIT_EX2 1" >>confdefs.h fi fi - if test "x$ac_cv_libcrypto_evp_cipher" != xyes; then : + if test "x$ac_cv_libcrypto_evp_cipher" != xyes +then : ac_cv_libcrypto_aes_xts=no -else +else $as_nop ac_cv_libcrypto_aes_xts=libcrypto_evp - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_xts in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_128_xts in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_128_xts+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_xts in -lcrypto" >&5 +printf %s "checking for EVP_aes_128_xts in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_128_xts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55756,40 +64077,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_128_xts (); int -main () +main (void) { return EVP_aes_128_xts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_128_xts=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_128_xts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_xts" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_128_xts" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_xts" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_128_xts" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_xts=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_256_xts in -lcrypto" >&5 -$as_echo_n "checking for EVP_aes_256_xts in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_EVP_aes_256_xts+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_256_xts in -lcrypto" >&5 +printf %s "checking for EVP_aes_256_xts in -lcrypto... " >&6; } +if test ${ac_cv_lib_crypto_EVP_aes_256_xts+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -55798,40 +64119,122 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char EVP_aes_256_xts (); int -main () +main (void) { return EVP_aes_256_xts (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_crypto_EVP_aes_256_xts=yes -else +else $as_nop ac_cv_lib_crypto_EVP_aes_256_xts=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_256_xts" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_aes_256_xts" >&6; } -if test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_256_xts" >&5 +printf "%s\n" "$ac_cv_lib_crypto_EVP_aes_256_xts" >&6; } +if test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes +then : ac_cv_libcrypto_dummy=yes -else +else $as_nop ac_cv_libcrypto_aes_xts=no fi - if test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if \`EVP_CipherInit_ex' can be used with duplicate keys" >&5 +printf %s "checking if \`EVP_CipherInit_ex' can be used with duplicate keys... " >&6; } +if test ${ac_cv_openssl_xts_duplicate_keys+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_cv_libcrypto_backup_LIBS="$LIBS" + LIBS="$LIBS $ac_cv_libcrypto_LIBADD" + if test "$cross_compiling" = yes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +int +main (void) +{ +unsigned char key[ 16 ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; +int result = 0; + +#if defined( HAVE_EVP_CIPHER_CTX_INIT ) +EVP_CIPHER_CTX ctx; + +EVP_CIPHER_CTX_init( &ctx ); +#else +EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); +#endif + +result = EVP_CipherInit_ex(ctx, EVP_aes_128_xts(), NULL, key, key, 0); + +#if defined( HAVE_EVP_CIPHER_CTX_INIT ) +EVP_CIPHER_CTX_cleanup( &ctx ); +#else +EVP_CIPHER_CTX_free( ctx ); +#endif + +if( result != 1 ) return( EXIT_FAILURE ); + +return( EXIT_SUCCESS ); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_openssl_xts_duplicate_keys=yes +else $as_nop + ac_cv_openssl_xts_duplicate_keys=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LIBS="$ac_cv_libcrypto_backup_LIBS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_openssl_xts_duplicate_keys" >&5 +printf "%s\n" "$ac_cv_openssl_xts_duplicate_keys" >&6; } + + if test "x$ac_cv_openssl_xts_duplicate_keys" = xno +then : + ac_cv_libcrypto_aes_xts=no +else $as_nop + if test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes +then : + +printf "%s\n" "#define HAVE_EVP_CRYPTO_AES_XTS 1" >>confdefs.h -$as_echo "#define HAVE_EVP_CRYPTO_AES_XTS 1" >>confdefs.h +fi fi @@ -55839,21 +64242,24 @@ fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_aes_cbc" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_aes_cbc" = xno +then : ac_cv_libcaes_aes_cbc=local -else +else $as_nop ac_cv_libcaes_aes_cbc=$ac_cv_libcrypto_aes_cbc fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_aes_ecb" = xno +then : ac_cv_libcaes_aes_ecb=local -else +else $as_nop ac_cv_libcaes_aes_ecb=$ac_cv_libcrypto_aes_ecb fi - if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_aes_xts" = xno; then : + if test "x$ac_cv_libcrypto" = xno || test "x$ac_cv_libcrypto_aes_xts" = xno +then : ac_cv_libcaes_aes_xts=local -else +else $as_nop ac_cv_libcaes_aes_xts=$ac_cv_libcrypto_aes_xts fi @@ -55864,7 +64270,7 @@ -$as_echo "#define HAVE_LOCAL_LIBCAES 1" >>confdefs.h +printf "%s\n" "#define HAVE_LOCAL_LIBCAES 1" >>confdefs.h HAVE_LOCAL_LIBCAES=1 @@ -55879,24 +64285,28 @@ HAVE_LOCAL_LIBCAES_FALSE= fi - if test "x$ac_cv_libcaes_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libcaes_CPPFLAGS" != "x" +then : LIBCAES_CPPFLAGS=$ac_cv_libcaes_CPPFLAGS fi - if test "x$ac_cv_libcaes_LIBADD" != "x"; then : + if test "x$ac_cv_libcaes_LIBADD" != "x" +then : LIBCAES_LIBADD=$ac_cv_libcaes_LIBADD fi - if test "x$ac_cv_libcaes" = xyes; then : + if test "x$ac_cv_libcaes" = xyes +then : ax_libcaes_pc_libs_private=-lcaes fi - if test "x$ac_cv_libcaes" = xyes; then : + if test "x$ac_cv_libcaes" = xyes +then : ax_libcaes_spec_requires=libcaes ax_libcaes_spec_build_requires=libcaes-devel @@ -55905,233 +64315,95 @@ fi - for ac_func in bindtextdomain -do : ac_fn_c_check_func "$LINENO" "bindtextdomain" "ac_cv_func_bindtextdomain" -if test "x$ac_cv_func_bindtextdomain" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BINDTEXTDOMAIN 1 -_ACEOF - -fi -done - - - - - # Check whether --enable-verbose-output was given. -if test "${enable_verbose_output+set}" = set; then : - enableval=$enable_verbose_output; ac_cv_enable_verbose_output=$enableval -else - ac_cv_enable_verbose_output=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable verbose output" >&5 -$as_echo_n "checking whether to enable enable verbose output... " >&6; } -if ${ac_cv_enable_verbose_output+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_enable_verbose_output=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_verbose_output" >&5 -$as_echo "$ac_cv_enable_verbose_output" >&6; } - - if test "x$ac_cv_enable_verbose_output" != xno ; then : - -$as_echo "#define HAVE_VERBOSE_OUTPUT 1" >>confdefs.h - - - ac_cv_enable_verbose_output=yes -fi - - - +if test "x$ac_cv_func_bindtextdomain" = xyes +then : + printf "%s\n" "#define HAVE_BINDTEXTDOMAIN 1" >>confdefs.h - # Check whether --enable-debug-output was given. -if test "${enable_debug_output+set}" = set; then : - enableval=$enable_debug_output; ac_cv_enable_debug_output=$enableval -else - ac_cv_enable_debug_output=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable enable debug output" >&5 -$as_echo_n "checking whether to enable enable debug output... " >&6; } -if ${ac_cv_enable_debug_output+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_enable_debug_output=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_debug_output" >&5 -$as_echo "$ac_cv_enable_debug_output" >&6; } - - if test "x$ac_cv_enable_debug_output" != xno ; then : - -$as_echo "#define HAVE_DEBUG_OUTPUT 1" >>confdefs.h - - - ac_cv_enable_debug_output=yes -fi - - - if test "x$enable_shared" = xyes; then : - case $host in #( - *cygwin* | *mingw*) : - -$as_echo "#define HAVE_DLLMAIN 1" >>confdefs.h - - HAVE_DLLMAIN=1 - - ;; #( - *) : - ;; -esac -fi # Check whether --with-pyprefix was given. -if test "${with_pyprefix+set}" = set; then : +if test ${with_pyprefix+y} +then : withval=$with_pyprefix; ac_cv_with_pyprefix=$withval -else +else $as_nop ac_cv_with_pyprefix=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use \`python-config --prefix' to determine the prefix of pythondir instead of --prefix" >&5 -$as_echo_n "checking whether to use use \`python-config --prefix' to determine the prefix of pythondir instead of --prefix... " >&6; } -if ${ac_cv_with_pyprefix+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use use \`python-config --prefix' to determine the prefix of pythondir instead of --prefix" >&5 +printf %s "checking whether to use use \`python-config --prefix' to determine the prefix of pythondir instead of --prefix... " >&6; } +if test ${ac_cv_with_pyprefix+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_pyprefix=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pyprefix" >&5 -$as_echo "$ac_cv_with_pyprefix" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pyprefix" >&5 +printf "%s\n" "$ac_cv_with_pyprefix" >&6; } # Check whether --enable-python was given. -if test "${enable_python+set}" = set; then : +if test ${enable_python+y} +then : enableval=$enable_python; ac_cv_enable_python=$enableval -else +else $as_nop ac_cv_enable_python=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python bindings" >&5 -$as_echo_n "checking whether to enable build Python bindings... " >&6; } -if ${ac_cv_enable_python+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python bindings" >&5 +printf %s "checking whether to enable build Python bindings... " >&6; } +if test ${ac_cv_enable_python+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_enable_python=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python" >&5 -$as_echo "$ac_cv_enable_python" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python" >&5 +printf "%s\n" "$ac_cv_enable_python" >&6; } # Check whether --with-pythondir was given. -if test "${with_pythondir+set}" = set; then : +if test ${with_pythondir+y} +then : withval=$with_pythondir; ac_cv_with_pythondir=$withval -else +else $as_nop ac_cv_with_pythondir=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python directory (pythondir)" >&5 -$as_echo_n "checking whether to use use to specify the Python directory (pythondir)... " >&6; } -if ${ac_cv_with_pythondir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python directory (pythondir)" >&5 +printf %s "checking whether to use use to specify the Python directory (pythondir)... " >&6; } +if test ${ac_cv_with_pythondir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_pythondir=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir" >&5 -$as_echo "$ac_cv_with_pythondir" >&6; } - - - # Check whether --enable-python2 was given. -if test "${enable_python2+set}" = set; then : - enableval=$enable_python2; ac_cv_enable_python2=$enableval -else - ac_cv_enable_python2=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python 2 bindings" >&5 -$as_echo_n "checking whether to enable build Python 2 bindings... " >&6; } -if ${ac_cv_enable_python2+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_enable_python2=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python2" >&5 -$as_echo "$ac_cv_enable_python2" >&6; } - - -# Check whether --with-pythondir2 was given. -if test "${with_pythondir2+set}" = set; then : - withval=$with_pythondir2; ac_cv_with_pythondir2=$withval -else - ac_cv_with_pythondir2=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python 2 directory (pythondir2)" >&5 -$as_echo_n "checking whether to use use to specify the Python 2 directory (pythondir2)... " >&6; } -if ${ac_cv_with_pythondir2+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_with_pythondir2=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir2" >&5 -$as_echo "$ac_cv_with_pythondir2" >&6; } - - - # Check whether --enable-python3 was given. -if test "${enable_python3+set}" = set; then : - enableval=$enable_python3; ac_cv_enable_python3=$enableval -else - ac_cv_enable_python3=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build Python 3 bindings" >&5 -$as_echo_n "checking whether to enable build Python 3 bindings... " >&6; } -if ${ac_cv_enable_python3+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_enable_python3=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_python3" >&5 -$as_echo "$ac_cv_enable_python3" >&6; } - - -# Check whether --with-pythondir3 was given. -if test "${with_pythondir3+set}" = set; then : - withval=$with_pythondir3; ac_cv_with_pythondir3=$withval -else - ac_cv_with_pythondir3=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use use to specify the Python 3 directory (pythondir3)" >&5 -$as_echo_n "checking whether to use use to specify the Python 3 directory (pythondir3)... " >&6; } -if ${ac_cv_with_pythondir3+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_with_pythondir3=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir3" >&5 -$as_echo "$ac_cv_with_pythondir3" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_pythondir" >&5 +printf "%s\n" "$ac_cv_with_pythondir" >&6; } - if test "x${ac_cv_enable_python}" != xno; then : - if test "x${PYTHON_VERSION}" != x; then : + if test "x${ac_cv_enable_python}" != xno +then : + if test "x${PYTHON_VERSION}" != x +then : ax_python_progs="python${PYTHON_VERSION}" -else - ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0" +else $as_nop + ax_python_progs="python python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5" fi for ac_prog in $ax_python_progs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PYTHON+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PYTHON"; then ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. else @@ -56139,11 +64411,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -56154,43 +64430,94 @@ fi PYTHON=$ac_cv_prog_PYTHON if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +printf "%s\n" "$PYTHON" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$PYTHON" && break done - if test "x${PYTHON}" != x; then : - ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write(sys.version[:3])" 2>/dev/null`; - PYTHON_VERSION=$ax_prog_python_version - - + if test "x${PYTHON}" != x +then : + ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write('%d.%d' % (sys.version_info[0], sys.version_info[1]))" 2>/dev/null`; ax_prog_python_platform=`${PYTHON} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; PYTHON_PLATFORM=$ax_prog_python_platform -else +else $as_nop as_fn_error $? "Unable to find python" "$LINENO" 5 fi PYTHON=$PYTHON - if test "x${PYTHON}" != x; then : - for ac_prog in python${PYTHON_VERSION}-config python-config + if test "x${PYTHON_CONFIG}" = x && test "x${PYTHON_VERSION}" != x +then : + for ac_prog in python${PYTHON_VERSION}-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PYTHON_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PYTHON_CONFIG"; then + ac_cv_prog_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PYTHON_CONFIG="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PYTHON_CONFIG=$ac_cv_prog_PYTHON_CONFIG +if test -n "$PYTHON_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5 +printf "%s\n" "$PYTHON_CONFIG" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PYTHON_CONFIG" && break +done + + +fi + if test "x${PYTHON_CONFIG}" = x +then : + for ac_prog in python-config python3-config python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config python2-config python2.7-config python2.6-config python2.5-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PYTHON_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PYTHON_CONFIG"; then ac_cv_prog_PYTHON_CONFIG="$PYTHON_CONFIG" # Let the user override the test. else @@ -56198,11 +64525,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON_CONFIG="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -56213,11 +64544,11 @@ fi PYTHON_CONFIG=$ac_cv_prog_PYTHON_CONFIG if test -n "$PYTHON_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5 -$as_echo "$PYTHON_CONFIG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CONFIG" >&5 +printf "%s\n" "$PYTHON_CONFIG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -56226,7 +64557,8 @@ fi - if test "x${PYTHON_CONFIG}" = x; then : + if test "x${PYTHON_CONFIG}" = x +then : as_fn_error $? "Unable to find python-config" "$LINENO" 5 fi @@ -56234,20 +64566,21 @@ - if test "x${PYTHON_CONFIG}" != x; then : + if test "x${PYTHON_CONFIG}" != x +then : PYTHON_INCLUDES=`${PYTHON_CONFIG} --includes 2>/dev/null`; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python includes" >&5 -$as_echo_n "checking for Python includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_INCLUDES" >&5 -$as_echo "$PYTHON_INCLUDES" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Python includes" >&5 +printf %s "checking for Python includes... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_INCLUDES" >&5 +printf "%s\n" "$PYTHON_INCLUDES" >&6; } PYTHON_LDFLAGS=`${PYTHON_CONFIG} --ldflags 2>/dev/null`; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python libraries" >&5 -$as_echo_n "checking for Python libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 -$as_echo "$PYTHON_LDFLAGS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Python libraries" >&5 +printf %s "checking for Python libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 +printf "%s\n" "$PYTHON_LDFLAGS" >&6; } case $host_os in #( cygwin*) : @@ -56261,47 +64594,48 @@ BACKUP_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${PYTHON_INCLUDES}" - for ac_header in Python.h + for ac_header in Python.h do : - ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" -if test "x$ac_cv_header_Python_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PYTHON_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" +if test "x$ac_cv_header_Python_h" = xyes +then : + printf "%s\n" "#define HAVE_PYTHON_H 1" >>confdefs.h ac_cv_header_python_h=yes -else +else $as_nop ac_cv_header_python_h=no fi done - CPPFLAGS="${BACKUP_CPPFLAGS}" fi - if test "x${ac_cv_header_python_h}" != xyes; then : + if test "x${ac_cv_header_python_h}" != xyes +then : ac_cv_enable_python=no -else - ac_cv_enable_python=$PYTHON_VERSION +else $as_nop + ac_cv_enable_python=${ax_prog_python_version} PYTHON_CPPFLAGS=$PYTHON_INCLUDES PYTHON_LDFLAGS=$PYTHON_LDFLAGS - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : + if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno +then : ax_python_prefix="\${prefix}" -else +else $as_nop ax_python_prefix=`${PYTHON_CONFIG} --prefix 2>/dev/null` fi PYTHON_PREFIX=$ax_python_prefix - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : + if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno +then : ax_python_exec_prefix="\${exec_prefix}" -else +else $as_nop ax_python_exec_prefix=`${PYTHON_CONFIG} --exec-prefix 2>/dev/null` fi @@ -56310,13 +64644,15 @@ ax_python_pythondir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; - if test "x${ac_cv_with_pythondir}" = x || test "x${ac_cv_with_pythondir}" = xno; then : - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : + if test "x${ac_cv_with_pythondir}" = x || test "x${ac_cv_with_pythondir}" = xno +then : + if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno +then : ax_python_pythondir="${ax_python_prefix}/${ax_python_pythondir_suffix}" -else - ax_python_pythondir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null` +else $as_nop + ax_python_pythondir=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib()) " 2>/dev/null` fi -else +else $as_nop ax_python_pythondir=$ac_cv_with_pythondir fi @@ -56324,11 +64660,12 @@ ax_python_pyexecdir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; - ax_python_library_dir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; + ax_python_library_dir=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(True)) " 2>/dev/null`; - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : + if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno +then : ax_python_pyexecdir="${ax_python_exec_prefix}/${ax_python_pyexecdir_suffix}" -else +else $as_nop ax_python_pyexecdir=$ax_python_library_dir fi @@ -56345,454 +64682,6 @@ fi - if test "x${ac_cv_enable_python2}" != xno; then : - ax_python2_progs="python2 python2.7 python2.6 python2.5" - for ac_prog in $ax_python2_progs -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON2+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PYTHON2"; then - ac_cv_prog_PYTHON2="$PYTHON2" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PYTHON2="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PYTHON2=$ac_cv_prog_PYTHON2 -if test -n "$PYTHON2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2" >&5 -$as_echo "$PYTHON2" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PYTHON2" && break -done - - if test "x${PYTHON2}" != x; then : - ax_prog_python2_version=`${PYTHON2} -c "import sys; sys.stdout.write(sys.version[:3])" 2>/dev/null`; - PYTHON2_VERSION=$ax_prog_python2_version - - - ax_prog_python2_platform=`${PYTHON2} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; - PYTHON2_PLATFORM=$ax_prog_python2_platform - - -else - as_fn_error $? "Unable to find python2" "$LINENO" 5 - -fi - PYTHON2=$PYTHON2 - - - if test "x${PYTHON2}" != x; then : - for ac_prog in python2-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON2_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PYTHON2_CONFIG"; then - ac_cv_prog_PYTHON2_CONFIG="$PYTHON2_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PYTHON2_CONFIG="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PYTHON2_CONFIG=$ac_cv_prog_PYTHON2_CONFIG -if test -n "$PYTHON2_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_CONFIG" >&5 -$as_echo "$PYTHON2_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PYTHON2_CONFIG" && break -done - - -fi - if test "x${PYTHON2_CONFIG}" = x; then : - as_fn_error $? "Unable to find python2-config" "$LINENO" 5 - -fi - PYTHON2_CONFIG=$PYTHON2_CONFIG - - - - if test "x${PYTHON2_CONFIG}" != x; then : - PYTHON2_INCLUDES=`${PYTHON2_CONFIG} --includes 2>/dev/null`; - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python verison 2 includes" >&5 -$as_echo_n "checking for Python verison 2 includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_INCLUDES" >&5 -$as_echo "$PYTHON2_INCLUDES" >&6; } - - PYTHON2_LDFLAGS=`${PYTHON2_CONFIG} --ldflags 2>/dev/null`; - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 2 libraries" >&5 -$as_echo_n "checking for Python 2 libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON2_LDFLAGS" >&5 -$as_echo "$PYTHON2_LDFLAGS" >&6; } - - case $host_os in #( - cygwin*) : - PYTHON2_LDFLAGS="${PYTHON2_LDFLAGS} -no-undefined" ;; #( - *) : - ;; #( - *) : - ;; -esac - - BACKUP_CPPFLAGS="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} ${PYTHON2_INCLUDES}" - - for ac_header in Python.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" -if test "x$ac_cv_header_Python_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PYTHON_H 1 -_ACEOF - ac_cv_header_python2_h=yes -else - ac_cv_header_python2_h=no -fi - -done - - - CPPFLAGS="${BACKUP_CPPFLAGS}" - -fi - - if test "x${ac_cv_header_python2_h}" != xyes; then : - ac_cv_enable_python2=no -else - ac_cv_enable_python2=$PYTHON2_VERSION - PYTHON2_CPPFLAGS=$PYTHON2_INCLUDES - - - PYTHON2_LDFLAGS=$PYTHON2_LDFLAGS - - - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python2_prefix="\${prefix}" -else - ax_python2_prefix=`${PYTHON2_CONFIG} --prefix 2>/dev/null` -fi - - PYTHON2_PREFIX=$ax_python2_prefix - - - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python2_exec_prefix="\${exec_prefix}" -else - ax_python2_exec_prefix=`${PYTHON2_CONFIG} --exec-prefix 2>/dev/null` -fi - - PYTHON2_EXEC_PREFIX=$ax_python2_exec_prefix - - - ax_python2_pythondir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; - - if test "x${ac_cv_with_pythondir2}" = x || test "x${ac_cv_with_pythondir2}" = xno; then : - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python2_pythondir="${ax_python_prefix}/${ax_python2_pythondir_suffix}" -else - ax_python2_pythondir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null` -fi -else - ax_python2_pythondir=$ac_cv_with_pythondir2 -fi - - pythondir2=$ax_python2_pythondir - - - ax_python2_pyexecdir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; - ax_python2_library_dir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; - - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python2_pyexecdir="${ax_python2_exec_prefix}/${ax_python2_pyexecdir_suffix}" -else - ax_python2_pyexecdir=$ax_python2_library_dir -fi - - pyexecdir2=$ax_python2_pyexecdir - - - PYTHON2_LIBRARY_DIR=$ax_python2_pyexecdir_suffix - - - PYTHON2_PACKAGE_DIR=$ax_python2_library_dir - - -fi - -fi - - if test "x${ac_cv_enable_python3}" != xno; then : - ax_python3_progs="python3 python3.4 python3.3 python3.2 python3.1 python3.0" - for ac_prog in $ax_python3_progs -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON3+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PYTHON3"; then - ac_cv_prog_PYTHON3="$PYTHON3" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PYTHON3="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PYTHON3=$ac_cv_prog_PYTHON3 -if test -n "$PYTHON3"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5 -$as_echo "$PYTHON3" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PYTHON3" && break -done - - if test "x${PYTHON3}" != x; then : - ax_prog_python3_version=`${PYTHON3} -c "import sys; sys.stdout.write(sys.version[:3])" 2>/dev/null`; - PYTHON3_VERSION=$ax_prog_python3_version - - - ax_prog_python3_platform=`${PYTHON3} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; - PYTHON3_PLATFORM=$ax_prog_python3_platform - - -else - as_fn_error $? "Unable to find python3" "$LINENO" 5 - -fi - PYTHON3=$PYTHON3 - - - if test "x${PYTHON3}" != x; then : - for ac_prog in python3-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON3_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PYTHON3_CONFIG"; then - ac_cv_prog_PYTHON3_CONFIG="$PYTHON3_CONFIG" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PYTHON3_CONFIG="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PYTHON3_CONFIG=$ac_cv_prog_PYTHON3_CONFIG -if test -n "$PYTHON3_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3_CONFIG" >&5 -$as_echo "$PYTHON3_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PYTHON3_CONFIG" && break -done - - -fi - if test "x${PYTHON3_CONFIG}" = x; then : - as_fn_error $? "Unable to find python3-config" "$LINENO" 5 - -fi - PYTHON3_CONFIG=$PYTHON3_CONFIG - - - - if test "x${PYTHON3_CONFIG}" != x; then : - PYTHON3_INCLUDES=`${PYTHON3_CONFIG} --includes 2>/dev/null`; - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python verison 3 includes" >&5 -$as_echo_n "checking for Python verison 3 includes... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3_INCLUDES" >&5 -$as_echo "$PYTHON3_INCLUDES" >&6; } - - PYTHON3_LDFLAGS=`${PYTHON3_CONFIG} --ldflags 2>/dev/null`; - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3 libraries" >&5 -$as_echo_n "checking for Python 3 libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3_LDFLAGS" >&5 -$as_echo "$PYTHON3_LDFLAGS" >&6; } - - case $host_os in #( - cygwin*) : - PYTHON3_LDFLAGS="${PYTHON3_LDFLAGS} -no-undefined" ;; #( - *) : - ;; #( - *) : - ;; -esac - - BACKUP_CPPFLAGS="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} ${PYTHON3_INCLUDES}" - - for ac_header in Python.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" -if test "x$ac_cv_header_Python_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PYTHON_H 1 -_ACEOF - ac_cv_header_python3_h=yes -else - ac_cv_header_python3_h=no -fi - -done - - - CPPFLAGS="${BACKUP_CPPFLAGS}" - -fi - - if test "x${ac_cv_header_python3_h}" != xyes; then : - ac_cv_enable_python3=no -else - ac_cv_enable_python3=$PYTHON3_VERSION - PYTHON3_CPPFLAGS=$PYTHON3_INCLUDES - - - PYTHON3_LDFLAGS=$PYTHON3_LDFLAGS - - - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python3_prefix="\${prefix}" -else - ax_python3_prefix=`${PYTHON3_CONFIG} --prefix 2>/dev/null` -fi - - PYTHON3_PREFIX=$ax_python3_prefix - - - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python3_exec_prefix="\${exec_prefix}" -else - ax_python3_exec_prefix=`${PYTHON3_CONFIG} --exec-prefix 2>/dev/null` -fi - - PYTHON3_EXEC_PREFIX=$ax_python3_exec_prefix - - - ax_python3_pythondir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; - - if test "x${ac_cv_with_pythondir3}" = x || test "x${ac_cv_with_pythondir3}" = xno; then : - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python3_pythondir="${ax_python_prefix}/${ax_python3_pythondir_suffix}" -else - ax_python3_pythondir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null` -fi -else - ax_python3_pythondir=$ac_cv_with_pythondir3 -fi - - pythondir3=$ax_python3_pythondir - - - ax_python3_pyexecdir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; - ax_python3_library_dir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; - - if test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno; then : - ax_python3_pyexecdir="${ax_python3_exec_prefix}/${ax_python3_pyexecdir_suffix}" -else - ax_python3_pyexecdir=$ax_python3_library_dir -fi - - pyexecdir3=$ax_python3_pyexecdir - - - PYTHON3_LIBRARY_DIR=$ax_python3_pyexecdir_suffix - - - PYTHON3_PACKAGE_DIR=$ax_python3_library_dir - - -fi - -fi - if test "x${ac_cv_enable_python}" != xno; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' @@ -56802,25 +64691,7 @@ fi - if test "x${ac_cv_enable_python2}" != xno; then - HAVE_PYTHON2_TRUE= - HAVE_PYTHON2_FALSE='#' -else - HAVE_PYTHON2_TRUE='#' - HAVE_PYTHON2_FALSE= -fi - - - if test "x${ac_cv_enable_python3}" != xno; then - HAVE_PYTHON3_TRUE= - HAVE_PYTHON3_FALSE='#' -else - HAVE_PYTHON3_TRUE='#' - HAVE_PYTHON3_FALSE= -fi - - - if test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno; then + if test "x${ac_cv_enable_python}" != xno; then HAVE_PYTHON_TESTS_TRUE= HAVE_PYTHON_TESTS_FALSE='#' else @@ -56829,43 +64700,27 @@ fi - if test "x${ac_cv_enable_python}" = xno; then : - if test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno; then : - if test "x${ac_cv_enable_python2}" != xno; then : - ac_cv_enable_python=${ac_cv_enable_python2} -else - ac_cv_enable_python="" -fi - if test "x${ac_cv_enable_python3}" != xno; then : - if test "x${ac_cv_enable_python}" != x; then : - ac_cv_enable_python="${ac_cv_enable_python}, " -fi - ac_cv_enable_python="${ac_cv_enable_python}${ac_cv_enable_python3}" -fi -fi +if test "x${ac_cv_enable_python}" != xno +then : + ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" +if test "x$ac_cv_header_stdarg_h" = xyes +then : + printf "%s\n" "#define HAVE_STDARG_H 1" >>confdefs.h fi - - -if test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno; then : - for ac_header in stdarg.h varargs.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "varargs.h" "ac_cv_header_varargs_h" "$ac_includes_default" +if test "x$ac_cv_header_varargs_h" = xyes +then : + printf "%s\n" "#define HAVE_VARARGS_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_header_stdarg_h" != xyes && test "x$ac_cv_header_varargs_h" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing headers: stdarg.h and varargs.h See \`config.log' for more details" "$LINENO" 5; } @@ -56876,51 +64731,57 @@ # Check whether --with-libfuse was given. -if test "${with_libfuse+set}" = set; then : +if test ${with_libfuse+y} +then : withval=$with_libfuse; ac_cv_with_libfuse=$withval -else +else $as_nop ac_cv_with_libfuse=auto-detect fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse" >&5 -$as_echo_n "checking whether to use search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse... " >&6; } -if ${ac_cv_with_libfuse+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse" >&5 +printf %s "checking whether to use search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse... " >&6; } +if test ${ac_cv_with_libfuse+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_with_libfuse=auto-detect fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfuse" >&5 -$as_echo "$ac_cv_with_libfuse" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfuse" >&5 +printf "%s\n" "$ac_cv_with_libfuse" >&6; } - if test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect; then : - if test -d "$ac_cv_with_libfuse"; then : + if test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect +then : + if test -d "$ac_cv_with_libfuse" +then : CFLAGS="$CFLAGS -I${ac_cv_with_libfuse}/include" LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_libfuse" >&5 -$as_echo "$as_me: WARNING: no such directory: $ac_cv_with_libfuse" >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_libfuse" >&5 +printf "%s\n" "$as_me: WARNING: no such directory: $ac_cv_with_libfuse" >&2;} fi fi - if test "x$ac_cv_with_libfuse" = xno; then : + if test "x$ac_cv_with_libfuse" = xno +then : ac_cv_libfuse=no -else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : +else $as_nop + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x" +then : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse" >&5 -$as_echo_n "checking for fuse... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse >= 2.6" >&5 +printf %s "checking for fuse >= 2.6... " >&6; } if test -n "$fuse_CFLAGS"; then pkg_cv_fuse_CFLAGS="$fuse_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "fuse >= 2.6") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_fuse_CFLAGS=`$PKG_CONFIG --cflags "fuse >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -56934,10 +64795,10 @@ pkg_cv_fuse_LIBS="$fuse_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fuse >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "fuse >= 2.6") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_fuse_LIBS=`$PKG_CONFIG --libs "fuse >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes @@ -56951,8 +64812,8 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -56960,75 +64821,72 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - fuse_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fuse >= 2.6" 2>&1` + fuse_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fuse >= 2.6" 2>&1` else - fuse_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fuse >= 2.6" 2>&1` + fuse_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fuse >= 2.6" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$fuse_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$fuse_PKG_ERRORS" >&5 - ac_cv_libfuse=no + ac_cv_libfuse=no elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ac_cv_libfuse=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ac_cv_libfuse=no else - fuse_CFLAGS=$pkg_cv_fuse_CFLAGS - fuse_LIBS=$pkg_cv_fuse_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_cv_libfuse=libfuse + fuse_CFLAGS=$pkg_cv_fuse_CFLAGS + fuse_LIBS=$pkg_cv_fuse_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_cv_libfuse=libfuse fi fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse +then : ac_cv_libfuse_CPPFLAGS="$pkg_cv_fuse_CFLAGS" ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS" -else - for ac_header in fuse.h +else $as_nop + for ac_header in fuse.h do : - ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" -if test "x$ac_cv_header_fuse_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FUSE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" +if test "x$ac_cv_header_fuse_h" = xyes +then : + printf "%s\n" "#define HAVE_FUSE_H 1" >>confdefs.h ac_cv_header_fuse_h=yes -else +else $as_nop ac_cv_header_fuse_h=no fi done - - if test "x$ac_cv_header_fuse_h" = xno; then : + if test "x$ac_cv_header_fuse_h" = xno +then : { ac_cv_header_fuse_h=; unset ac_cv_header_fuse_h;} - CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - for ac_header in fuse.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" -if test "x$ac_cv_header_fuse_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FUSE_H 1 -_ACEOF + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26" + ac_fn_c_check_header_compile "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" +if test "x$ac_cv_header_fuse_h" = xyes +then : + printf "%s\n" "#define HAVE_FUSE_H 1" >>confdefs.h fi -done - fi - if test "x$ac_cv_header_fuse_h" = xno; then : + if test "x$ac_cv_header_fuse_h" = xno +then : ac_cv_libfuse=no -else +else $as_nop ac_cv_libfuse=libfuse - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -lfuse" >&5 -$as_echo_n "checking for fuse_daemonize in -lfuse... " >&6; } -if ${ac_cv_lib_fuse_fuse_daemonize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -lfuse" >&5 +printf %s "checking for fuse_daemonize in -lfuse... " >&6; } +if test ${ac_cv_lib_fuse_fuse_daemonize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57037,40 +64895,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_daemonize (); int -main () +main (void) { return fuse_daemonize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fuse_fuse_daemonize=yes -else +else $as_nop ac_cv_lib_fuse_fuse_daemonize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_daemonize" >&5 -$as_echo "$ac_cv_lib_fuse_fuse_daemonize" >&6; } -if test "x$ac_cv_lib_fuse_fuse_daemonize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_daemonize" >&5 +printf "%s\n" "$ac_cv_lib_fuse_fuse_daemonize" >&6; } +if test "x$ac_cv_lib_fuse_fuse_daemonize" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -lfuse" >&5 -$as_echo_n "checking for fuse_destroy in -lfuse... " >&6; } -if ${ac_cv_lib_fuse_fuse_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -lfuse" >&5 +printf %s "checking for fuse_destroy in -lfuse... " >&6; } +if test ${ac_cv_lib_fuse_fuse_destroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57079,40 +64937,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_destroy (); int -main () +main (void) { return fuse_destroy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fuse_fuse_destroy=yes -else +else $as_nop ac_cv_lib_fuse_fuse_destroy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_destroy" >&5 -$as_echo "$ac_cv_lib_fuse_fuse_destroy" >&6; } -if test "x$ac_cv_lib_fuse_fuse_destroy" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_destroy" >&5 +printf "%s\n" "$ac_cv_lib_fuse_fuse_destroy" >&6; } +if test "x$ac_cv_lib_fuse_fuse_destroy" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -lfuse" >&5 -$as_echo_n "checking for fuse_mount in -lfuse... " >&6; } -if ${ac_cv_lib_fuse_fuse_mount+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -lfuse" >&5 +printf %s "checking for fuse_mount in -lfuse... " >&6; } +if test ${ac_cv_lib_fuse_fuse_mount+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57121,40 +64979,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_mount (); int -main () +main (void) { return fuse_mount (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fuse_fuse_mount=yes -else +else $as_nop ac_cv_lib_fuse_fuse_mount=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_mount" >&5 -$as_echo "$ac_cv_lib_fuse_fuse_mount" >&6; } -if test "x$ac_cv_lib_fuse_fuse_mount" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_mount" >&5 +printf "%s\n" "$ac_cv_lib_fuse_fuse_mount" >&6; } +if test "x$ac_cv_lib_fuse_fuse_mount" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -lfuse" >&5 -$as_echo_n "checking for fuse_new in -lfuse... " >&6; } -if ${ac_cv_lib_fuse_fuse_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -lfuse" >&5 +printf %s "checking for fuse_new in -lfuse... " >&6; } +if test ${ac_cv_lib_fuse_fuse_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57163,32 +65021,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_new (); int -main () +main (void) { return fuse_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_fuse_fuse_new=yes -else +else $as_nop ac_cv_lib_fuse_fuse_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_new" >&5 -$as_echo "$ac_cv_lib_fuse_fuse_new" >&6; } -if test "x$ac_cv_lib_fuse_fuse_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_new" >&5 +printf "%s\n" "$ac_cv_lib_fuse_fuse_new" >&6; } +if test "x$ac_cv_lib_fuse_fuse_new" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi @@ -57199,49 +65056,43 @@ fi - if test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno; then : + if test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno +then : CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" - for ac_header in osxfuse/fuse.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" -if test "x$ac_cv_header_osxfuse_fuse_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OSXFUSE_FUSE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" +if test "x$ac_cv_header_osxfuse_fuse_h" = xyes +then : + printf "%s\n" "#define HAVE_OSXFUSE_FUSE_H 1" >>confdefs.h fi -done - - if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : + if test "x$ac_cv_header_osxfuse_fuse_h" = xno +then : { ac_cv_header_osxfuse_fuse_h=; unset ac_cv_header_osxfuse_fuse_h;} CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - for ac_header in osxfuse/fuse.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" -if test "x$ac_cv_header_osxfuse_fuse_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OSXFUSE_FUSE_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" +if test "x$ac_cv_header_osxfuse_fuse_h" = xyes +then : + printf "%s\n" "#define HAVE_OSXFUSE_FUSE_H 1" >>confdefs.h fi -done - fi - if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : + if test "x$ac_cv_header_osxfuse_fuse_h" = xno +then : ac_cv_libfuse=no -else +else $as_nop ac_cv_libfuse=libosxfuse - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -losxfuse" >&5 -$as_echo_n "checking for fuse_daemonize in -losxfuse... " >&6; } -if ${ac_cv_lib_osxfuse_fuse_daemonize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -losxfuse" >&5 +printf %s "checking for fuse_daemonize in -losxfuse... " >&6; } +if test ${ac_cv_lib_osxfuse_fuse_daemonize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57250,40 +65101,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_daemonize (); int -main () +main (void) { return fuse_daemonize (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_osxfuse_fuse_daemonize=yes -else +else $as_nop ac_cv_lib_osxfuse_fuse_daemonize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_daemonize" >&5 -$as_echo "$ac_cv_lib_osxfuse_fuse_daemonize" >&6; } -if test "x$ac_cv_lib_osxfuse_fuse_daemonize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_daemonize" >&5 +printf "%s\n" "$ac_cv_lib_osxfuse_fuse_daemonize" >&6; } +if test "x$ac_cv_lib_osxfuse_fuse_daemonize" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -losxfuse" >&5 -$as_echo_n "checking for fuse_destroy in -losxfuse... " >&6; } -if ${ac_cv_lib_osxfuse_fuse_destroy+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -losxfuse" >&5 +printf %s "checking for fuse_destroy in -losxfuse... " >&6; } +if test ${ac_cv_lib_osxfuse_fuse_destroy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57292,40 +65143,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_destroy (); int -main () +main (void) { return fuse_destroy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_osxfuse_fuse_destroy=yes -else +else $as_nop ac_cv_lib_osxfuse_fuse_destroy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_destroy" >&5 -$as_echo "$ac_cv_lib_osxfuse_fuse_destroy" >&6; } -if test "x$ac_cv_lib_osxfuse_fuse_destroy" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_destroy" >&5 +printf "%s\n" "$ac_cv_lib_osxfuse_fuse_destroy" >&6; } +if test "x$ac_cv_lib_osxfuse_fuse_destroy" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -losxfuse" >&5 -$as_echo_n "checking for fuse_mount in -losxfuse... " >&6; } -if ${ac_cv_lib_osxfuse_fuse_mount+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -losxfuse" >&5 +printf %s "checking for fuse_mount in -losxfuse... " >&6; } +if test ${ac_cv_lib_osxfuse_fuse_mount+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57334,40 +65185,40 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_mount (); int -main () +main (void) { return fuse_mount (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_osxfuse_fuse_mount=yes -else +else $as_nop ac_cv_lib_osxfuse_fuse_mount=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_mount" >&5 -$as_echo "$ac_cv_lib_osxfuse_fuse_mount" >&6; } -if test "x$ac_cv_lib_osxfuse_fuse_mount" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_mount" >&5 +printf "%s\n" "$ac_cv_lib_osxfuse_fuse_mount" >&6; } +if test "x$ac_cv_lib_osxfuse_fuse_mount" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -losxfuse" >&5 -$as_echo_n "checking for fuse_new in -losxfuse... " >&6; } -if ${ac_cv_lib_osxfuse_fuse_new+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -losxfuse" >&5 +printf %s "checking for fuse_new in -losxfuse... " >&6; } +if test ${ac_cv_lib_osxfuse_fuse_new+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-losxfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57376,32 +65227,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char fuse_new (); int -main () +main (void) { return fuse_new (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_osxfuse_fuse_new=yes -else +else $as_nop ac_cv_lib_osxfuse_fuse_new=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_new" >&5 -$as_echo "$ac_cv_lib_osxfuse_fuse_new" >&6; } -if test "x$ac_cv_lib_osxfuse_fuse_new" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_new" >&5 +printf "%s\n" "$ac_cv_lib_osxfuse_fuse_new" >&6; } +if test "x$ac_cv_lib_osxfuse_fuse_new" = xyes +then : ac_cv_libfuse_dummy=yes -else +else $as_nop ac_cv_libfuse=no fi @@ -57414,52 +65264,60 @@ fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse +then : -$as_echo "#define HAVE_LIBFUSE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBFUSE 1" >>confdefs.h fi - if test "x$ac_cv_libfuse" = xlibosxfuse; then : + if test "x$ac_cv_libfuse" = xlibosxfuse +then : -$as_echo "#define HAVE_LIBOSXFUSE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LIBOSXFUSE 1" >>confdefs.h fi - if test "x$ac_cv_libfuse" != xno; then : + if test "x$ac_cv_libfuse" != xno +then : HAVE_LIBFUSE=1 -else +else $as_nop HAVE_LIBFUSE=0 fi - if test "x$ac_cv_libfuse_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libfuse_CPPFLAGS" != "x" +then : LIBFUSE_CPPFLAGS=$ac_cv_libfuse_CPPFLAGS fi - if test "x$ac_cv_libfuse_LIBADD" != "x"; then : + if test "x$ac_cv_libfuse_LIBADD" != "x" +then : LIBFUSE_LIBADD=$ac_cv_libfuse_LIBADD fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse +then : ax_libfuse_pc_libs_private=-lfuse fi - if test "x$ac_cv_libfuse" = xlibosxfuse; then : + if test "x$ac_cv_libfuse" = xlibosxfuse +then : ax_libfuse_pc_libs_private=-losxfuse fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse +then : ax_libfuse_spec_requires=fuse-libs ax_libfuse_spec_build_requires=fuse-devel @@ -57468,141 +65326,148 @@ fi -for ac_header in signal.h sys/signal.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_signal_h" = xyes +then : + printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/signal.h" "ac_cv_header_sys_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_signal_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SIGNAL_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h +fi - for ac_func in close getopt setvbuf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + + ac_fn_c_check_func "$LINENO" "close" "ac_cv_func_close" +if test "x$ac_cv_func_close" = xyes +then : + printf "%s\n" "#define HAVE_CLOSE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" +if test "x$ac_cv_func_getopt" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setvbuf" "ac_cv_func_setvbuf" +if test "x$ac_cv_func_setvbuf" = xyes +then : + printf "%s\n" "#define HAVE_SETVBUF 1" >>confdefs.h fi -done - if test "x$ac_cv_func_close" != xyes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + if test "x$ac_cv_func_close" != xyes +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: close See \`config.log' for more details" "$LINENO" 5; } fi - for ac_header in errno.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ERRNO_H 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi -done + if test "x$ac_cv_enable_winapi" = xno +then : + ac_fn_c_check_func "$LINENO" "getchar" "ac_cv_func_getchar" +if test "x$ac_cv_func_getchar" = xyes +then : + printf "%s\n" "#define HAVE_GETCHAR 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include +fi +ac_fn_c_check_func "$LINENO" "tcgetattr" "ac_cv_func_tcgetattr" +if test "x$ac_cv_func_tcgetattr" = xyes +then : + printf "%s\n" "#define HAVE_TCGETATTR 1" >>confdefs.h -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_fn_c_check_func "$LINENO" "tcsetattr" "ac_cv_func_tcsetattr" +if test "x$ac_cv_func_tcsetattr" = xyes +then : + printf "%s\n" "#define HAVE_TCSETATTR 1" >>confdefs.h + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi - - if test "x$ac_cv_enable_winapi" = xno; then : - for ac_func in clock_gettime getegid geteuid time -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h fi -done - +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi + if test "x$ac_cv_enable_winapi" = xno +then : + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - # Check whether --enable-static-executables was given. -if test "${enable_static_executables+set}" = set; then : - enableval=$enable_static_executables; ac_cv_enable_static_executables=$enableval -else - ac_cv_enable_static_executables=no fi +ac_fn_c_check_func "$LINENO" "getegid" "ac_cv_func_getegid" +if test "x$ac_cv_func_getegid" = xyes +then : + printf "%s\n" "#define HAVE_GETEGID 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build static executables (binaries)" >&5 -$as_echo_n "checking whether to enable build static executables (binaries)... " >&6; } -if ${ac_cv_enable_static_executables+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_enable_static_executables=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_static_executables" >&5 -$as_echo "$ac_cv_enable_static_executables" >&6; } +ac_fn_c_check_func "$LINENO" "geteuid" "ac_cv_func_geteuid" +if test "x$ac_cv_func_geteuid" = xyes +then : + printf "%s\n" "#define HAVE_GETEUID 1" >>confdefs.h - if test "x$ac_cv_enable_static_executables" != xno; then : - STATIC_LDFLAGS="-all-static"; +fi +ac_fn_c_check_func "$LINENO" "time" "ac_cv_func_time" +if test "x$ac_cv_func_time" = xyes +then : + printf "%s\n" "#define HAVE_TIME 1" >>confdefs.h +fi - ac_cv_enable_static_executables=yes - enable_shared=no fi - if test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno; then : +if test "x$enable_shared" = xyes && test "x$ac_cv_enable_static_executables" = xno +then : case $host in #( - *cygwin* | *mingw*) : - LIBBDE_DLL_IMPORT="-DLIBBDE_DLL_IMPORT" + *cygwin* | *mingw* | *msys*) : - ;; #( +printf "%s\n" "#define HAVE_DLLMAIN 1" >>confdefs.h + + HAVE_DLLMAIN=1 + + + LIBBDE_DLL_EXPORT="-DLIBBDE_DLL_EXPORT" + + + LIBBDE_DLL_IMPORT="-DLIBBDE_DLL_IMPORT" + + ;; #( *) : ;; esac @@ -57610,37 +65475,58 @@ fi -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done + ac_fn_c_check_func "$LINENO" "fmemopen" "ac_cv_func_fmemopen" +if test "x$ac_cv_func_fmemopen" = xyes +then : + printf "%s\n" "#define HAVE_FMEMOPEN 1" >>confdefs.h - for ac_func in fmemopen getopt mkstemp unlink -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" +if test "x$ac_cv_func_getopt" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h fi -done +ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" +if test "x$ac_cv_func_mkstemp" = xyes +then : + printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" +if test "x$ac_cv_func_setenv" = xyes +then : + printf "%s\n" "#define HAVE_SETENV 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "tzset" "ac_cv_func_tzset" +if test "x$ac_cv_func_tzset" = xyes +then : + printf "%s\n" "#define HAVE_TZSET 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 -$as_echo_n "checking for dlsym in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlsym+:} false; then : - $as_echo_n "(cached) " >&6 -else +fi +ac_fn_c_check_func "$LINENO" "unlink" "ac_cv_func_unlink" +if test "x$ac_cv_func_unlink" = xyes +then : + printf "%s\n" "#define HAVE_UNLINK 1" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 +printf %s "checking for dlsym in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlsym+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -57649,77 +65535,67 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlsym (); int -main () +main (void) { return dlsym (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlsym=yes -else +else $as_nop ac_cv_lib_dl_dlsym=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 -$as_echo "$ac_cv_lib_dl_dlsym" >&6; } -if test "x$ac_cv_lib_dl_dlsym" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlsym" >&6; } +if test "x$ac_cv_lib_dl_dlsym" = xyes +then : + printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h LIBS="-ldl $LIBS" fi - if test "x$lt_cv_prog_gnu_ld" = xyes && test "x$ac_cv_lib_dl_dlsym" = xyes; then : + if test "x$lt_cv_prog_gnu_ld" = xyes && test "x$ac_cv_lib_dl_dlsym" = xyes +then : -$as_echo "#define HAVE_GNU_DL_DLSYM 1" >>confdefs.h +printf "%s\n" "#define HAVE_GNU_DL_DLSYM 1" >>confdefs.h fi + if test "x${LIB_FUZZING_ENGINE}" != x; then + HAVE_LIB_FUZZING_ENGINE_TRUE= + HAVE_LIB_FUZZING_ENGINE_FALSE='#' +else + HAVE_LIB_FUZZING_ENGINE_TRUE='#' + HAVE_LIB_FUZZING_ENGINE_FALSE= +fi -if test "x$enable_shared" = xyes; then : - case $host in #( - *cygwin* | *mingw* | *msys*) : - -$as_echo "#define HAVE_DLLMAIN 1" >>confdefs.h - - HAVE_DLLMAIN=1 - - - LIBBDE_DLL_EXPORT="-DLIBBDE_DLL_EXPORT" - - - LIBBDE_DLL_IMPORT="-DLIBBDE_DLL_IMPORT" + LIB_FUZZING_ENGINE="${LIB_FUZZING_ENGINE}" - ;; #( - *) : - ;; -esac -fi CFLAGS="$CFLAGS -Wall"; -if test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdata" = xyes || test "x$ac_cv_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libhmac" = xyes || test "x$ac_cv_libcaes" = xyes || test "x$ac_cv_libcrypto" != xno; then : +if test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libhmac" = xyes || test "x$ac_cv_libcaes" = xyes || test "x$ac_cv_libcrypto" != xno +then : libbde_spec_requires=Requires: fi -if test "x$ac_cv_libfuse" != xno; then : +if test "x$ac_cv_libfuse" != xno +then : libbde_spec_tools_build_requires=BuildRequires: @@ -57759,8 +65635,6 @@ ac_config_files="$ac_config_files libfcache/Makefile" -ac_config_files="$ac_config_files libfdata/Makefile" - ac_config_files="$ac_config_files libfdatetime/Makefile" ac_config_files="$ac_config_files libfguid/Makefile" @@ -57775,10 +65649,6 @@ ac_config_files="$ac_config_files pybde/Makefile" -ac_config_files="$ac_config_files pybde-python2/Makefile" - -ac_config_files="$ac_config_files pybde-python3/Makefile" - ac_config_files="$ac_config_files bdetools/Makefile" ac_config_files="$ac_config_files po/Makefile.in" @@ -57789,6 +65659,8 @@ ac_config_files="$ac_config_files tests/Makefile" +ac_config_files="$ac_config_files ossfuzz/Makefile" + ac_config_files="$ac_config_files msvscpp/Makefile" ac_config_files="$ac_config_files include/libbde.h" @@ -57811,6 +65683,8 @@ ac_config_files="$ac_config_files libbde.spec" +ac_config_files="$ac_config_files setup.cfg" + ac_config_headers="$ac_config_headers common/config.h" @@ -57841,8 +65715,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -57872,15 +65746,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -57894,8 +65768,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -57912,7 +65786,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -57923,14 +65797,14 @@ LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -57947,6 +65821,14 @@ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_LOCAL_LIBCERROR_TRUE}" && test -z "${HAVE_LOCAL_LIBCERROR_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBCERROR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -57991,10 +65873,6 @@ as_fn_error $? "conditional \"HAVE_LOCAL_LIBFCACHE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_LOCAL_LIBFDATA_TRUE}" && test -z "${HAVE_LOCAL_LIBFDATA_FALSE}"; then - as_fn_error $? "conditional \"HAVE_LOCAL_LIBFDATA\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_LOCAL_LIBFDATETIME_TRUE}" && test -z "${HAVE_LOCAL_LIBFDATETIME_FALSE}"; then as_fn_error $? "conditional \"HAVE_LOCAL_LIBFDATETIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -58019,25 +65897,21 @@ as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_PYTHON2_TRUE}" && test -z "${HAVE_PYTHON2_FALSE}"; then - as_fn_error $? "conditional \"HAVE_PYTHON2\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_PYTHON3_TRUE}" && test -z "${HAVE_PYTHON3_FALSE}"; then - as_fn_error $? "conditional \"HAVE_PYTHON3\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_PYTHON_TESTS_TRUE}" && test -z "${HAVE_PYTHON_TESTS_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_LIB_FUZZING_ENGINE_TRUE}" && test -z "${HAVE_LIB_FUZZING_ENGINE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LIB_FUZZING_ENGINE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -58060,14 +65934,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -58077,46 +65953,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -58125,13 +66001,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -58140,8 +66009,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -58153,30 +66026,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -58189,13 +66042,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -58222,18 +66076,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -58245,12 +66101,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -58281,7 +66138,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -58303,6 +66160,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -58316,6 +66177,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -58357,7 +66224,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -58366,7 +66233,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -58428,8 +66295,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libbde $as_me 20190102, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by libbde $as_me 20240223, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -58491,14 +66358,16 @@ Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libbde config.status 20190102 -configured by $0, generated by GNU Autoconf 2.69, +libbde config.status 20240223 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -58538,15 +66407,15 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -58554,7 +66423,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -58563,7 +66432,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -58591,7 +66460,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -58605,7 +66474,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -58623,11 +66492,11 @@ sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' @@ -58660,12 +66529,14 @@ lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -58759,6 +66630,60 @@ enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' @@ -58789,13 +66714,13 @@ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -58841,7 +66766,38 @@ install_override_mode \ finish_eval \ old_striplib \ -striplib; do +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -58872,7 +66828,18 @@ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ -configure_time_lt_sys_library_path; do +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -58899,10 +66866,11 @@ + + # Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. + OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -58932,7 +66900,6 @@ "libcpath/Makefile") CONFIG_FILES="$CONFIG_FILES libcpath/Makefile" ;; "libbfio/Makefile") CONFIG_FILES="$CONFIG_FILES libbfio/Makefile" ;; "libfcache/Makefile") CONFIG_FILES="$CONFIG_FILES libfcache/Makefile" ;; - "libfdata/Makefile") CONFIG_FILES="$CONFIG_FILES libfdata/Makefile" ;; "libfdatetime/Makefile") CONFIG_FILES="$CONFIG_FILES libfdatetime/Makefile" ;; "libfguid/Makefile") CONFIG_FILES="$CONFIG_FILES libfguid/Makefile" ;; "libfvalue/Makefile") CONFIG_FILES="$CONFIG_FILES libfvalue/Makefile" ;; @@ -58940,13 +66907,12 @@ "libcaes/Makefile") CONFIG_FILES="$CONFIG_FILES libcaes/Makefile" ;; "libbde/Makefile") CONFIG_FILES="$CONFIG_FILES libbde/Makefile" ;; "pybde/Makefile") CONFIG_FILES="$CONFIG_FILES pybde/Makefile" ;; - "pybde-python2/Makefile") CONFIG_FILES="$CONFIG_FILES pybde-python2/Makefile" ;; - "pybde-python3/Makefile") CONFIG_FILES="$CONFIG_FILES pybde-python3/Makefile" ;; "bdetools/Makefile") CONFIG_FILES="$CONFIG_FILES bdetools/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po/Makevars") CONFIG_FILES="$CONFIG_FILES po/Makevars" ;; "manuals/Makefile") CONFIG_FILES="$CONFIG_FILES manuals/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "ossfuzz/Makefile") CONFIG_FILES="$CONFIG_FILES ossfuzz/Makefile" ;; "msvscpp/Makefile") CONFIG_FILES="$CONFIG_FILES msvscpp/Makefile" ;; "include/libbde.h") CONFIG_FILES="$CONFIG_FILES include/libbde.h" ;; "include/libbde/definitions.h") CONFIG_FILES="$CONFIG_FILES include/libbde/definitions.h" ;; @@ -58958,6 +66924,7 @@ "libbde/libbde.rc") CONFIG_FILES="$CONFIG_FILES libbde/libbde.rc" ;; "libbde.pc") CONFIG_FILES="$CONFIG_FILES libbde.pc" ;; "libbde.spec") CONFIG_FILES="$CONFIG_FILES libbde.spec" ;; + "setup.cfg") CONFIG_FILES="$CONFIG_FILES setup.cfg" ;; "common/config.h") CONFIG_HEADERS="$CONFIG_HEADERS common/config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -58970,9 +66937,9 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -59308,7 +67275,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -59316,17 +67283,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -59343,7 +67310,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -59367,9 +67334,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -59431,8 +67398,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -59476,9 +67443,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -59494,20 +67461,20 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -59527,7 +67494,7 @@ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -59547,8 +67514,8 @@ s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -59574,7 +67541,7 @@ for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -59586,7 +67553,7 @@ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -59608,7 +67575,7 @@ $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | +printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -59633,10 +67600,12 @@ (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } @@ -59693,13 +67662,17 @@ # The names of the tagged configurations supported by this script. -available_tags='' +available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + # Assembler program. AS=$lt_AS @@ -59709,10 +67682,6 @@ # Object dumper program. OBJDUMP=$lt_OBJDUMP -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - # Whether or not to build shared libraries. build_libtool_libs=$enable_shared @@ -59792,6 +67761,9 @@ # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -59810,8 +67782,11 @@ # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -60101,6 +68076,20 @@ # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + # ### END LIBTOOL CONFIG _LT_EOF @@ -60179,6 +68168,7 @@ esac + ltmain=$ac_aux_dir/ltmain.sh @@ -60186,13 +68176,166 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + ;; "po-directories":C) for ac_file in $CONFIG_FILES; do @@ -60204,7 +68347,7 @@ case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -60220,7 +68363,8 @@ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration @@ -60230,14 +68374,11 @@ if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -60341,12 +68482,12 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Building: libcerror support: $ac_cv_libcerror libcthreads support: $ac_cv_libcthreads @@ -60359,7 +68500,6 @@ libcpath support: $ac_cv_libcpath libbfio support: $ac_cv_libbfio libfcache support: $ac_cv_libfcache - libfdata support: $ac_cv_libfdata libfdatetime support: $ac_cv_libfdatetime libfguid support: $ac_cv_libfguid libfvalue support: $ac_cv_libfvalue @@ -60379,7 +68519,7 @@ Verbose output: $ac_cv_enable_verbose_output Debug output: $ac_cv_enable_debug_output " >&5 -$as_echo "$as_me: +printf "%s\n" "$as_me: Building: libcerror support: $ac_cv_libcerror libcthreads support: $ac_cv_libcthreads @@ -60392,7 +68532,6 @@ libcpath support: $ac_cv_libcpath libbfio support: $ac_cv_libbfio libfcache support: $ac_cv_libfcache - libfdata support: $ac_cv_libfdata libfdatetime support: $ac_cv_libfdatetime libfguid support: $ac_cv_libfguid libfvalue support: $ac_cv_libfvalue @@ -60413,3 +68552,4 @@ Debug output: $ac_cv_enable_debug_output " >&6;}; + diff -Nru libbde-20190102/configure.ac libbde-20240223/configure.ac --- libbde-20190102/configure.ac 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/configure.ac 2024-02-23 02:47:17.000000000 +0000 @@ -1,14 +1,15 @@ -AC_PREREQ( 2.59 ) +AC_PREREQ([2.71]) AC_INIT( [libbde], - [20190102], + [20240223], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( [include/libbde.h.in]) AM_INIT_AUTOMAKE([gnu 1.6 tar-ustar]) +AM_EXTRA_RECURSIVE_TARGETS([sources splint]) AC_CONFIG_MACRO_DIR([m4]) @@ -16,16 +17,16 @@ AC_CANONICAL_HOST dnl Check for libtool DLL support -AC_LIBTOOL_WIN32_DLL +LT_INIT([win32-dll]) dnl Checks for programs AC_PROG_CC AC_PROG_GCC_TRADITIONAL +AC_PROG_CXX AC_PROG_MAKE_SET AC_PROG_INSTALL dnl Check for libtool -AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) dnl Check for pkg-config @@ -33,7 +34,7 @@ dnl Support of internationalization (i18n) AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.18.1]) +AM_GNU_GETTEXT_VERSION([0.21]) dnl Check for compiler language support AC_C_CONST @@ -45,6 +46,9 @@ dnl Check if shared library support should be disabled AX_COMMON_CHECK_DISABLE_SHARED_LIBS +dnl Check if tools should be build as static executables +AX_COMMON_CHECK_ENABLE_STATIC_EXECUTABLES + dnl Check if WINAPI support should be enabled AX_COMMON_CHECK_ENABLE_WINAPI @@ -96,9 +100,6 @@ dnl Check if libfcache or required headers and functions are available AX_LIBFCACHE_CHECK_ENABLE -dnl Check if libfdata or required headers and functions are available -AX_LIBFDATA_CHECK_ENABLE - dnl Check if libfdatetime or required headers and functions are available AX_LIBFDATETIME_CHECK_ENABLE @@ -121,7 +122,7 @@ AX_PYTHON_CHECK_ENABLE AS_IF( - [test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno], + [test "x${ac_cv_enable_python}" != xno], [dnl Headers included in pybde/pybde_error.c AC_CHECK_HEADERS([stdarg.h varargs.h]) @@ -139,39 +140,19 @@ dnl Check if bdetools required headers and functions are available AX_BDETOOLS_CHECK_LOCAL +dnl Check if DLL support is needed +AX_LIBBDE_CHECK_DLL_SUPPORT + dnl Check if tests required headers and functions are available AX_TESTS_CHECK_LOCAL - -dnl Check if DLL support is needed -AS_IF( - [test "x$enable_shared" = xyes], - [AS_CASE( - [$host], - [*cygwin* | *mingw* | *msys*], - [AC_DEFINE( - [HAVE_DLLMAIN], - [1], - [Define to 1 to enable the DllMain function.]) - AC_SUBST( - [HAVE_DLLMAIN], - [1]) - - AC_SUBST( - [LIBBDE_DLL_EXPORT], - ["-DLIBBDE_DLL_EXPORT"]) - - AC_SUBST( - [LIBBDE_DLL_IMPORT], - ["-DLIBBDE_DLL_IMPORT"]) - ]) - ]) +AX_TESTS_CHECK_OSSFUZZ dnl Set additional compiler flags CFLAGS="$CFLAGS -Wall"; dnl Check if requires and build requires should be set in spec file AS_IF( - [test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdata" = xyes || test "x$ac_cv_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libhmac" = xyes || test "x$ac_cv_libcaes" = xyes || test "x$ac_cv_libcrypto" != xno], + [test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libhmac" = xyes || test "x$ac_cv_libcaes" = xyes || test "x$ac_cv_libcrypto" != xno], [AC_SUBST( [libbde_spec_requires], [Requires:]) @@ -209,7 +190,6 @@ AC_CONFIG_FILES([libcpath/Makefile]) AC_CONFIG_FILES([libbfio/Makefile]) AC_CONFIG_FILES([libfcache/Makefile]) -AC_CONFIG_FILES([libfdata/Makefile]) AC_CONFIG_FILES([libfdatetime/Makefile]) AC_CONFIG_FILES([libfguid/Makefile]) AC_CONFIG_FILES([libfvalue/Makefile]) @@ -217,13 +197,12 @@ AC_CONFIG_FILES([libcaes/Makefile]) AC_CONFIG_FILES([libbde/Makefile]) AC_CONFIG_FILES([pybde/Makefile]) -AC_CONFIG_FILES([pybde-python2/Makefile]) -AC_CONFIG_FILES([pybde-python3/Makefile]) AC_CONFIG_FILES([bdetools/Makefile]) AC_CONFIG_FILES([po/Makefile.in]) AC_CONFIG_FILES([po/Makevars]) AC_CONFIG_FILES([manuals/Makefile]) AC_CONFIG_FILES([tests/Makefile]) +AC_CONFIG_FILES([ossfuzz/Makefile]) AC_CONFIG_FILES([msvscpp/Makefile]) dnl Generate header files AC_CONFIG_FILES([include/libbde.h]) @@ -237,6 +216,7 @@ AC_CONFIG_FILES([libbde/libbde.rc]) AC_CONFIG_FILES([libbde.pc]) AC_CONFIG_FILES([libbde.spec]) +AC_CONFIG_FILES([setup.cfg]) dnl Generate a source configuration file AC_CONFIG_HEADERS([common/config.h]) @@ -256,7 +236,6 @@ libcpath support: $ac_cv_libcpath libbfio support: $ac_cv_libbfio libfcache support: $ac_cv_libfcache - libfdata support: $ac_cv_libfdata libfdatetime support: $ac_cv_libfdatetime libfguid support: $ac_cv_libfguid libfvalue support: $ac_cv_libfvalue diff -Nru libbde-20190102/debian/changelog libbde-20240223/debian/changelog --- libbde-20190102/debian/changelog 2024-02-29 08:46:11.000000000 +0000 +++ libbde-20240223/debian/changelog 2024-03-03 13:21:47.000000000 +0000 @@ -1,200 +1,11 @@ -libbde (20190102-2.1) unstable; urgency=medium +libbde (20240223-1ppa1~noble) noble; urgency=low - * Non-maintainer upload. - * Rename libraries for 64-bit time_t transition. Closes: #1062228 + * Modifications for PPA release. - -- Lukas Märdian Thu, 29 Feb 2024 08:46:11 +0000 + -- Joachim Metz Sun, 03 Mar 2024 14:21:47 +0100 -libbde (20190102-2) unstable; urgency=medium +libbde (20240223-1) unstable; urgency=low - [ Samuel Henrique ] - * Configure git-buildpackage for Debian + * Auto-generated - [ Debian Janitor ] - * Use secure copyright file specification URI. - * Set upstream metadata fields: Bug-Database, Bug-Submit. - * Update standards version to 4.5.0, no changes needed. - * Remove Section on libbde1 that duplicates source. - * Apply multi-arch hints. + python3-libbde: Add Multi-Arch: same. - * Update watch file format version to 4. - * Use cross-build compatible macro for finding pkg-config. - - [ Raphaël Hertzog ] - * Configure autodep8 test to use pybde as module name - - [ Sébastien Delafond ] - * Disable memory tests on riscv-64 (Closes: #978461) - - -- Sebastien Delafond Tue, 26 Jan 2021 15:28:52 +0100 - -libbde (20190102-1.1) unstable; urgency=low - - * Non-maintainer upload. - * Remove the Python 2 bindings. (Closes: #936844) - - [ Samuel Henrique ] - * Add salsa-ci.yml - - -- Adrian Bunk Sat, 18 Jan 2020 15:42:28 +0200 - -libbde (20190102-1) unstable; urgency=medium - - * New upstream version 20190102 - * Replace dh_install --fail-missing - * Bump Standards-Version - * Enable hardening rules - - -- Hilko Bengen Sun, 13 Jan 2019 23:18:57 +0100 - -libbde (20181117-1) unstable; urgency=medium - - * New upstream version 20181117 - * Bump Standards-Version - - -- Hilko Bengen Sun, 18 Nov 2018 12:23:22 +0100 - -libbde (20180806-1) unstable; urgency=medium - - [ Raphaël Hertzog ] - * Update team maintainer address to Debian Security Tools - - * Update Vcs-Git and Vcs-Browser for the move to salsa.debian.org - - [ Hilko Bengen ] - * New upstream version 20180806 - * Bump Standards-Version - * Remove unneeded dh --parallel argument - - -- Hilko Bengen Tue, 07 Aug 2018 14:16:43 +0200 - -libbde (20170902-2) unstable; urgency=medium - - * Modernize package: Fix Vcs URLs, remove -dbg package, - Standards-Version - - -- Hilko Bengen Mon, 13 Nov 2017 14:14:09 +0100 - -libbde (20170902-1) unstable; urgency=medium - - * New upstream version 20170902 - * Modernize package: DH compat level, Standards-Version, Vcs-* URL - * Drop patch - - -- Hilko Bengen Sat, 02 Sep 2017 16:22:21 +0200 - -libbde (20170204-2) unstable; urgency=medium - - * Disable memory tests that caused FTBFS errors on a number of - architectures (Closes: #854874) - - -- Hilko Bengen Mon, 05 Jun 2017 15:07:30 +0200 - -libbde (20170204-1) unstable; urgency=medium - - * New upstream version 20170204 - - -- Hilko Bengen Mon, 06 Feb 2017 09:56:55 +0100 - -libbde (20160731-1) unstable; urgency=medium - - * New upstream version - * Drop patches that have been integrated upstream - * Skip Python tests - * Bump Standards-Version - - -- Hilko Bengen Sat, 06 Aug 2016 10:58:01 +0200 - -libbde (20160418-2) unstable; urgency=medium - - * Fix FTBFS due to wrong TEST_PREFIX - - -- Hilko Bengen Wed, 20 Apr 2016 21:19:19 +0200 - -libbde (20160418-1) unstable; urgency=medium - - * New upstream version - - -- Hilko Bengen Tue, 19 Apr 2016 21:56:26 +0200 - -libbde (20160110-2) unstable; urgency=medium - - * Add Python 3 bindings - - -- Hilko Bengen Sun, 24 Jan 2016 12:26:27 +0100 - -libbde (20160110-1) unstable; urgency=medium - - * New upstream version - - -- Hilko Bengen Sun, 17 Jan 2016 19:56:16 +0100 - -libbde (20150905-1) unstable; urgency=medium - - * New upstream version - * Don't mention multiarch-support directly in Pre-Depends line. - * Update Source URL in debian/copyright. - - -- Hilko Bengen Wed, 16 Sep 2015 21:57:05 +0200 - -libbde (20150204-3) unstable; urgency=medium - - * Updated Homepage, VCS-* fields - * Gave package to Debian Forensics team - * Fixed watch file - - -- Hilko Bengen Sat, 01 Aug 2015 11:02:30 +0200 - -libbde (20150204-2) unstable; urgency=medium - - * Improved package descriptions - * Use packaged libbfio in building the package - * Added Python bindings and -dbg packages - * Added symbols file - - -- Hilko Bengen Sun, 19 Jul 2015 22:49:45 +0200 - -libbde (20150204-1) unstable; urgency=medium - - * New upstream version - * Updated watch file - - -- Hilko Bengen Wed, 04 Mar 2015 22:10:58 +0100 - -libbde (20141023-1) unstable; urgency=medium - - * New upstream version - * Bumped Standards-Version - - -- Hilko Bengen Tue, 28 Oct 2014 23:34:47 +0100 - -libbde (20140731-1) unstable; urgency=medium - - * New upstream version - - -- Hilko Bengen Tue, 19 Aug 2014 23:21:27 +0200 - -libbde (20140728-1) unstable; urgency=medium - - * New upstream version - - -- Hilko Bengen Thu, 31 Jul 2014 09:33:27 +0200 - -libbde (20140607-1) unstable; urgency=medium - - * New upstream version - - -- Hilko Bengen Sat, 21 Jun 2014 11:04:19 +0200 - -libbde (20140405-2) unstable; urgency=medium - - * Added Vcs-* fields - * Added watch file - * Use dh-autoreconf instead of autotools-dev (Closes: #751723) - - -- Hilko Bengen Mon, 16 Jun 2014 09:26:12 +0200 - -libbde (20140405-1) unstable; urgency=low - - * Initial release (Closes: #743978) - - -- Hilko Bengen Thu, 10 Apr 2014 00:02:42 +0200 + -- Joachim Metz Fri, 23 Feb 2024 04:04:00 +0100 diff -Nru libbde-20190102/debian/changelog.in libbde-20240223/debian/changelog.in --- libbde-20190102/debian/changelog.in 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/debian/changelog.in 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1,5 @@ +libbde (@VERSION@-1) unstable; urgency=low + + * Auto-generated + + -- Joachim Metz @DPKG_DATE@ diff -Nru libbde-20190102/debian/control libbde-20240223/debian/control --- libbde-20190102/debian/control 2024-02-29 08:46:11.000000000 +0000 +++ libbde-20240223/debian/control 2024-02-23 02:47:17.000000000 +0000 @@ -1,60 +1,65 @@ Source: libbde -Priority: optional -Maintainer: Debian Security Tools -Uploaders: Hilko Bengen -Build-Depends: dpkg-dev (>= 1.22.5), debhelper (>= 10~), dh-python, - pkg-config, - libbfio-dev, libfuse-dev, - python3-dev, -Standards-Version: 4.5.0 +Priority: extra +Maintainer: Joachim Metz +Build-Depends: debhelper (>= 9), dh-autoreconf, dh-python, pkg-config, libssl-dev, python3-dev, python3-setuptools, libfuse-dev +Standards-Version: 4.1.4 Section: libs Homepage: https://github.com/libyal/libbde -Vcs-Git: https://salsa.debian.org/pkg-security-team/libbde.git -Vcs-Browser: https://salsa.debian.org/pkg-security-team/libbde +Vcs-Git: https://github.com/libyal/libbde.git + +Package: libbde +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libbde1 +Replaces: libbde1 +Suggests: libbde-dbg +Description: Library to access the BitLocker Drive Encryption (BDE) format + libbde is a library to access the BitLocker Drive Encryption (BDE) format. + +Package: libbde-dbg +Architecture: any +Section: debug +Depends: libbde (= ${binary:Version}), ${misc:Depends} +Description: Debugging symbols for libbde + Debugging symbols for libbde. Package: libbde-dev Section: libdevel Architecture: any -Multi-Arch: same -Depends: ${shlibs:Depends}, ${misc:Depends}, - libbde1t64 (= ${binary:Version}) -Description: BitLocker Drive Encryption access library -- development files - The BDE format is used by Microsoft Windows (Vista and later) to - encrypt data on a storage media volume. - . - This package includes the development support files. +Depends: libbde (= ${binary:Version}), ${misc:Depends} +Description: Header files and libraries for developing applications for libbde + Header files and libraries for developing applications for libbde. -Package: libbde1t64 -Provides: ${t64:Provides} -Replaces: libbde1 -Breaks: libbde1 (<< ${source:Version}) +Package: libbde-tools +Section: utils Architecture: any -Multi-Arch: same -Pre-Depends: ${misc:Pre-Depends} -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: BitLocker Drive Encryption access library - The BDE format is used by Microsoft Windows (Vista and later) to - encrypt data on a storage media volume. - -Package: libbde-utils -Section: otherosfs -Architecture: any -Multi-Arch: foreign -Pre-Depends: ${misc:Pre-Depends} -Depends: ${shlibs:Depends}, ${misc:Depends}, - libbde1t64, -Description: Tools to access the BitLocker Drive Encryption format. - The BDE format is used by Microsoft Windows (Vista and later) to - encrypt data on a storage media volume. +Depends: libbde (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Conflicts: libbde-utils +Replaces: libbde-utils +Description: Several tools for reading BitLocker Drive Encryption volumes + Several tools for reading BitLocker Drive Encryption volumes. + +Package: libbde-tools-dbg +Section: debug +Architecture: any +Depends: libbde-tools (= ${binary:Version}), ${misc:Depends} +Description: Debugging symbols for libbde-tools + Debugging symbols for libbde-tools. -Package: python3-libbde +Package: libbde-python3 Section: python Architecture: any -Depends: libbde1t64 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, - ${python3:Depends}, -Multi-Arch: same -Description: BitLocker Drive Encryption access library -- Python 3 bindings - The BDE format is used by Microsoft Windows (Vista and later) to - encrypt data on a storage media volume. - . - This package includes Python 3 bindings. +Depends: libbde (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Conflicts: python3-libbde +Replaces: python3-libbde +Suggests: libbde-python3-dbg +Description: Python 3 bindings for libbde + Python 3 bindings for libbde. + +Package: libbde-python3-dbg +Section: debug +Architecture: any +Depends: libbde-python3 (= ${binary:Version}), ${misc:Depends} +Description: Debugging symbols for libbde-python3 + Debugging symbols for libbde-python3. + diff -Nru libbde-20190102/debian/copyright libbde-20240223/debian/copyright --- libbde-20190102/debian/copyright 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/copyright 2024-02-23 02:47:19.000000000 +0000 @@ -1,13 +1,9 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libbde Source: https://github.com/libyal/libbde Files: * -Copyright: 2011-2014, Joachim Metz -License: LGPL-3.0+ - -Files: debian/* -Copyright: 2014 Hilko Bengen +Copyright: 2011-2024, Joachim Metz License: LGPL-3.0+ License: LGPL-3.0+ @@ -26,3 +22,4 @@ . On Debian systems, the complete text of the GNU Lesser General Public License can be found in "/usr/share/common-licenses/LGPL-3". + diff -Nru libbde-20190102/debian/gbp.conf libbde-20240223/debian/gbp.conf --- libbde-20190102/debian/gbp.conf 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -[DEFAULT] -debian-branch = debian/master -pristine-tar = True - -[buildpackage] -sign-tags = True - -[import-orig] -filter-pristine-tar = True - -[pq] -patch-numbers = False - -[dch] -multimaint-merge = True diff -Nru libbde-20190102/debian/libbde-python3.install libbde-20240223/debian/libbde-python3.install --- libbde-20190102/debian/libbde-python3.install 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/debian/libbde-python3.install 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1 @@ +/usr/lib/python3* diff -Nru libbde-20190102/debian/libbde-tools.install libbde-20240223/debian/libbde-tools.install --- libbde-20190102/debian/libbde-tools.install 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/debian/libbde-tools.install 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 diff -Nru libbde-20190102/debian/libbde-utils.install libbde-20240223/debian/libbde-utils.install --- libbde-20190102/debian/libbde-utils.install 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/libbde-utils.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/bin -usr/share/man/man1 diff -Nru libbde-20190102/debian/libbde.install libbde-20240223/debian/libbde.install --- libbde-20190102/debian/libbde.install 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/debian/libbde.install 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*-*/lib*.so.* diff -Nru libbde-20190102/debian/libbde1t64.install libbde-20240223/debian/libbde1t64.install --- libbde-20190102/debian/libbde1t64.install 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/libbde1t64.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/*-*/lib*.so.* diff -Nru libbde-20190102/debian/libbde1t64.lintian-overrides libbde-20240223/debian/libbde1t64.lintian-overrides --- libbde-20190102/debian/libbde1t64.lintian-overrides 2024-02-29 08:45:59.000000000 +0000 +++ libbde-20240223/debian/libbde1t64.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -libbde1t64: package-name-doesnt-match-sonames libbde1 diff -Nru libbde-20190102/debian/libbde1t64.symbols libbde-20240223/debian/libbde1t64.symbols --- libbde-20190102/debian/libbde1t64.symbols 2024-02-29 08:45:59.000000000 +0000 +++ libbde-20240223/debian/libbde1t64.symbols 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -libbde.so.1 libbde1t64 #MINVER# - (optional|regex)^libcaes_.* 0 - (optional|regex)^libcdata_.* 0 - (optional|regex)^libcerror_.* 0 - (optional|regex)^libcfile_.* 0 - (optional|regex)^libclocale_.* 0 - (optional|regex)^libcnotify_.* 0 - (optional|regex)^libcpath_.* 0 - (optional|regex)^libcsplit_.* 0 - (optional|regex)^libcthreads_.* 0 - (optional|regex)^libfcache_.* 0 - (optional|regex)^libfdata_.* 0 - (optional|regex)^libfdatetime_.* 0 - (optional|regex)^libfguid_.* 0 - (optional|regex)^libfvalue_.* 0 - (optional|regex)^libhmac_.* 0 - (optional|regex)^libuna_.* 0 - bde_boot_entry_point_vista@Base 20150204 - bde_boot_entry_point_win7@Base 20150204 - bde_identifier@Base 20150204 - bde_ntfs_volume_file_system_signature@Base 20150204 - bde_signature@Base 20150204 - libbde_aes_ccm_encrypted_key_free@Base 20150204 - libbde_aes_ccm_encrypted_key_initialize@Base 20150204 - libbde_aes_ccm_encrypted_key_read@Base 20150204 - libbde_check_volume_signature@Base 20150204 - libbde_check_volume_signature_file_io_handle@Base 20150204 - libbde_diffuser_a_decrypt@Base 20150204 - libbde_diffuser_a_encrypt@Base 20150204 - libbde_diffuser_b_decrypt@Base 20150204 - libbde_diffuser_b_encrypt@Base 20150204 - libbde_diffuser_decrypt@Base 20150204 - libbde_diffuser_encrypt@Base 20150204 - libbde_encryption_crypt@Base 20150204 - libbde_encryption_free@Base 20150204 - libbde_encryption_initialize@Base 20150204 - libbde_encryption_set_keys@Base 20150204 - libbde_error_backtrace_fprint@Base 20150204 - libbde_error_backtrace_sprint@Base 20150204 - libbde_error_fprint@Base 20150204 - libbde_error_free@Base 20150204 - libbde_error_sprint@Base 20150204 - libbde_external_key_free@Base 20150204 - libbde_external_key_initialize@Base 20150204 - libbde_external_key_read@Base 20150204 - libbde_get_access_flags_read@Base 20150204 - libbde_get_codepage@Base 20150204 - libbde_get_version@Base 20150204 - libbde_internal_volume_read_buffer_from_file_io_handle@Base 20150204 - libbde_internal_volume_seek_offset@Base 20150204 - libbde_io_handle_clear@Base 20150204 - libbde_io_handle_free@Base 20150204 - libbde_io_handle_initialize@Base 20150204 - libbde_io_handle_read_sector@Base 20150204 - libbde_io_handle_read_unencrypted_volume_header@Base 20150204 - libbde_io_handle_read_volume_header@Base 20150204 - libbde_key_free@Base 20150204 - libbde_key_initialize@Base 20150204 - libbde_key_protector_free@Base 20150204 - libbde_key_protector_get_identifier@Base 20150204 - libbde_key_protector_get_type@Base 20150204 - libbde_key_protector_initialize@Base 20150204 - libbde_key_read@Base 20150204 - libbde_metadata_entry_empty@Base 20150204 - libbde_metadata_entry_free@Base 20150204 - libbde_metadata_entry_initialize@Base 20150204 - libbde_metadata_entry_read@Base 20150204 - libbde_metadata_entry_read_string@Base 20150204 - libbde_metadata_free@Base 20150204 - libbde_metadata_get_creation_time@Base 20150204 - libbde_metadata_get_number_of_volume_master_keys@Base 20150204 - libbde_metadata_get_utf16_description@Base 20150204 - libbde_metadata_get_utf16_description_size@Base 20150204 - libbde_metadata_get_utf8_description@Base 20150204 - libbde_metadata_get_utf8_description_size@Base 20150204 - libbde_metadata_get_volume_identifier@Base 20150204 - libbde_metadata_get_volume_master_key_by_index@Base 20150204 - libbde_metadata_initialize@Base 20150204 - libbde_metadata_read_block@Base 20150204 - libbde_metadata_read_entries@Base 20150204 - libbde_metadata_read_full_volume_encryption_key@Base 20150204 - libbde_metadata_read_header@Base 20150204 - libbde_metadata_read_volume_master_key@Base 20150204 - libbde_notify_set_stream@Base 20150204 - libbde_notify_set_verbose@Base 20150204 - libbde_notify_stream_close@Base 20150204 - libbde_notify_stream_open@Base 20150204 - libbde_password_calculate_key@Base 20150204 - libbde_password_keep_free@Base 20150204 - libbde_password_keep_initialize@Base 20150204 - libbde_sector_data_free@Base 20150204 - libbde_sector_data_initialize@Base 20150204 - libbde_sector_data_read@Base 20150204 - libbde_set_codepage@Base 20150204 - libbde_stretch_key_free@Base 20150204 - libbde_stretch_key_initialize@Base 20150204 - libbde_stretch_key_read@Base 20150204 - libbde_utf16_password_calculate_hash@Base 20150204 - libbde_utf16_recovery_password_calculate_hash@Base 20150204 - libbde_utf8_password_calculate_hash@Base 20150204 - libbde_utf8_recovery_password_calculate_hash@Base 20150204 - libbde_volume_close@Base 20150204 - libbde_volume_free@Base 20150204 - libbde_volume_get_creation_time@Base 20150204 - libbde_volume_get_encryption_method@Base 20150204 - libbde_volume_get_key_protector@Base 20150204 - libbde_volume_get_number_of_key_protectors@Base 20150204 - libbde_volume_get_offset@Base 20150204 - libbde_volume_get_size@Base 20150204 - libbde_volume_get_utf16_description@Base 20150204 - libbde_volume_get_utf16_description_size@Base 20150204 - libbde_volume_get_utf8_description@Base 20150204 - libbde_volume_get_utf8_description_size@Base 20150204 - libbde_volume_get_volume_identifier@Base 20150204 - libbde_volume_initialize@Base 20150204 - libbde_volume_is_locked@Base 20150204 - libbde_volume_master_key_free@Base 20150204 - libbde_volume_master_key_get_identifier@Base 20150204 - libbde_volume_master_key_get_protection_type@Base 20150204 - libbde_volume_master_key_initialize@Base 20150204 - libbde_volume_master_key_read@Base 20150204 - libbde_volume_open@Base 20150204 - libbde_volume_open_file_io_handle@Base 20150204 - libbde_volume_open_read@Base 20150204 - libbde_volume_open_read_keys_from_metadata@Base 20150204 - libbde_volume_read_buffer@Base 20150204 - libbde_volume_read_buffer_at_offset@Base 20150204 - libbde_volume_read_startup_key@Base 20150204 - libbde_volume_read_startup_key_file_io_handle@Base 20150204 - libbde_volume_seek_offset@Base 20150204 - libbde_volume_set_keys@Base 20150204 - libbde_volume_set_utf16_password@Base 20150204 - libbde_volume_set_utf16_recovery_password@Base 20150204 - libbde_volume_set_utf8_password@Base 20150204 - libbde_volume_set_utf8_recovery_password@Base 20150204 - libbde_volume_signal_abort@Base 20150204 - \ No newline at end of file diff -Nru libbde-20190102/debian/patches/ac-path-pkgconfig.patch libbde-20240223/debian/patches/ac-path-pkgconfig.patch --- libbde-20190102/debian/patches/ac-path-pkgconfig.patch 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/patches/ac-path-pkgconfig.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Description: Use cross-build compatible macro for finding pkg-config. - . - The package uses AC_PATH_PROG to discover the location of pkg-config(1). This - macro fails to select the correct version to support cross-compilation. - . - This patch changes it to use AC_PATH_TOOL. - . - Refer to https://bugs.debian.org/884798 for details. -Origin: other -Last-Update: 2020-11-25 - -=== modified file 'configure.ac' ---- a/configure.ac 2019-01-13 22:17:02 +0000 -+++ b/configure.ac 2020-11-25 20:24:09 +0000 -@@ -29,7 +29,7 @@ - AC_SUBST(LIBTOOL_DEPS) - - dnl Check for pkg-config --AC_PATH_PROG(PKGCONFIG,[pkg-config]) -+AC_PATH_TOOL(PKGCONFIG,[pkg-config]) - - dnl Support of internationalization (i18n) - AM_GNU_GETTEXT([external]) - diff -Nru libbde-20190102/debian/patches/disable-memory-tests-on-riscv64.patch libbde-20240223/debian/patches/disable-memory-tests-on-riscv64.patch --- libbde-20190102/debian/patches/disable-memory-tests-on-riscv64.patch 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/patches/disable-memory-tests-on-riscv64.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ ---- libbde/tests/bde_test_memory.h.bak 2021-01-26 15:28:40.423867694 +0100 -+++ libbde/tests/bde_test_memory.h 2021-01-26 15:28:50.923769449 +0100 -@@ -28,7 +28,7 @@ - extern "C" { - #endif - --#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && !defined( __sparc__ ) && !defined( HAVE_ASAN ) -+#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && !defined( __sparc__ ) && !defined( __riscv ) && !defined( HAVE_ASAN ) - #define HAVE_BDE_TEST_MEMORY 1 - #endif - diff -Nru libbde-20190102/debian/patches/series libbde-20240223/debian/patches/series --- libbde-20190102/debian/patches/series 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -ac-path-pkgconfig.patch -disable-memory-tests-on-riscv64.patch diff -Nru libbde-20190102/debian/python3-libbde.install libbde-20240223/debian/python3-libbde.install --- libbde-20190102/debian/python3-libbde.install 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/python3-libbde.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/usr/lib/python3* diff -Nru libbde-20190102/debian/rules libbde-20240223/debian/rules --- libbde-20190102/debian/rules 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/rules 2024-02-23 02:47:17.000000000 +0000 @@ -1,22 +1,31 @@ #!/usr/bin/make -f # -*- makefile -*- -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# Uncomment for debhelper verbose output. +# export DH_VERBOSE=1 export SKIP_PYTHON_TESTS=1 %: - dh $@ --with python3 --buildsystem=autoconf + dh $@ --buildsystem=autoconf --with=autoreconf,python3 +.PHONY: override_dh_auto_configure override_dh_auto_configure: - dh_auto_configure -- --disable-python2 --enable-python3 + dh_auto_configure -- --enable-python CFLAGS="-g" + +.PHONY: override_dh_install +override_dh_install: + dh_install --fail-missing -X.la -X/pybde.a +.PHONY: override_dh_missing override_dh_missing: dh_missing -X.la -X/pybde.a --fail-missing -override_dh_install: - dh_install -X.la -X/pybde.a +.PHONY: override_dh_strip +override_dh_strip: +ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) + dh_strip -plibbde --dbg-package=libbde-dbg + dh_strip -plibbde-tools --dbg-package=libbde-tools-dbg + dh_strip -plibbde-python3 --dbg-package=libbde-python3-dbg +endif + diff -Nru libbde-20190102/debian/salsa-ci.yml libbde-20240223/debian/salsa-ci.yml --- libbde-20190102/debian/salsa-ci.yml 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ ---- -include: - - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml - - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru libbde-20190102/debian/tests/autopkgtest-pkg-python.conf libbde-20240223/debian/tests/autopkgtest-pkg-python.conf --- libbde-20190102/debian/tests/autopkgtest-pkg-python.conf 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/tests/autopkgtest-pkg-python.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -import_name = pybde diff -Nru libbde-20190102/debian/upstream/metadata libbde-20240223/debian/upstream/metadata --- libbde-20190102/debian/upstream/metadata 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ ---- -Bug-Database: https://github.com/libyal/libbde/issues -Bug-Submit: https://github.com/libyal/libbde/issues/new diff -Nru libbde-20190102/debian/watch libbde-20240223/debian/watch --- libbde-20190102/debian/watch 2021-01-26 14:28:52.000000000 +0000 +++ libbde-20240223/debian/watch 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -version=4 -https://github.com/libyal/libbde/releases /.*/libbde-.*-(.*)\.tar\.gz diff -Nru libbde-20190102/depcomp libbde-20240223/depcomp --- libbde-20190102/depcomp 2019-01-02 15:57:52.000000000 +0000 +++ libbde-20240223/depcomp 2024-02-23 03:03:51.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru libbde-20190102/dpkg/changelog libbde-20240223/dpkg/changelog --- libbde-20190102/dpkg/changelog 2019-01-02 15:58:07.000000000 +0000 +++ libbde-20240223/dpkg/changelog 2024-02-23 03:04:01.000000000 +0000 @@ -1,5 +1,5 @@ -libbde (20190102-1) unstable; urgency=low +libbde (20240223-1) unstable; urgency=low * Auto-generated - -- Joachim Metz Wed, 02 Jan 2019 16:58:05 +0100 + -- Joachim Metz Fri, 23 Feb 2024 04:04:00 +0100 diff -Nru libbde-20190102/dpkg/compat libbde-20240223/dpkg/compat --- libbde-20190102/dpkg/compat 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/dpkg/compat 2024-02-23 02:47:17.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru libbde-20190102/dpkg/control libbde-20240223/dpkg/control --- libbde-20190102/dpkg/control 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/dpkg/control 2024-02-23 02:47:17.000000000 +0000 @@ -1,10 +1,11 @@ Source: libbde Priority: extra Maintainer: Joachim Metz -Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config, libssl-dev, python-dev, python3-dev, libfuse-dev -Standards-Version: 3.9.5 +Build-Depends: debhelper (>= 9), dh-autoreconf, dh-python, pkg-config, libssl-dev, python3-dev, python3-setuptools, libfuse-dev +Standards-Version: 4.1.4 Section: libs Homepage: https://github.com/libyal/libbde +Vcs-Git: https://github.com/libyal/libbde.git Package: libbde Architecture: any @@ -45,23 +46,6 @@ Description: Debugging symbols for libbde-tools Debugging symbols for libbde-tools. -Package: libbde-python -Section: python -Architecture: any -Depends: libbde (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} -Conflicts: python-libbde -Replaces: python-libbde -Suggests: libbde-python-dbg -Description: Python 2 bindings for libbde - Python 2 bindings for libbde. - -Package: libbde-python-dbg -Section: debug -Architecture: any -Depends: libbde-python (= ${binary:Version}), ${misc:Depends} -Description: Debugging symbols for libbde-python - Debugging symbols for libbde-python. - Package: libbde-python3 Section: python Architecture: any diff -Nru libbde-20190102/dpkg/copyright libbde-20240223/dpkg/copyright --- libbde-20190102/dpkg/copyright 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/dpkg/copyright 2024-02-23 02:47:19.000000000 +0000 @@ -3,7 +3,7 @@ Source: https://github.com/libyal/libbde Files: * -Copyright: 2011-2019, Joachim Metz +Copyright: 2011-2024, Joachim Metz License: LGPL-3.0+ License: LGPL-3.0+ diff -Nru libbde-20190102/dpkg/libbde-python.install libbde-20240223/dpkg/libbde-python.install --- libbde-20190102/dpkg/libbde-python.install 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/dpkg/libbde-python.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/usr/lib/python2* diff -Nru libbde-20190102/dpkg/rules libbde-20240223/dpkg/rules --- libbde-20190102/dpkg/rules 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/dpkg/rules 2024-02-23 02:47:17.000000000 +0000 @@ -7,22 +7,25 @@ export SKIP_PYTHON_TESTS=1 %: - dh $@ --with autoreconf + dh $@ --buildsystem=autoconf --with=autoreconf,python3 .PHONY: override_dh_auto_configure override_dh_auto_configure: - dh_auto_configure -- --enable-python2 --enable-python3 CFLAGS="-g" + dh_auto_configure -- --enable-python CFLAGS="-g" .PHONY: override_dh_install override_dh_install: dh_install --fail-missing -X.la -X/pybde.a +.PHONY: override_dh_missing +override_dh_missing: + dh_missing -X.la -X/pybde.a --fail-missing + .PHONY: override_dh_strip override_dh_strip: ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) dh_strip -plibbde --dbg-package=libbde-dbg dh_strip -plibbde-tools --dbg-package=libbde-tools-dbg - dh_strip -plibbde-python --dbg-package=libbde-python-dbg dh_strip -plibbde-python3 --dbg-package=libbde-python3-dbg endif diff -Nru libbde-20190102/include/Makefile.am libbde-20240223/include/Makefile.am --- libbde-20190102/include/Makefile.am 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/include/Makefile.am 2024-02-23 02:47:17.000000000 +0000 @@ -19,9 +19,9 @@ Makefile.in distclean: clean - /bin/rm -f libbde.h - /bin/rm -f libbde/definitions.h - /bin/rm -f libbde/features.h - /bin/rm -f libbde/types.h - /bin/rm -f Makefile + -rm -f libbde.h + -rm -f libbde/definitions.h + -rm -f libbde/features.h + -rm -f libbde/types.h + -rm -f Makefile diff -Nru libbde-20190102/include/Makefile.in libbde-20240223/include/Makefile.in --- libbde-20190102/include/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/include/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -168,6 +168,7 @@ am__installdirs = "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(pkgincludedir)" HEADERS = $(include_HEADERS) $(pkginclude_HEADERS) +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -185,8 +186,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libbde.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -203,6 +202,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -214,8 +219,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -233,7 +240,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -251,7 +257,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -305,8 +310,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -325,6 +328,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -335,8 +339,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -359,26 +363,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -387,7 +371,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -406,6 +389,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -448,9 +432,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -519,8 +500,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -543,11 +522,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -658,6 +634,8 @@ @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -710,7 +688,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -844,6 +821,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: uninstall-includeHEADERS uninstall-pkgincludeHEADERS .MAKE: install-am install-strip @@ -860,18 +845,19 @@ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am uninstall-includeHEADERS \ uninstall-pkgincludeHEADERS .PRECIOUS: Makefile distclean: clean - /bin/rm -f libbde.h - /bin/rm -f libbde/definitions.h - /bin/rm -f libbde/features.h - /bin/rm -f libbde/types.h - /bin/rm -f Makefile + -rm -f libbde.h + -rm -f libbde/definitions.h + -rm -f libbde/features.h + -rm -f libbde/types.h + -rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libbde-20190102/include/libbde/codepage.h libbde-20240223/include/libbde/codepage.h --- libbde-20190102/include/libbde/codepage.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde/codepage.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Codepage definitions for libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_CODEPAGE_H ) diff -Nru libbde-20190102/include/libbde/definitions.h libbde-20240223/include/libbde/definitions.h --- libbde-20190102/include/libbde/definitions.h 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/include/libbde/definitions.h 2024-02-23 03:04:01.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions for libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_DEFINITIONS_H ) @@ -24,11 +24,11 @@ #include -#define LIBBDE_VERSION 20190102 +#define LIBBDE_VERSION 20240223 /* The version string */ -#define LIBBDE_VERSION_STRING "20190102" +#define LIBBDE_VERSION_STRING "20240223" /* The file access * bit 1 set to 1 for read access @@ -63,6 +63,8 @@ */ enum LIBBDE_ENCRYPTION_METHODS { + LIBBDE_ENCRYPTION_METHOD_NONE = 0x0000UL, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER = 0x8000UL, LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER = 0x8001UL, LIBBDE_ENCRYPTION_METHOD_AES_128_CBC = 0x8002UL, @@ -80,6 +82,8 @@ LIBBDE_KEY_PROTECTION_TYPE_TPM = 0x0100, LIBBDE_KEY_PROTECTION_TYPE_STARTUP_KEY = 0x0200, + LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN = 0x0500, + LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD = 0x0800, LIBBDE_KEY_PROTECTION_TYPE_PASSWORD = 0x2000, diff -Nru libbde-20190102/include/libbde/definitions.h.in libbde-20240223/include/libbde/definitions.h.in --- libbde-20190102/include/libbde/definitions.h.in 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde/definitions.h.in 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions for libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_DEFINITIONS_H ) @@ -63,6 +63,8 @@ */ enum LIBBDE_ENCRYPTION_METHODS { + LIBBDE_ENCRYPTION_METHOD_NONE = 0x0000UL, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER = 0x8000UL, LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER = 0x8001UL, LIBBDE_ENCRYPTION_METHOD_AES_128_CBC = 0x8002UL, @@ -80,6 +82,8 @@ LIBBDE_KEY_PROTECTION_TYPE_TPM = 0x0100, LIBBDE_KEY_PROTECTION_TYPE_STARTUP_KEY = 0x0200, + LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN = 0x0500, + LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD = 0x0800, LIBBDE_KEY_PROTECTION_TYPE_PASSWORD = 0x2000, diff -Nru libbde-20190102/include/libbde/error.h libbde-20240223/include/libbde/error.h --- libbde-20190102/include/libbde/error.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde/error.h 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * The error code definitions for libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_ERROR_H ) diff -Nru libbde-20190102/include/libbde/extern.h libbde-20240223/include/libbde/extern.h --- libbde-20190102/include/libbde/extern.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde/extern.h 2024-02-23 02:47:18.000000000 +0000 @@ -4,22 +4,22 @@ * This header should be included in header files that export or import * library functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_EXTERN_H ) diff -Nru libbde-20190102/include/libbde/features.h libbde-20240223/include/libbde/features.h --- libbde-20190102/include/libbde/features.h 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/include/libbde/features.h 2024-02-23 03:04:01.000000000 +0000 @@ -1,22 +1,22 @@ /* * Features of libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_FEATURES_H ) diff -Nru libbde-20190102/include/libbde/features.h.in libbde-20240223/include/libbde/features.h.in --- libbde-20190102/include/libbde/features.h.in 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde/features.h.in 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Features of libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_FEATURES_H ) diff -Nru libbde-20190102/include/libbde/types.h libbde-20240223/include/libbde/types.h --- libbde-20190102/include/libbde/types.h 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/include/libbde/types.h 2024-02-23 03:04:01.000000000 +0000 @@ -1,22 +1,22 @@ /* * Type definitions for libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_TYPES_H ) @@ -33,7 +33,7 @@ #endif /* Microsoft Visual Studio C++ before Visual Studio 2010 or earlier versions of the Borland C++ Builder - * do not support the (u)int#_t type definitions but have __int# defintions instead + * do not support the (u)int#_t type definitions but have __int# definitions instead */ #if !defined( HAVE_INT8_T ) #define HAVE_INT8_T diff -Nru libbde-20190102/include/libbde/types.h.in libbde-20240223/include/libbde/types.h.in --- libbde-20190102/include/libbde/types.h.in 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde/types.h.in 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Type definitions for libbde * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_TYPES_H ) @@ -33,7 +33,7 @@ #endif /* Microsoft Visual Studio C++ before Visual Studio 2010 or earlier versions of the Borland C++ Builder - * do not support the (u)int#_t type definitions but have __int# defintions instead + * do not support the (u)int#_t type definitions but have __int# definitions instead */ #if !defined( HAVE_INT8_T ) #define HAVE_INT8_T diff -Nru libbde-20190102/include/libbde.h libbde-20240223/include/libbde.h --- libbde-20190102/include/libbde.h 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/include/libbde.h 2024-02-23 03:04:01.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library to access the BitLocker Drive Encryption (BVE) format * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_H ) @@ -215,7 +215,7 @@ libbde_error_t **error ); /* Opens a volume - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ int libbde_volume_open( @@ -227,7 +227,7 @@ #if defined( LIBBDE_HAVE_WIDE_CHARACTER_TYPE ) /* Opens a volume - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ int libbde_volume_open_wide( @@ -241,7 +241,7 @@ #if defined( LIBBDE_HAVE_BFIO ) /* Opens a volume using a Basic File IO (bfio) handle - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ int libbde_volume_open_file_io_handle( @@ -268,7 +268,15 @@ libbde_volume_t *volume, libbde_error_t **error ); -/* Reads data at the current offset into a buffer +/* Unlocks the volume + * Returns 1 if the volume is unlocked, 0 if not or -1 on error + */ +LIBBDE_EXTERN \ +int libbde_volume_unlock( + libbde_volume_t *volume, + libbde_error_t **error ); + +/* Reads unencrypted data at the current offset into a buffer * Returns the number of bytes read or -1 on error */ LIBBDE_EXTERN \ @@ -278,7 +286,7 @@ size_t buffer_size, libbde_error_t **error ); -/* Reads (media) data at a specific offset +/* Reads unencrypted data at a specific offset * Returns the number of bytes read or -1 on error */ LIBBDE_EXTERN \ @@ -289,32 +297,7 @@ off64_t offset, libbde_error_t **error ); -#ifdef TODO_WRITE_SUPPORT - -/* Writes (media) data at the current offset - * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error - */ -LIBBDE_EXTERN \ -ssize_t libbde_volume_write_buffer( - libbde_volume_t *volume, - void *buffer, - size_t buffer_size, - libbde_error_t **error ); - -/* Writes (media) data at a specific offset, - * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error - */ -LIBBDE_EXTERN \ -ssize_t libbde_volume_write_buffer_at_offset( - libbde_volume_t *volume, - const void *buffer, - size_t buffer_size, - off64_t offset, - libbde_error_t **error ); - -#endif /* TODO_WRITE_SUPPORT */ - -/* Seeks a certain offset of the data +/* Seeks a certain offset within the unencrypted data * Returns the offset if seek is successful or -1 on error */ LIBBDE_EXTERN \ @@ -324,7 +307,7 @@ int whence, libbde_error_t **error ); -/* Retrieves the the current offset of the (volume) data +/* Retrieves the current offset within the unencrypted data * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ @@ -358,8 +341,8 @@ LIBBDE_EXTERN \ int libbde_volume_get_volume_identifier( libbde_volume_t *volume, - uint8_t *volume_identifier, - size_t size, + uint8_t *guid_data, + size_t guid_data_size, libbde_error_t **error ); /* Retrieves the creation date and time @@ -428,6 +411,20 @@ * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ +int libbde_volume_get_key_protector_by_index( + libbde_volume_t *volume, + int key_protector_index, + libbde_key_protector_t **key_protector, + libbde_error_t **error ); + +/* Retrieves a specific volume master key protector + * + * This function deprecated use libbde_volume_get_key_protector_by_index instead + * + * Returns 1 if successful or -1 on error + */ +LIBBDE_DEPRECATED \ +LIBBDE_EXTERN \ int libbde_volume_get_key_protector( libbde_volume_t *volume, int key_protector_index, diff -Nru libbde-20190102/include/libbde.h.in libbde-20240223/include/libbde.h.in --- libbde-20190102/include/libbde.h.in 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/include/libbde.h.in 2024-02-23 02:47:18.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library to access the BitLocker Drive Encryption (BVE) format * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_H ) @@ -215,7 +215,7 @@ libbde_error_t **error ); /* Opens a volume - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ int libbde_volume_open( @@ -227,7 +227,7 @@ #if defined( LIBBDE_HAVE_WIDE_CHARACTER_TYPE ) /* Opens a volume - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ int libbde_volume_open_wide( @@ -241,7 +241,7 @@ #if defined( LIBBDE_HAVE_BFIO ) /* Opens a volume using a Basic File IO (bfio) handle - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ int libbde_volume_open_file_io_handle( @@ -268,7 +268,15 @@ libbde_volume_t *volume, libbde_error_t **error ); -/* Reads data at the current offset into a buffer +/* Unlocks the volume + * Returns 1 if the volume is unlocked, 0 if not or -1 on error + */ +LIBBDE_EXTERN \ +int libbde_volume_unlock( + libbde_volume_t *volume, + libbde_error_t **error ); + +/* Reads unencrypted data at the current offset into a buffer * Returns the number of bytes read or -1 on error */ LIBBDE_EXTERN \ @@ -278,7 +286,7 @@ size_t buffer_size, libbde_error_t **error ); -/* Reads (media) data at a specific offset +/* Reads unencrypted data at a specific offset * Returns the number of bytes read or -1 on error */ LIBBDE_EXTERN \ @@ -289,32 +297,7 @@ off64_t offset, libbde_error_t **error ); -#ifdef TODO_WRITE_SUPPORT - -/* Writes (media) data at the current offset - * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error - */ -LIBBDE_EXTERN \ -ssize_t libbde_volume_write_buffer( - libbde_volume_t *volume, - void *buffer, - size_t buffer_size, - libbde_error_t **error ); - -/* Writes (media) data at a specific offset, - * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error - */ -LIBBDE_EXTERN \ -ssize_t libbde_volume_write_buffer_at_offset( - libbde_volume_t *volume, - const void *buffer, - size_t buffer_size, - off64_t offset, - libbde_error_t **error ); - -#endif /* TODO_WRITE_SUPPORT */ - -/* Seeks a certain offset of the data +/* Seeks a certain offset within the unencrypted data * Returns the offset if seek is successful or -1 on error */ LIBBDE_EXTERN \ @@ -324,7 +307,7 @@ int whence, libbde_error_t **error ); -/* Retrieves the the current offset of the (volume) data +/* Retrieves the current offset within the unencrypted data * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ @@ -358,8 +341,8 @@ LIBBDE_EXTERN \ int libbde_volume_get_volume_identifier( libbde_volume_t *volume, - uint8_t *volume_identifier, - size_t size, + uint8_t *guid_data, + size_t guid_data_size, libbde_error_t **error ); /* Retrieves the creation date and time @@ -428,6 +411,20 @@ * Returns 1 if successful or -1 on error */ LIBBDE_EXTERN \ +int libbde_volume_get_key_protector_by_index( + libbde_volume_t *volume, + int key_protector_index, + libbde_key_protector_t **key_protector, + libbde_error_t **error ); + +/* Retrieves a specific volume master key protector + * + * This function deprecated use libbde_volume_get_key_protector_by_index instead + * + * Returns 1 if successful or -1 on error + */ +LIBBDE_DEPRECATED \ +LIBBDE_EXTERN \ int libbde_volume_get_key_protector( libbde_volume_t *volume, int key_protector_index, diff -Nru libbde-20190102/install-sh libbde-20240223/install-sh --- libbde-20190102/install-sh 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/install-sh 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -451,7 +456,18 @@ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -477,6 +493,13 @@ then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -491,9 +514,9 @@ # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff -Nru libbde-20190102/libbde/Makefile.am libbde-20240223/libbde/Makefile.am --- libbde-20190102/libbde/Makefile.am 2018-08-06 18:11:52.000000000 +0000 +++ libbde-20240223/libbde/Makefile.am 2023-12-03 08:57:22.000000000 +0000 @@ -12,7 +12,6 @@ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ - @LIBFDATA_CPPFLAGS@ \ @LIBFDATETIME_CPPFLAGS@ \ @LIBFGUID_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @@ -30,7 +29,7 @@ libbde_debug.c libbde_debug.h \ libbde_definitions.h \ libbde_diffuser.c libbde_diffuser.h \ - libbde_encryption.c libbde_encryption.h \ + libbde_encryption_context.c libbde_encryption_context.h \ libbde_error.c libbde_error.h \ libbde_extern.h \ libbde_external_key.c libbde_external_key.h \ @@ -45,24 +44,28 @@ libbde_libcnotify.h \ libbde_libcthreads.h \ libbde_libfcache.h \ - libbde_libfdata.h \ libbde_libfdatetime.h \ libbde_libfguid.h \ libbde_libfvalue.h \ libbde_libhmac.h \ libbde_libuna.h \ libbde_metadata.c libbde_metadata.h \ + libbde_metadata_block_header.c libbde_metadata_block_header.h \ libbde_metadata_entry.c libbde_metadata_entry.h \ + libbde_metadata_header.c libbde_metadata_header.h \ libbde_notify.c libbde_notify.h \ + libbde_ntfs_volume_header.c libbde_ntfs_volume_header.h \ libbde_password.c libbde_password.h \ libbde_password_keep.c libbde_password_keep.h \ libbde_recovery.c libbde_recovery.h \ libbde_sector_data.c libbde_sector_data.h \ + libbde_sector_data_vector.c libbde_sector_data_vector.h \ libbde_stretch_key.c libbde_stretch_key.h \ libbde_support.c libbde_support.h \ libbde_types.h \ libbde_unused.h \ libbde_volume.c libbde_volume.h \ + libbde_volume_header.c libbde_volume_header.h \ libbde_volume_master_key.c libbde_volume_master_key.h \ bde_metadata.h \ bde_volume.h @@ -79,7 +82,6 @@ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBFCACHE_LIBADD@ \ - @LIBFDATA_LIBADD@ \ @LIBFDATETIME_LIBADD@ \ @LIBFGUID_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @@ -100,11 +102,13 @@ Makefile.in distclean: clean - /bin/rm -f libbde_definitions.h - /bin/rm -f libbde.rc - /bin/rm -f Makefile + -rm -f libbde_definitions.h + -rm -f libbde.rc + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libbde ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libbde_la_SOURCES) diff -Nru libbde-20190102/libbde/Makefile.in libbde-20240223/libbde/Makefile.in --- libbde-20190102/libbde/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libbde/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libbde ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -149,13 +149,17 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libbde_la_DEPENDENCIES = am_libbde_la_OBJECTS = libbde.lo libbde_aes_ccm_encrypted_key.lo \ - libbde_debug.lo libbde_diffuser.lo libbde_encryption.lo \ - libbde_error.lo libbde_external_key.lo libbde_io_handle.lo \ - libbde_key.lo libbde_key_protector.lo libbde_metadata.lo \ - libbde_metadata_entry.lo libbde_notify.lo libbde_password.lo \ + libbde_debug.lo libbde_diffuser.lo \ + libbde_encryption_context.lo libbde_error.lo \ + libbde_external_key.lo libbde_io_handle.lo libbde_key.lo \ + libbde_key_protector.lo libbde_metadata.lo \ + libbde_metadata_block_header.lo libbde_metadata_entry.lo \ + libbde_metadata_header.lo libbde_notify.lo \ + libbde_ntfs_volume_header.lo libbde_password.lo \ libbde_password_keep.lo libbde_recovery.lo \ - libbde_sector_data.lo libbde_stretch_key.lo libbde_support.lo \ - libbde_volume.lo libbde_volume_master_key.lo + libbde_sector_data.lo libbde_sector_data_vector.lo \ + libbde_stretch_key.lo libbde_support.lo libbde_volume.lo \ + libbde_volume_header.lo libbde_volume_master_key.lo libbde_la_OBJECTS = $(am_libbde_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -182,18 +186,25 @@ am__depfiles_remade = ./$(DEPDIR)/libbde.Plo \ ./$(DEPDIR)/libbde_aes_ccm_encrypted_key.Plo \ ./$(DEPDIR)/libbde_debug.Plo ./$(DEPDIR)/libbde_diffuser.Plo \ - ./$(DEPDIR)/libbde_encryption.Plo ./$(DEPDIR)/libbde_error.Plo \ + ./$(DEPDIR)/libbde_encryption_context.Plo \ + ./$(DEPDIR)/libbde_error.Plo \ ./$(DEPDIR)/libbde_external_key.Plo \ ./$(DEPDIR)/libbde_io_handle.Plo ./$(DEPDIR)/libbde_key.Plo \ ./$(DEPDIR)/libbde_key_protector.Plo \ ./$(DEPDIR)/libbde_metadata.Plo \ + ./$(DEPDIR)/libbde_metadata_block_header.Plo \ ./$(DEPDIR)/libbde_metadata_entry.Plo \ - ./$(DEPDIR)/libbde_notify.Plo ./$(DEPDIR)/libbde_password.Plo \ + ./$(DEPDIR)/libbde_metadata_header.Plo \ + ./$(DEPDIR)/libbde_notify.Plo \ + ./$(DEPDIR)/libbde_ntfs_volume_header.Plo \ + ./$(DEPDIR)/libbde_password.Plo \ ./$(DEPDIR)/libbde_password_keep.Plo \ ./$(DEPDIR)/libbde_recovery.Plo \ ./$(DEPDIR)/libbde_sector_data.Plo \ + ./$(DEPDIR)/libbde_sector_data_vector.Plo \ ./$(DEPDIR)/libbde_stretch_key.Plo \ ./$(DEPDIR)/libbde_support.Plo ./$(DEPDIR)/libbde_volume.Plo \ + ./$(DEPDIR)/libbde_volume_header.Plo \ ./$(DEPDIR)/libbde_volume_master_key.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -221,6 +232,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -238,8 +250,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libbde.rc.in \ $(srcdir)/libbde_definitions.h.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -257,6 +267,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -268,8 +284,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -287,7 +305,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -305,7 +322,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -359,8 +375,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -379,6 +393,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -389,8 +404,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -413,26 +428,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -441,7 +436,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -460,6 +454,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -502,9 +497,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -573,8 +565,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -597,11 +587,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -624,7 +611,6 @@ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ - @LIBFDATA_CPPFLAGS@ \ @LIBFDATETIME_CPPFLAGS@ \ @LIBFGUID_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @@ -641,7 +627,7 @@ libbde_debug.c libbde_debug.h \ libbde_definitions.h \ libbde_diffuser.c libbde_diffuser.h \ - libbde_encryption.c libbde_encryption.h \ + libbde_encryption_context.c libbde_encryption_context.h \ libbde_error.c libbde_error.h \ libbde_extern.h \ libbde_external_key.c libbde_external_key.h \ @@ -656,24 +642,28 @@ libbde_libcnotify.h \ libbde_libcthreads.h \ libbde_libfcache.h \ - libbde_libfdata.h \ libbde_libfdatetime.h \ libbde_libfguid.h \ libbde_libfvalue.h \ libbde_libhmac.h \ libbde_libuna.h \ libbde_metadata.c libbde_metadata.h \ + libbde_metadata_block_header.c libbde_metadata_block_header.h \ libbde_metadata_entry.c libbde_metadata_entry.h \ + libbde_metadata_header.c libbde_metadata_header.h \ libbde_notify.c libbde_notify.h \ + libbde_ntfs_volume_header.c libbde_ntfs_volume_header.h \ libbde_password.c libbde_password.h \ libbde_password_keep.c libbde_password_keep.h \ libbde_recovery.c libbde_recovery.h \ libbde_sector_data.c libbde_sector_data.h \ + libbde_sector_data_vector.c libbde_sector_data_vector.h \ libbde_stretch_key.c libbde_stretch_key.h \ libbde_support.c libbde_support.h \ libbde_types.h \ libbde_unused.h \ libbde_volume.c libbde_volume.h \ + libbde_volume_header.c libbde_volume_header.h \ libbde_volume_master_key.c libbde_volume_master_key.h \ bde_metadata.h \ bde_volume.h @@ -690,7 +680,6 @@ @LIBCPATH_LIBADD@ \ @LIBBFIO_LIBADD@ \ @LIBFCACHE_LIBADD@ \ - @LIBFDATA_LIBADD@ \ @LIBFDATETIME_LIBADD@ \ @LIBFGUID_LIBADD@ \ @LIBFVALUE_LIBADD@ \ @@ -795,22 +784,27 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_aes_ccm_encrypted_key.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_diffuser.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_encryption.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_encryption_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_external_key.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_io_handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_key.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_key_protector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_metadata.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_metadata_block_header.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_metadata_entry.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_metadata_header.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_notify.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_ntfs_volume_header.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_password.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_password_keep.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_recovery.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_sector_data.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_sector_data_vector.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_stretch_key.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_volume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_volume_header.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbde_volume_master_key.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @@ -845,6 +839,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -897,7 +893,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -1022,22 +1017,27 @@ -rm -f ./$(DEPDIR)/libbde_aes_ccm_encrypted_key.Plo -rm -f ./$(DEPDIR)/libbde_debug.Plo -rm -f ./$(DEPDIR)/libbde_diffuser.Plo - -rm -f ./$(DEPDIR)/libbde_encryption.Plo + -rm -f ./$(DEPDIR)/libbde_encryption_context.Plo -rm -f ./$(DEPDIR)/libbde_error.Plo -rm -f ./$(DEPDIR)/libbde_external_key.Plo -rm -f ./$(DEPDIR)/libbde_io_handle.Plo -rm -f ./$(DEPDIR)/libbde_key.Plo -rm -f ./$(DEPDIR)/libbde_key_protector.Plo -rm -f ./$(DEPDIR)/libbde_metadata.Plo + -rm -f ./$(DEPDIR)/libbde_metadata_block_header.Plo -rm -f ./$(DEPDIR)/libbde_metadata_entry.Plo + -rm -f ./$(DEPDIR)/libbde_metadata_header.Plo -rm -f ./$(DEPDIR)/libbde_notify.Plo + -rm -f ./$(DEPDIR)/libbde_ntfs_volume_header.Plo -rm -f ./$(DEPDIR)/libbde_password.Plo -rm -f ./$(DEPDIR)/libbde_password_keep.Plo -rm -f ./$(DEPDIR)/libbde_recovery.Plo -rm -f ./$(DEPDIR)/libbde_sector_data.Plo + -rm -f ./$(DEPDIR)/libbde_sector_data_vector.Plo -rm -f ./$(DEPDIR)/libbde_stretch_key.Plo -rm -f ./$(DEPDIR)/libbde_support.Plo -rm -f ./$(DEPDIR)/libbde_volume.Plo + -rm -f ./$(DEPDIR)/libbde_volume_header.Plo -rm -f ./$(DEPDIR)/libbde_volume_master_key.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1055,6 +1055,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip @@ -1071,17 +1079,20 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile distclean: clean - /bin/rm -f libbde_definitions.h - /bin/rm -f libbde.rc - /bin/rm -f Makefile + -rm -f libbde_definitions.h + -rm -f libbde.rc + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libbde ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libbde_la_SOURCES) diff -Nru libbde-20190102/libbde/bde_metadata.h libbde-20240223/libbde/bde_metadata.h --- libbde-20190102/libbde/bde_metadata.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/bde_metadata.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The BitLocker (BVE) metadata definition * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_METADATA_H ) diff -Nru libbde-20190102/libbde/bde_volume.h libbde-20240223/libbde/bde_volume.h --- libbde-20190102/libbde/bde_volume.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/bde_volume.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The BitLocker disk encryption (BDE) volume definition * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_VOLUME_H ) @@ -391,6 +391,121 @@ /* The sector signature * Consists of 2 bytes + * Contains: 0x55 0xaa + */ + uint8_t sector_signature[ 2 ]; +}; + +typedef struct bde_ntfs_volume_header bde_ntfs_volume_header_t; + +struct bde_ntfs_volume_header +{ + /* Boot entry point + * Consists of 3 bytes + * Contains a jump instruction to the boot loader + */ + uint8_t boot_entry_point[ 3 ]; + + /* The file system signature + * Consists of 8 bytes + * Contains: "NTFS\x20\x20\x20\x20" + */ + uint8_t file_system_signature[ 8 ]; + + /* The number of bytes per sector + * Consists of 2 bytes + */ + uint8_t bytes_per_sector[ 2 ]; + + /* The number of sectors per cluster block + * Consists of 1 byte + */ + uint8_t sectors_per_cluster_block; + + /* Unknown + * Consists of 7 bytes + */ + uint8_t unknown1[ 7 ]; + + /* The media descriptor + * Consists of 1 byte + */ + uint8_t media_descriptor; + + /* Unknown + * Consists of 2 bytes + */ + uint8_t unknown2[ 2 ]; + + /* The number of sectors per track + * Consists of 2 bytes + */ + uint8_t sectors_per_track[ 2 ]; + + /* The number of heads + * Consists of 2 bytes + */ + uint8_t number_of_heads[ 2 ]; + + /* The number of hidden sectors + * Consists of 4 bytes + */ + uint8_t number_of_hidden_sectors[ 4 ]; + + /* Unknown + * Consists of 4 bytes + */ + uint8_t unknown3[ 4 ]; + + /* Unknown + * Consists of 4 bytes + */ + uint8_t unknown4[ 4 ]; + + /* The total number of sectors + * Consists of 8 bytes + */ + uint8_t total_number_of_sectors[ 8 ]; + + /* The master file table (MFT) cluster block number + * Consists of 8 bytes + */ + uint8_t mft_cluster_block_number[ 8 ]; + + /* The mirror MFT cluster block number + * Consists of 8 bytes + */ + uint8_t mirror_mft_cluster_block_number[ 8 ]; + + /* The MFT entry size + * Consists of 4 bytes + * Contains the number of cluster blocks or a byte size + */ + uint8_t mft_entry_size[ 4 ]; + + /* The index entry size + * Consists of 4 bytes + * Contains the number of cluster blocks or a byte size + */ + uint8_t index_entry_size[ 4 ]; + + /* The volume serial number + * Consists of 8 bytes + */ + uint8_t volume_serial_number[ 8 ]; + + /* The checksum + * Consists of 4 bytes + */ + uint8_t checksum[ 4 ]; + + /* The bootcode + * Consists of 426 bytes + */ + uint8_t bootcode[ 426 ]; + + /* The sector signature + * Consists of 2 bytes * Contains: 0x55 0xaa */ uint8_t sector_signature[ 2 ]; diff -Nru libbde-20190102/libbde/libbde.c libbde-20240223/libbde/libbde.c --- libbde-20190102/libbde/libbde.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library to access the BitLocker Drive Encryption (BDE) format * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde.rc libbde-20240223/libbde/libbde.rc --- libbde-20190102/libbde/libbde.rc 2019-01-02 15:58:07.000000000 +0000 +++ libbde-20240223/libbde/libbde.rc 2024-02-23 03:04:01.000000000 +0000 @@ -22,12 +22,12 @@ BLOCK "040904E4" BEGIN VALUE "FileDescription", "Library to access the BitLocker Drive Encryption (BDE) format\0" - VALUE "FileVersion", "20190102" "\0" + VALUE "FileVersion", "20240223" "\0" VALUE "InternalName", "libbde.dll\0" - VALUE "LegalCopyright", "(C) 2011-2019, Joachim Metz \0" + VALUE "LegalCopyright", "(C) 2011-2024, Joachim Metz \0" VALUE "OriginalFilename", "libbde.dll\0" VALUE "ProductName", "libbde\0" - VALUE "ProductVersion", "20190102" "\0" + VALUE "ProductVersion", "20240223" "\0" VALUE "Comments", "For more information visit https://github.com/libyal/libbde/\0" END END diff -Nru libbde-20190102/libbde/libbde.rc.in libbde-20240223/libbde/libbde.rc.in --- libbde-20190102/libbde/libbde.rc.in 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/libbde/libbde.rc.in 2024-02-23 02:47:19.000000000 +0000 @@ -24,7 +24,7 @@ VALUE "FileDescription", "Library to access the BitLocker Drive Encryption (BDE) format\0" VALUE "FileVersion", "@VERSION@" "\0" VALUE "InternalName", "libbde.dll\0" - VALUE "LegalCopyright", "(C) 2011-2019, Joachim Metz \0" + VALUE "LegalCopyright", "(C) 2011-2024, Joachim Metz \0" VALUE "OriginalFilename", "libbde.dll\0" VALUE "ProductName", "libbde\0" VALUE "ProductVersion", "@VERSION@" "\0" diff -Nru libbde-20190102/libbde/libbde_aes_ccm_encrypted_key.c libbde-20240223/libbde/libbde_aes_ccm_encrypted_key.c --- libbde-20190102/libbde/libbde_aes_ccm_encrypted_key.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_aes_ccm_encrypted_key.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * AES-CCM encrypted key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -207,13 +207,14 @@ value_data = metadata_entry->value_data; value_data_size = metadata_entry->value_data_size; - if( value_data_size < sizeof( bde_metadata_entry_aes_ccm_encrypted_key_header_t ) ) + if( ( value_data_size < sizeof( bde_metadata_entry_aes_ccm_encrypted_key_header_t ) ) + || ( value_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: value data size value out of bounds.", + "%s: invalid metadata entry - value data size value out of bounds.", function ); return( -1 ); diff -Nru libbde-20190102/libbde/libbde_aes_ccm_encrypted_key.h libbde-20240223/libbde/libbde_aes_ccm_encrypted_key.h --- libbde-20190102/libbde/libbde_aes_ccm_encrypted_key.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_aes_ccm_encrypted_key.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * AES-CCM encrypted key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_AES_CCM_ENCRYPTED_KEY_H ) diff -Nru libbde-20190102/libbde/libbde_codepage.h libbde-20240223/libbde/libbde_codepage.h --- libbde-20190102/libbde/libbde_codepage.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_codepage.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Codepage functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_CODEPAGE_H ) @@ -29,14 +29,14 @@ extern "C" { #endif -#if !defined( HAVE_LOCAL_LIBBDE ) - -#include - /* Define HAVE_LOCAL_LIBBDE for local use of libbde * The definitions in are copied here * for local use of libbde */ +#if !defined( HAVE_LOCAL_LIBBDE ) + +#include + #else /* The codepage definitions diff -Nru libbde-20190102/libbde/libbde_debug.c libbde-20240223/libbde/libbde_debug.c --- libbde-20190102/libbde/libbde_debug.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_debug.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Debug functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -57,6 +57,9 @@ case LIBBDE_ENCRYPTION_METHOD_AES_256_XTS: return( "AES-XTS 256-bit encryption" ); + + case LIBBDE_ENCRYPTION_METHOD_NONE: + return( "None" ); } return( "_UNKNOWN_" ); } @@ -157,6 +160,9 @@ case LIBBDE_KEY_PROTECTION_TYPE_STARTUP_KEY: return( "startup key protected" ); + case LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN: + return( "TPM and PIN protected" ); + case LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD: return( "recovery password protected" ); diff -Nru libbde-20190102/libbde/libbde_debug.h libbde-20240223/libbde/libbde_debug.h --- libbde-20190102/libbde/libbde_debug.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_debug.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Debug functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_DEBUG_H ) diff -Nru libbde-20190102/libbde/libbde_definitions.h libbde-20240223/libbde/libbde_definitions.h --- libbde-20190102/libbde/libbde_definitions.h 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/libbde/libbde_definitions.h 2024-02-23 03:04:01.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_DEFINITIONS_H ) @@ -34,11 +34,11 @@ * for local use of libbde */ #else -#define LIBBDE_VERSION 20190102 +#define LIBBDE_VERSION 20240223 /* The version string */ -#define LIBBDE_VERSION_STRING "20190102" +#define LIBBDE_VERSION_STRING "20240223" /* The file access * bit 1 set to 1 for read access @@ -73,6 +73,8 @@ */ enum LIBBDE_ENCRYPTION_METHODS { + LIBBDE_ENCRYPTION_METHOD_NONE = 0x0000UL, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER = 0x8000UL, LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER = 0x8001UL, LIBBDE_ENCRYPTION_METHOD_AES_128_CBC = 0x8002UL, @@ -90,6 +92,8 @@ LIBBDE_KEY_PROTECTION_TYPE_TPM = 0x0100, LIBBDE_KEY_PROTECTION_TYPE_STARTUP_KEY = 0x0200, + LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN = 0x0500, + LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD = 0x0800, LIBBDE_KEY_PROTECTION_TYPE_PASSWORD = 0x2000, @@ -144,7 +148,18 @@ LIBBDE_ENCRYPTION_CRYPT_MODE_ENCRYPT = 1 }; -#define LIBBDE_MAXIMUM_CACHE_ENTRIES_SECTORS 16 +/* The sector modes + */ +enum LIBBDE_SECTOR_TYPES +{ + LIBBDE_SECTOR_TYPE_ENCRYPTED_DATA = 0, + LIBBDE_SECTOR_TYPE_METADATA = 1, + LIBBDE_SECTOR_TYPE_RAW_DATA = 2 +}; + +#define LIBBDE_MAXIMUM_CACHE_ENTRIES_SECTOR_DATA 16 + +#define LIBBDE_MAXIMUM_FVE_METADATA_SIZE 16 * 1024 * 1024 #endif /* !defined( _LIBBDE_INTERNAL_DEFINITIONS_H ) */ diff -Nru libbde-20190102/libbde/libbde_definitions.h.in libbde-20240223/libbde/libbde_definitions.h.in --- libbde-20190102/libbde/libbde_definitions.h.in 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/libbde/libbde_definitions.h.in 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_DEFINITIONS_H ) @@ -73,6 +73,8 @@ */ enum LIBBDE_ENCRYPTION_METHODS { + LIBBDE_ENCRYPTION_METHOD_NONE = 0x0000UL, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER = 0x8000UL, LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER = 0x8001UL, LIBBDE_ENCRYPTION_METHOD_AES_128_CBC = 0x8002UL, @@ -90,6 +92,8 @@ LIBBDE_KEY_PROTECTION_TYPE_TPM = 0x0100, LIBBDE_KEY_PROTECTION_TYPE_STARTUP_KEY = 0x0200, + LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN = 0x0500, + LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD = 0x0800, LIBBDE_KEY_PROTECTION_TYPE_PASSWORD = 0x2000, @@ -144,7 +148,18 @@ LIBBDE_ENCRYPTION_CRYPT_MODE_ENCRYPT = 1 }; -#define LIBBDE_MAXIMUM_CACHE_ENTRIES_SECTORS 16 +/* The sector modes + */ +enum LIBBDE_SECTOR_TYPES +{ + LIBBDE_SECTOR_TYPE_ENCRYPTED_DATA = 0, + LIBBDE_SECTOR_TYPE_METADATA = 1, + LIBBDE_SECTOR_TYPE_RAW_DATA = 2 +}; + +#define LIBBDE_MAXIMUM_CACHE_ENTRIES_SECTOR_DATA 16 + +#define LIBBDE_MAXIMUM_FVE_METADATA_SIZE 16 * 1024 * 1024 #endif /* !defined( _LIBBDE_INTERNAL_DEFINITIONS_H ) */ diff -Nru libbde-20190102/libbde/libbde_diffuser.c libbde-20240223/libbde/libbde_diffuser.c --- libbde-20190102/libbde/libbde_diffuser.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_diffuser.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Elephant diffuser encryption functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -52,24 +52,15 @@ return( -1 ); } - if( data_size > (size_t) SSIZE_MAX ) + if( ( data_size == 0 ) + || ( data_size > (size_t) MEMORY_MAXIMUM_ALLOCATION_SIZE ) + || ( ( data_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( ( data_size % 4 ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported data size - not a multitude of 4.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", function ); return( -1 ); @@ -402,24 +393,15 @@ return( -1 ); } - if( data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( ( data_size % 4 ) != 0 ) + if( ( data_size == 0 ) + || ( data_size > (size_t) MEMORY_MAXIMUM_ALLOCATION_SIZE ) + || ( ( data_size % 4 ) != 0 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported data size - not a multitude of 4.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", function ); return( -1 ); diff -Nru libbde-20190102/libbde/libbde_diffuser.h libbde-20240223/libbde/libbde_diffuser.h --- libbde-20190102/libbde/libbde_diffuser.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_diffuser.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Elephant diffuser encryption functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_DIFFUSER_H ) diff -Nru libbde-20190102/libbde/libbde_encryption.c libbde-20240223/libbde/libbde_encryption.c --- libbde-20190102/libbde/libbde_encryption.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_encryption.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,996 +0,0 @@ -/* - * Encryption functions - * - * Copyright (C) 2011-2019, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include -#include - -#include "libbde_definitions.h" -#include "libbde_diffuser.h" -#include "libbde_encryption.h" -#include "libbde_libcaes.h" -#include "libbde_libcerror.h" -#include "libbde_libcnotify.h" - -/* Creates an encryption context - * Make sure the value encryption context is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libbde_encryption_initialize( - libbde_encryption_context_t **context, - uint16_t method, - libcerror_error_t **error ) -{ - static char *function = "libbde_encryption_initialize"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid context value already set.", - function ); - - return( -1 ); - } - if( ( method != LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - && ( method != LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - && ( method != LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - && ( method != LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) - && ( method != LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - && ( method != LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported method.", - function ); - - return( -1 ); - } - *context = memory_allocate_structure( - libbde_encryption_context_t ); - - if( *context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create context.", - function ); - - goto on_error; - } - if( memory_set( - *context, - 0, - sizeof( libbde_encryption_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - memory_free( - *context ); - - *context = NULL; - - return( -1 ); - } - if( ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - || ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libcaes_context_initialize( - &( ( *context )->fvek_decryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize FVEK decryption context.", - function ); - - goto on_error; - } - if( libcaes_context_initialize( - &( ( *context )->fvek_encryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize FVEK encryption context.", - function ); - - goto on_error; - } - } - if( ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libcaes_context_initialize( - &( ( *context )->tweak_decryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize TWEAK decryption context.", - function ); - - goto on_error; - } - if( libcaes_context_initialize( - &( ( *context )->tweak_encryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize TWEAK encryption context.", - function ); - - goto on_error; - } - } - if( ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) - { - if( libcaes_tweaked_context_initialize( - &( ( *context )->fvek_decryption_tweaked_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize FVEK decryption tweaked context.", - function ); - - goto on_error; - } - if( libcaes_tweaked_context_initialize( - &( ( *context )->fvek_encryption_tweaked_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize FVEK encryption tweaked context.", - function ); - - goto on_error; - } - } - ( *context )->method = method; - - return( 1 ); - -on_error: - if( *context != NULL ) - { - if( ( *context )->fvek_encryption_tweaked_context != NULL ) - { - libcaes_tweaked_context_free( - &( ( *context )->fvek_encryption_tweaked_context ), - NULL ); - } - if( ( *context )->fvek_decryption_tweaked_context != NULL ) - { - libcaes_tweaked_context_free( - &( ( *context )->fvek_decryption_tweaked_context ), - NULL ); - } - if( ( *context )->tweak_encryption_context != NULL ) - { - libcaes_context_free( - &( ( *context )->tweak_encryption_context ), - NULL ); - } - if( ( *context )->tweak_decryption_context != NULL ) - { - libcaes_context_free( - &( ( *context )->tweak_decryption_context ), - NULL ); - } - if( ( *context )->fvek_encryption_context != NULL ) - { - libcaes_context_free( - &( ( *context )->fvek_encryption_context ), - NULL ); - } - if( ( *context )->fvek_decryption_context != NULL ) - { - libcaes_context_free( - &( ( *context )->fvek_decryption_context ), - NULL ); - } - memory_free( - *context ); - - *context = NULL; - } - return( -1 ); -} - -/* Frees an encryption context - * Returns 1 if successful or -1 on error - */ -int libbde_encryption_free( - libbde_encryption_context_t **context, - libcerror_error_t **error ) -{ - static char *function = "libbde_encryption_free"; - int result = 1; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - if( ( *context )->fvek_decryption_context != NULL ) - { - if( libcaes_context_free( - &( ( *context )->fvek_decryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable free FVEK decryption context.", - function ); - - result = -1; - } - } - if( ( *context )->fvek_encryption_context != NULL ) - { - if( libcaes_context_free( - &( ( *context )->fvek_encryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable free FVEK encryption context.", - function ); - - result = -1; - } - } - if( ( *context )->tweak_decryption_context != NULL ) - { - if( libcaes_context_free( - &( ( *context )->tweak_decryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable free TWEAK decryption context.", - function ); - - result = -1; - } - } - if( ( *context )->tweak_encryption_context != NULL ) - { - if( libcaes_context_free( - &( ( *context )->tweak_encryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable free TWEAK encryption context.", - function ); - - result = -1; - } - } - if( ( *context )->fvek_decryption_tweaked_context != NULL ) - { - if( libcaes_tweaked_context_free( - &( ( *context )->fvek_decryption_tweaked_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable free FVEK decryption tweaked context.", - function ); - - result = -1; - } - } - if( ( *context )->fvek_encryption_tweaked_context != NULL ) - { - if( libcaes_tweaked_context_free( - &( ( *context )->fvek_encryption_tweaked_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable free FVEK encryption tweaked context.", - function ); - - result = -1; - } - } - memory_free( - *context ); - - *context = NULL; - } - return( result ); -} - -/* Sets the de- and encryption keys - * Returns 1 if successful or -1 on error - */ -int libbde_encryption_set_keys( - libbde_encryption_context_t *context, - const uint8_t *key, - size_t key_size, - const uint8_t *tweak_key, - size_t tweak_key_size, - libcerror_error_t **error ) -{ - static char *function = "libbde_encryption_set_keys"; - size_t key_bit_size = 0; - size_t key_byte_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( key == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid key.", - function ); - - return( -1 ); - } - if( key_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid key size value exceeds maximum.", - function ); - - return( -1 ); - } - if( tweak_key == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tweak key.", - function ); - - return( -1 ); - } - if( tweak_key_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid tweak key size value exceeds maximum.", - function ); - - return( -1 ); - } - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) ) - { - key_byte_size = 16; - } - else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - key_byte_size = 32; - } - else if( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - { - key_byte_size = 32; - } - else if( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) - { - key_byte_size = 64; - } - if( key_size < key_byte_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid key value too small.", - function ); - - return( -1 ); - } - if( tweak_key_size < key_byte_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid tweak key value too small.", - function ); - - return( -1 ); - } - key_bit_size = key_byte_size * 8; - - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libcaes_context_set_key( - context->fvek_decryption_context, - LIBCAES_CRYPT_MODE_DECRYPT, - key, - key_bit_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set key in decryption context.", - function ); - - return( -1 ); - } - if( libcaes_context_set_key( - context->fvek_encryption_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - key, - key_bit_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set key in encryption context.", - function ); - - return( -1 ); - } - /* The TWEAK key is only used with diffuser - */ - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libcaes_context_set_key( - context->tweak_decryption_context, - LIBCAES_CRYPT_MODE_DECRYPT, - tweak_key, - key_bit_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set tweak key in decryption context.", - function ); - - return( -1 ); - } - if( libcaes_context_set_key( - context->tweak_encryption_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - tweak_key, - key_bit_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set tweak key in encryption context.", - function ); - - return( -1 ); - } - } - } - else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) - { - key_byte_size /= 2; - key_bit_size /= 2; - - if( libcaes_tweaked_context_set_keys( - context->fvek_decryption_tweaked_context, - LIBCAES_CRYPT_MODE_DECRYPT, - key, - key_bit_size, - &( key[ key_byte_size ] ), - key_bit_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set keys in decryption tweaked context.", - function ); - - return( -1 ); - } - if( libcaes_tweaked_context_set_keys( - context->fvek_encryption_tweaked_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - key, - key_bit_size, - &( key[ key_byte_size ] ), - key_bit_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set keys in encryption tweaked context.", - function ); - - return( -1 ); - } - } - return( 1 ); -} - -/* De- or encrypts a block of data - * Returns 1 if successful or -1 on error - */ -int libbde_encryption_crypt( - libbde_encryption_context_t *context, - int mode, - const uint8_t *input_data, - size_t input_data_size, - uint8_t *output_data, - size_t output_data_size, - uint64_t block_key, - libcerror_error_t **error ) -{ - uint8_t block_key_data[ 16 ]; - uint8_t initialization_vector[ 16 ]; - uint8_t sector_key_data[ 32 ]; - - static char *function = "libbde_encryption_crypt"; - size_t data_index = 0; - size_t sector_key_data_index = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( ( mode != LIBBDE_ENCRYPTION_CRYPT_MODE_DECRYPT ) - && ( mode != LIBBDE_ENCRYPTION_CRYPT_MODE_ENCRYPT ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported mode.", - function ); - - return( -1 ); - } - if( memory_set( - initialization_vector, - 0, - 16 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear initialization vector.", - function ); - - return( -1 ); - } - if( memory_set( - block_key_data, - 0, - 16 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear block key data.", - function ); - - return( -1 ); - } - if( memory_set( - sector_key_data, - 0, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear sector key data.", - function ); - - return( -1 ); - } - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - byte_stream_copy_from_uint64_little_endian( - block_key_data, - block_key ); - - /* The block key for the initialization vector is encrypted - * with the FVEK - */ - if( libcaes_crypt_ecb( - context->fvek_encryption_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - block_key_data, - 16, - initialization_vector, - 16, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to encrypt initialization vector.", - function ); - - goto on_error; - } - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - /* The block key for the sector key data is encrypted - * with the TWEAK key - */ - if( libcaes_crypt_ecb( - context->tweak_encryption_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - block_key_data, - 16, - sector_key_data, - 16, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to encrypt sector key data.", - function ); - - goto on_error; - } - /* Set the last byte to contain 0x80 (128) - */ - block_key_data[ 15 ] = 0x80; - - if( libcaes_crypt_ecb( - context->tweak_encryption_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - block_key_data, - 16, - &( sector_key_data[ 16 ] ), - 16, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to encrypt sector key data.", - function ); - - goto on_error; - } - } - } - else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) - { - byte_stream_copy_from_uint64_little_endian( - initialization_vector, - block_key ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: initialization vector:\n", - function ); - libcnotify_print_data( - initialization_vector, - 16, - 0 ); - } -#endif - if( mode == LIBBDE_ENCRYPTION_CRYPT_MODE_ENCRYPT ) - { -/* TODO safe guard input data ? */ - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - sector_key_data_index = 0; - - for( data_index = 0; - data_index < input_data_size; - data_index++ ) - { - output_data[ data_index ] ^= sector_key_data[ sector_key_data_index ]; - - sector_key_data_index++; - - if( sector_key_data_index >= 32 ) - { - sector_key_data_index -= 32; - } - } - if( libbde_diffuser_encrypt( - output_data, - output_data_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_ENCRYPT_FAILED, - "%s: unable to encrypt data using Diffuser.", - function ); - - goto on_error; - } - } - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libcaes_crypt_cbc( - context->fvek_encryption_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - initialization_vector, - 16, - input_data, - input_data_size, - output_data, - output_data_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to AES-CBC encrypt output data.", - function ); - - goto on_error; - } - } - else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) - { - if( libcaes_crypt_xts( - context->fvek_encryption_tweaked_context, - LIBCAES_CRYPT_MODE_ENCRYPT, - initialization_vector, - 16, - input_data, - input_data_size, - output_data, - output_data_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to AES-XTS decrypt output data.", - function ); - - goto on_error; - } - } - } - else - { - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libcaes_crypt_cbc( - context->fvek_decryption_context, - LIBCAES_CRYPT_MODE_DECRYPT, - initialization_vector, - 16, - input_data, - input_data_size, - output_data, - output_data_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to AES-CBC decrypt output data.", - function ); - - goto on_error; - } - } - else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) - { - if( libcaes_crypt_xts( - context->fvek_decryption_tweaked_context, - LIBCAES_CRYPT_MODE_DECRYPT, - initialization_vector, - 16, - input_data, - input_data_size, - output_data, - output_data_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_GENERIC, - "%s: unable to AES-XTS decrypt output data.", - function ); - - goto on_error; - } - } - if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) - || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) - { - if( libbde_diffuser_decrypt( - output_data, - output_data_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ENCRYPTION, - LIBCERROR_ENCRYPTION_ERROR_DECRYPT_FAILED, - "%s: unable to decrypt data using Diffuser.", - function ); - - goto on_error; - } - sector_key_data_index = 0; - - for( data_index = 0; - data_index < input_data_size; - data_index++ ) - { - output_data[ data_index ] ^= sector_key_data[ sector_key_data_index ]; - - sector_key_data_index++; - - if( sector_key_data_index >= 32 ) - { - sector_key_data_index -= 32; - } - } - } - } - return( 1 ); - -on_error: - memory_set( - sector_key_data, - 0, - 32 ); - - memory_set( - block_key_data, - 0, - 16 ); - - memory_set( - initialization_vector, - 0, - 16 ); - - return( -1 ); -} - diff -Nru libbde-20190102/libbde/libbde_encryption.h libbde-20240223/libbde/libbde_encryption.h --- libbde-20190102/libbde/libbde_encryption.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_encryption.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/* - * Encryption functions - * - * Copyright (C) 2011-2019, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBBDE_ENCRYPTION_H ) -#define _LIBBDE_ENCRYPTION_H - -#include -#include - -#include "libbde_libcaes.h" -#include "libbde_libcerror.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libbde_encryption_context libbde_encryption_context_t; - -struct libbde_encryption_context -{ - /* The encryption method - */ - uint16_t method; - - /* The FVEK (AES) decryption context - */ - libcaes_context_t *fvek_decryption_context; - - /* The FVEK (AES) encryption context - */ - libcaes_context_t *fvek_encryption_context; - - /* The TWEAK key (AES) decryption context - */ - libcaes_context_t *tweak_decryption_context; - - /* The TWEAK key (AES) encryption context - */ - libcaes_context_t *tweak_encryption_context; - - /* The FVEK (AES) decryption tweaked context - */ - libcaes_tweaked_context_t *fvek_decryption_tweaked_context; - - /* The FVEK (AES) encryption tweaked context - */ - libcaes_tweaked_context_t *fvek_encryption_tweaked_context; -}; - -int libbde_encryption_initialize( - libbde_encryption_context_t **context, - uint16_t method, - libcerror_error_t **error ); - -int libbde_encryption_free( - libbde_encryption_context_t **context, - libcerror_error_t **error ); - -int libbde_encryption_set_keys( - libbde_encryption_context_t *context, - const uint8_t *key, - size_t key_size, - const uint8_t *tweak_key, - size_t tweak_key_size, - libcerror_error_t **error ); - -int libbde_encryption_crypt( - libbde_encryption_context_t *context, - int mode, - const uint8_t *input_data, - size_t input_data_size, - uint8_t *output_data, - size_t output_data_size, - uint64_t block_key, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBBDE_ENCRYPTION_H ) */ - diff -Nru libbde-20190102/libbde/libbde_encryption_context.c libbde-20240223/libbde/libbde_encryption_context.c --- libbde-20190102/libbde/libbde_encryption_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_encryption_context.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,1005 @@ +/* + * Encryption functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include "libbde_definitions.h" +#include "libbde_diffuser.h" +#include "libbde_encryption_context.h" +#include "libbde_libcaes.h" +#include "libbde_libcerror.h" +#include "libbde_libcnotify.h" + +/* Creates an encryption context + * Make sure the value encryption context is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libbde_encryption_context_initialize( + libbde_encryption_context_t **context, + uint16_t method, + libcerror_error_t **error ) +{ + static char *function = "libbde_encryption_context_initialize"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid context value already set.", + function ); + + return( -1 ); + } + if( ( method != LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + && ( method != LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + && ( method != LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + && ( method != LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) + && ( method != LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + && ( method != LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) + && ( method != LIBBDE_ENCRYPTION_METHOD_NONE ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported method.", + function ); + + return( -1 ); + } + *context = memory_allocate_structure( + libbde_encryption_context_t ); + + if( *context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create context.", + function ); + + goto on_error; + } + if( memory_set( + *context, + 0, + sizeof( libbde_encryption_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + memory_free( + *context ); + + *context = NULL; + + return( -1 ); + } + if( ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + || ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libcaes_context_initialize( + &( ( *context )->fvek_decryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize FVEK decryption context.", + function ); + + goto on_error; + } + if( libcaes_context_initialize( + &( ( *context )->fvek_encryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize FVEK encryption context.", + function ); + + goto on_error; + } + } + if( ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libcaes_context_initialize( + &( ( *context )->tweak_decryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize TWEAK decryption context.", + function ); + + goto on_error; + } + if( libcaes_context_initialize( + &( ( *context )->tweak_encryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize TWEAK encryption context.", + function ); + + goto on_error; + } + } + if( ( method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + || ( method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) + { + if( libcaes_tweaked_context_initialize( + &( ( *context )->fvek_decryption_tweaked_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize FVEK decryption tweaked context.", + function ); + + goto on_error; + } + if( libcaes_tweaked_context_initialize( + &( ( *context )->fvek_encryption_tweaked_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize FVEK encryption tweaked context.", + function ); + + goto on_error; + } + } + ( *context )->method = method; + + return( 1 ); + +on_error: + if( *context != NULL ) + { + if( ( *context )->fvek_encryption_tweaked_context != NULL ) + { + libcaes_tweaked_context_free( + &( ( *context )->fvek_encryption_tweaked_context ), + NULL ); + } + if( ( *context )->fvek_decryption_tweaked_context != NULL ) + { + libcaes_tweaked_context_free( + &( ( *context )->fvek_decryption_tweaked_context ), + NULL ); + } + if( ( *context )->tweak_encryption_context != NULL ) + { + libcaes_context_free( + &( ( *context )->tweak_encryption_context ), + NULL ); + } + if( ( *context )->tweak_decryption_context != NULL ) + { + libcaes_context_free( + &( ( *context )->tweak_decryption_context ), + NULL ); + } + if( ( *context )->fvek_encryption_context != NULL ) + { + libcaes_context_free( + &( ( *context )->fvek_encryption_context ), + NULL ); + } + if( ( *context )->fvek_decryption_context != NULL ) + { + libcaes_context_free( + &( ( *context )->fvek_decryption_context ), + NULL ); + } + memory_free( + *context ); + + *context = NULL; + } + return( -1 ); +} + +/* Frees an encryption context + * Returns 1 if successful or -1 on error + */ +int libbde_encryption_context_free( + libbde_encryption_context_t **context, + libcerror_error_t **error ) +{ + static char *function = "libbde_encryption_context_free"; + int result = 1; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + if( ( *context )->fvek_decryption_context != NULL ) + { + if( libcaes_context_free( + &( ( *context )->fvek_decryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable free FVEK decryption context.", + function ); + + result = -1; + } + } + if( ( *context )->fvek_encryption_context != NULL ) + { + if( libcaes_context_free( + &( ( *context )->fvek_encryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable free FVEK encryption context.", + function ); + + result = -1; + } + } + if( ( *context )->tweak_decryption_context != NULL ) + { + if( libcaes_context_free( + &( ( *context )->tweak_decryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable free TWEAK decryption context.", + function ); + + result = -1; + } + } + if( ( *context )->tweak_encryption_context != NULL ) + { + if( libcaes_context_free( + &( ( *context )->tweak_encryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable free TWEAK encryption context.", + function ); + + result = -1; + } + } + if( ( *context )->fvek_decryption_tweaked_context != NULL ) + { + if( libcaes_tweaked_context_free( + &( ( *context )->fvek_decryption_tweaked_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable free FVEK decryption tweaked context.", + function ); + + result = -1; + } + } + if( ( *context )->fvek_encryption_tweaked_context != NULL ) + { + if( libcaes_tweaked_context_free( + &( ( *context )->fvek_encryption_tweaked_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable free FVEK encryption tweaked context.", + function ); + + result = -1; + } + } + memory_free( + *context ); + + *context = NULL; + } + return( result ); +} + +/* Sets the de- and encryption keys + * Returns 1 if successful or -1 on error + */ +int libbde_encryption_context_set_keys( + libbde_encryption_context_t *context, + const uint8_t *key, + size_t key_size, + const uint8_t *tweak_key, + size_t tweak_key_size, + libcerror_error_t **error ) +{ + static char *function = "libbde_encryption_context_set_keys"; + size_t key_bit_size = 0; + size_t key_byte_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( key == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid key.", + function ); + + return( -1 ); + } + if( key_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid key size value exceeds maximum.", + function ); + + return( -1 ); + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( tweak_key == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid tweak key.", + function ); + + return( -1 ); + } + if( tweak_key_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid tweak key size value exceeds maximum.", + function ); + + return( -1 ); + } + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) ) + { + key_byte_size = 16; + } + else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + key_byte_size = 32; + } + else if( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + { + key_byte_size = 32; + } + else if( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) + { + key_byte_size = 64; + } + if( key_size < key_byte_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid key value too small.", + function ); + + return( -1 ); + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( tweak_key_size < key_byte_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid tweak key value too small.", + function ); + + return( -1 ); + } + } + key_bit_size = key_byte_size * 8; + + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libcaes_context_set_key( + context->fvek_decryption_context, + LIBCAES_CRYPT_MODE_DECRYPT, + key, + key_bit_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set key in decryption context.", + function ); + + return( -1 ); + } + if( libcaes_context_set_key( + context->fvek_encryption_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + key, + key_bit_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set key in encryption context.", + function ); + + return( -1 ); + } + /* The TWEAK key is only used with diffuser + */ + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libcaes_context_set_key( + context->tweak_decryption_context, + LIBCAES_CRYPT_MODE_DECRYPT, + tweak_key, + key_bit_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set tweak key in decryption context.", + function ); + + return( -1 ); + } + if( libcaes_context_set_key( + context->tweak_encryption_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + tweak_key, + key_bit_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set tweak key in encryption context.", + function ); + + return( -1 ); + } + } + } + else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) + { + key_byte_size /= 2; + key_bit_size /= 2; + + if( libcaes_tweaked_context_set_keys( + context->fvek_decryption_tweaked_context, + LIBCAES_CRYPT_MODE_DECRYPT, + key, + key_bit_size, + &( key[ key_byte_size ] ), + key_bit_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set keys in decryption tweaked context.", + function ); + + return( -1 ); + } + if( libcaes_tweaked_context_set_keys( + context->fvek_encryption_tweaked_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + key, + key_bit_size, + &( key[ key_byte_size ] ), + key_bit_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set keys in encryption tweaked context.", + function ); + + return( -1 ); + } + } + return( 1 ); +} + +/* De- or encrypts a block of data + * Returns 1 if successful or -1 on error + */ +int libbde_encryption_context_crypt( + libbde_encryption_context_t *context, + int mode, + const uint8_t *input_data, + size_t input_data_size, + uint8_t *output_data, + size_t output_data_size, + uint64_t block_key, + libcerror_error_t **error ) +{ + uint8_t block_key_data[ 16 ]; + uint8_t initialization_vector[ 16 ]; + uint8_t sector_key_data[ 32 ]; + + static char *function = "libbde_encryption_context_crypt"; + size_t data_index = 0; + size_t sector_key_data_index = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( ( mode != LIBBDE_ENCRYPTION_CRYPT_MODE_DECRYPT ) + && ( mode != LIBBDE_ENCRYPTION_CRYPT_MODE_ENCRYPT ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported mode.", + function ); + + return( -1 ); + } + if( memory_set( + initialization_vector, + 0, + 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear initialization vector.", + function ); + + return( -1 ); + } + if( memory_set( + block_key_data, + 0, + 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear block key data.", + function ); + + return( -1 ); + } + if( memory_set( + sector_key_data, + 0, + 32 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear sector key data.", + function ); + + return( -1 ); + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + byte_stream_copy_from_uint64_little_endian( + block_key_data, + block_key ); + + /* The block key for the initialization vector is encrypted + * with the FVEK + */ + if( libcaes_crypt_ecb( + context->fvek_encryption_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + block_key_data, + 16, + initialization_vector, + 16, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to encrypt initialization vector.", + function ); + + goto on_error; + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + /* The block key for the sector key data is encrypted + * with the TWEAK key + */ + if( libcaes_crypt_ecb( + context->tweak_encryption_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + block_key_data, + 16, + sector_key_data, + 16, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to encrypt sector key data.", + function ); + + goto on_error; + } + /* Set the last byte to contain 0x80 (128) + */ + block_key_data[ 15 ] = 0x80; + + if( libcaes_crypt_ecb( + context->tweak_encryption_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + block_key_data, + 16, + &( sector_key_data[ 16 ] ), + 16, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to encrypt sector key data.", + function ); + + goto on_error; + } + } + } + else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) + { + byte_stream_copy_from_uint64_little_endian( + initialization_vector, + block_key ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: initialization vector:\n", + function ); + libcnotify_print_data( + initialization_vector, + 16, + 0 ); + } +#endif + if( mode == LIBBDE_ENCRYPTION_CRYPT_MODE_ENCRYPT ) + { +/* TODO safe guard input data ? */ + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + sector_key_data_index = 0; + + for( data_index = 0; + data_index < input_data_size; + data_index++ ) + { + output_data[ data_index ] ^= sector_key_data[ sector_key_data_index ]; + + sector_key_data_index++; + + if( sector_key_data_index >= 32 ) + { + sector_key_data_index -= 32; + } + } + if( libbde_diffuser_encrypt( + output_data, + output_data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_ENCRYPT_FAILED, + "%s: unable to encrypt data using Diffuser.", + function ); + + goto on_error; + } + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libcaes_crypt_cbc( + context->fvek_encryption_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + initialization_vector, + 16, + input_data, + input_data_size, + output_data, + output_data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to AES-CBC encrypt output data.", + function ); + + goto on_error; + } + } + else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) + { + if( libcaes_crypt_xts( + context->fvek_encryption_tweaked_context, + LIBCAES_CRYPT_MODE_ENCRYPT, + initialization_vector, + 16, + input_data, + input_data_size, + output_data, + output_data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to AES-XTS decrypt output data.", + function ); + + goto on_error; + } + } + } + else + { + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libcaes_crypt_cbc( + context->fvek_decryption_context, + LIBCAES_CRYPT_MODE_DECRYPT, + initialization_vector, + 16, + input_data, + input_data_size, + output_data, + output_data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to AES-CBC decrypt output data.", + function ); + + goto on_error; + } + } + else if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) + { + if( libcaes_crypt_xts( + context->fvek_decryption_tweaked_context, + LIBCAES_CRYPT_MODE_DECRYPT, + initialization_vector, + 16, + input_data, + input_data_size, + output_data, + output_data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to AES-XTS decrypt output data.", + function ); + + goto on_error; + } + } + if( ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( context->method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) + { + if( libbde_diffuser_decrypt( + output_data, + output_data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_DECRYPT_FAILED, + "%s: unable to decrypt data using Diffuser.", + function ); + + goto on_error; + } + sector_key_data_index = 0; + + for( data_index = 0; + data_index < input_data_size; + data_index++ ) + { + output_data[ data_index ] ^= sector_key_data[ sector_key_data_index ]; + + sector_key_data_index++; + + if( sector_key_data_index >= 32 ) + { + sector_key_data_index -= 32; + } + } + } + } + return( 1 ); + +on_error: + memory_set( + sector_key_data, + 0, + 32 ); + + memory_set( + block_key_data, + 0, + 16 ); + + memory_set( + initialization_vector, + 0, + 16 ); + + return( -1 ); +} + diff -Nru libbde-20190102/libbde/libbde_encryption_context.h libbde-20240223/libbde/libbde_encryption_context.h --- libbde-20190102/libbde/libbde_encryption_context.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_encryption_context.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,100 @@ +/* + * Encryption context functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBBDE_ENCRYPTION_CONTEXT_H ) +#define _LIBBDE_ENCRYPTION_CONTEXT_H + +#include +#include + +#include "libbde_libcaes.h" +#include "libbde_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libbde_encryption_context libbde_encryption_context_t; + +struct libbde_encryption_context +{ + /* The encryption method + */ + uint16_t method; + + /* The FVEK (AES) decryption context + */ + libcaes_context_t *fvek_decryption_context; + + /* The FVEK (AES) encryption context + */ + libcaes_context_t *fvek_encryption_context; + + /* The TWEAK key (AES) decryption context + */ + libcaes_context_t *tweak_decryption_context; + + /* The TWEAK key (AES) encryption context + */ + libcaes_context_t *tweak_encryption_context; + + /* The FVEK (AES) decryption tweaked context + */ + libcaes_tweaked_context_t *fvek_decryption_tweaked_context; + + /* The FVEK (AES) encryption tweaked context + */ + libcaes_tweaked_context_t *fvek_encryption_tweaked_context; +}; + +int libbde_encryption_context_initialize( + libbde_encryption_context_t **context, + uint16_t method, + libcerror_error_t **error ); + +int libbde_encryption_context_free( + libbde_encryption_context_t **context, + libcerror_error_t **error ); + +int libbde_encryption_context_set_keys( + libbde_encryption_context_t *context, + const uint8_t *key, + size_t key_size, + const uint8_t *tweak_key, + size_t tweak_key_size, + libcerror_error_t **error ); + +int libbde_encryption_context_crypt( + libbde_encryption_context_t *context, + int mode, + const uint8_t *input_data, + size_t input_data_size, + uint8_t *output_data, + size_t output_data_size, + uint64_t block_key, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBBDE_ENCRYPTION_CONTEXT_H ) */ + diff -Nru libbde-20190102/libbde/libbde_error.c libbde-20240223/libbde/libbde_error.c --- libbde-20190102/libbde/libbde_error.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_error.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_error.h libbde-20240223/libbde/libbde_error.h --- libbde-20190102/libbde/libbde_error.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_error.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libbde/libbde_extern.h libbde-20240223/libbde/libbde_extern.h --- libbde-20190102/libbde/libbde_extern.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_extern.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBBDE_EXTERN_VARIABLE extern +#else #define LIBBDE_EXTERN_VARIABLE LIBBDE_EXTERN +#endif #else #define LIBBDE_EXTERN /* extern */ diff -Nru libbde-20190102/libbde/libbde_external_key.c libbde-20240223/libbde/libbde_external_key.c --- libbde-20190102/libbde/libbde_external_key.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_external_key.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * External Key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_external_key.h libbde-20240223/libbde/libbde_external_key.h --- libbde-20190102/libbde/libbde_external_key.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_external_key.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * External Key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_EXTERNAL_KEY_H ) diff -Nru libbde-20190102/libbde/libbde_io_handle.c libbde-20240223/libbde/libbde_io_handle.c --- libbde-20190102/libbde/libbde_io_handle.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_io_handle.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,53 +1,41 @@ /* * Input/Output (IO) handle functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include -#include #include -#include "libbde_debug.h" #include "libbde_definitions.h" -#include "libbde_encryption.h" +#include "libbde_encryption_context.h" #include "libbde_io_handle.h" #include "libbde_libbfio.h" #include "libbde_libcerror.h" #include "libbde_libcnotify.h" -#include "libbde_libfcache.h" -#include "libbde_libfdata.h" -#include "libbde_libfguid.h" +#include "libbde_ntfs_volume_header.h" #include "libbde_sector_data.h" #include "libbde_unused.h" #include "bde_volume.h" -const uint8_t bde_boot_entry_point_vista[ 3 ] = { 0xeb, 0x52, 0x90 }; -const uint8_t bde_boot_entry_point_win7[ 3 ] = { 0xeb, 0x58, 0x90 }; -const uint8_t bde_identifier[ 16 ] = { - 0x3b, 0xd6, 0x67, 0x49, 0x29, 0x2e, 0xd8, 0x4a, 0x83, 0x99, 0xf6, 0xa3, 0x39, 0xe3, 0xd0, 0x01 }; - -const char *bde_signature = "-FVE-FS-"; -const char *bde_ntfs_volume_file_system_signature = "NTFS "; - /* Creates an IO handle * Make sure the value io_handle is referencing, is set to NULL * Returns 1 if successful or -1 on error @@ -175,7 +163,6 @@ libcerror_error_t **error ) { static char *function = "libbde_io_handle_clear"; - int result = 1; if( io_handle == NULL ) { @@ -188,731 +175,9 @@ return( -1 ); } - if( io_handle->encryption_context != NULL ) - { - if( libbde_encryption_free( - &( io_handle->encryption_context ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free encryption context.", - function ); - - result = -1; - } - } - if( memory_set( - io_handle->full_volume_encryption_key, - 0, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear full volume encryption key.", - function ); - - result = -1; - } - if( memory_set( - io_handle->tweak_key, - 0, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear tweak key.", - function ); - - result = -1; - } io_handle->bytes_per_sector = 512; - return( result ); -} - -/* Reads the volume header - * Returns 1 if successful or -1 on error - */ -int libbde_io_handle_read_volume_header( - libbde_io_handle_t *io_handle, - libbfio_handle_t *file_io_handle, - off64_t file_offset, - libcerror_error_t **error ) -{ - uint8_t *volume_header_data = NULL; - static char *function = "libbde_io_handle_read_volume_header"; - size_t read_size = 512; - ssize_t read_count = 0; - uint64_t total_number_of_sectors = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - uint64_t value_64bit = 0; - uint32_t value_32bit = 0; - uint16_t value_16bit = 0; -#endif - - if( io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid IO handle.", - function ); - - goto on_error; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading volume header at offset: %" PRIi64 " (0x%08" PRIx64 ")\n", - function, - file_offset, - file_offset ); - } -#endif - if( libbfio_handle_seek_offset( - file_io_handle, - file_offset, - SEEK_SET, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek volume header offset: %" PRIi64 ".", - function, - file_offset ); - - goto on_error; - } - volume_header_data = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * read_size ); - - if( volume_header_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create volume header data.", - function ); - - goto on_error; - } - read_count = libbfio_handle_read_buffer( - file_io_handle, - volume_header_data, - read_size, - error ); - - if( read_count != (ssize_t) read_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read volume header data.", - function ); - - goto on_error; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: volume header data:\n", - function ); - libcnotify_print_data( - volume_header_data, - read_size, - 0 ); - } -#endif - if( memory_compare( - volume_header_data, - bde_boot_entry_point_vista, - 3 ) == 0 ) - { - io_handle->version = LIBBDE_VERSION_WINDOWS_VISTA; - } - else if( memory_compare( - volume_header_data, - bde_boot_entry_point_win7, - 3 ) == 0 ) - { - if( memory_compare( - ( (bde_volume_header_windows_7_t *) volume_header_data )->identifier, - bde_identifier, - 16 ) == 0 ) - { - io_handle->version = LIBBDE_VERSION_WINDOWS_7; - } - else if( memory_compare( - ( (bde_volume_header_to_go_t *) volume_header_data )->identifier, - bde_identifier, - 16 ) == 0 ) - { - io_handle->version = LIBBDE_VERSION_TO_GO; - } - else - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported identifier.", - function ); - - goto on_error; - } - } - else - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported volume boot entry point.", - function ); - - goto on_error; - } - if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) - || ( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) ) - { - if( memory_compare( - &( volume_header_data[ 3 ] ), - bde_signature, - 8 ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: invalid volume signature.", - function ); - - goto on_error; - } - } - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->bytes_per_sector, - io_handle->bytes_per_sector ); - - io_handle->sectors_per_cluster_block = ( (bde_volume_header_windows_vista_t *) volume_header_data )->sectors_per_cluster_block; - - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_16bit, - total_number_of_sectors ); - - if( total_number_of_sectors == 0 ) - { - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_32bit, - total_number_of_sectors ); - } - if( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->first_metadata_cluster_block_number, - io_handle->first_metadata_offset ); - - if( total_number_of_sectors == 0 ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_64bit, - total_number_of_sectors ); - } - } - else if( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_7_t *) volume_header_data )->first_metadata_offset, - io_handle->first_metadata_offset ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_7_t *) volume_header_data )->second_metadata_offset, - io_handle->second_metadata_offset ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_7_t *) volume_header_data )->third_metadata_offset, - io_handle->third_metadata_offset ); - } - else if( io_handle->version == LIBBDE_VERSION_TO_GO ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_to_go_t *) volume_header_data )->first_metadata_offset, - io_handle->first_metadata_offset ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_to_go_t *) volume_header_data )->second_metadata_offset, - io_handle->second_metadata_offset ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_to_go_t *) volume_header_data )->third_metadata_offset, - io_handle->third_metadata_offset ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: boot entry point:\n", - function ); - libcnotify_print_data( - volume_header_data, - 3, - 0 ); - - libcnotify_printf( - "%s: signature\t\t\t\t: %c%c%c%c%c%c%c%c\n", - function, - volume_header_data[ 3 ], - volume_header_data[ 4 ], - volume_header_data[ 5 ], - volume_header_data[ 6 ], - volume_header_data[ 7 ], - volume_header_data[ 8 ], - volume_header_data[ 9 ], - volume_header_data[ 10 ] ); - - libcnotify_printf( - "%s: bytes per sector\t\t\t: %" PRIu16 "\n", - function, - io_handle->bytes_per_sector ); - - libcnotify_printf( - "%s: sectors per cluster block\t\t: %" PRIu8 "\n", - function, - io_handle->sectors_per_cluster_block ); - - libcnotify_printf( - "%s: unknown1\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->unknown1, - 5, - 0 ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_16bit, - value_16bit ); - libcnotify_printf( - "%s: total number of sectors (16-bit)\t: %" PRIu16 "\n", - function, - value_16bit ); - - libcnotify_printf( - "%s: media descriptor\t\t\t: 0x%02" PRIx8 "\n", - function, - ( (bde_volume_header_windows_vista_t *) volume_header_data )->media_descriptor ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->unknown2, - value_16bit ); - libcnotify_printf( - "%s: unknown2\t\t\t\t: %" PRIu16 "\n", - function, - value_16bit ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->sectors_per_track, - value_16bit ); - libcnotify_printf( - "%s: sectors per track\t\t\t: %" PRIu16 "\n", - function, - value_16bit ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->number_of_heads, - value_16bit ); - libcnotify_printf( - "%s: number of heads\t\t\t: %" PRIu16 "\n", - function, - value_16bit ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->number_of_hidden_sectors, - value_32bit ); - libcnotify_printf( - "%s: number of hidden sectors\t\t: %" PRIu32 "\n", - function, - value_32bit ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_32bit, - value_32bit ); - libcnotify_printf( - "%s: total number of sectors (32-bit)\t: %" PRIu32 "\n", - function, - value_32bit ); - - if( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) - { - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->unknown4, - value_32bit ); - libcnotify_printf( - "%s: unknown4\t\t\t\t: 0x%08" PRIx32 " (%" PRIu32 ")\n", - function, - value_32bit, - value_32bit ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_64bit, - value_64bit ); - libcnotify_printf( - "%s: total number of sectors (64-bit)\t: %" PRIu64 "\n", - function, - value_64bit ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->mft_cluster_block_number, - value_64bit ); - libcnotify_printf( - "%s: MFT cluster block number\t\t: %" PRIu64 "\n", - function, - value_64bit ); - - libcnotify_printf( - "%s: first metadata cluster block\t: 0x%08" PRIx64 "\n", - function, - io_handle->first_metadata_offset ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->mft_entry_size, - value_32bit ); - libcnotify_printf( - "%s: MFT entry size\t\t\t: %" PRIu32 "\n", - function, - value_32bit ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->index_entry_size, - value_32bit ); - libcnotify_printf( - "%s: index entry size\t\t: %" PRIu32 "\n", - function, - value_32bit ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->volume_serial_number, - value_64bit ); - libcnotify_printf( - "%s: volume serial number\t\t: 0x%08" PRIx64 "\n", - function, - value_64bit ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->checksum, - value_32bit ); - libcnotify_printf( - "%s: checksum\t\t\t: 0x%08" PRIx32 "\n", - function, - value_32bit ); - - libcnotify_printf( - "%s: bootcode\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->bootcode, - 426, - 0 ); - } - else if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - || ( io_handle->version == LIBBDE_VERSION_TO_GO ) ) - { - libcnotify_printf( - "%s: unknown4:\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_windows_7_t *) volume_header_data )->unknown4, - 31, - 0 ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_serial_number, - value_64bit ); - libcnotify_printf( - "%s: volume serial number\t\t: 0x%08" PRIx32 "\n", - function, - value_32bit ); - - libcnotify_printf( - "%s: volume label\t\t\t: %c%c%c%c%c%c%c%c%c%c%c\n", - function, - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 0 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 1 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 2 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 3 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 4 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 5 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 6 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 7 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 8 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 9 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->volume_label[ 10 ] ); - - libcnotify_printf( - "%s: file system signature\t\t: %c%c%c%c%c%c%c%c\n", - function, - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 0 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 1 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 2 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 3 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 4 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 5 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 6 ], - ( (bde_volume_header_windows_7_t *) volume_header_data )->file_system_signature[ 7 ] ); - } - if( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - { - libcnotify_printf( - "%s: bootcode\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_windows_7_t *) volume_header_data )->bootcode, - 47, - 0 ); - - if( libbde_debug_print_guid_value( - function, - "identifier\t\t\t\t", - ( (bde_volume_header_windows_7_t *) volume_header_data )->identifier, - 16, - LIBFGUID_ENDIAN_LITTLE, - LIBFGUID_STRING_FORMAT_FLAG_USE_LOWER_CASE, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, - "%s: unable to print GUID value.", - function ); - - goto on_error; - } - } - else if( io_handle->version == LIBBDE_VERSION_TO_GO ) - { - libcnotify_printf( - "%s: bootcode\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_to_go_t *) volume_header_data )->bootcode, - 335, - 0 ); - - if( libbde_debug_print_guid_value( - function, - "identifier\t\t\t\t", - ( (bde_volume_header_to_go_t *) volume_header_data )->identifier, - 16, - LIBFGUID_ENDIAN_LITTLE, - LIBFGUID_STRING_FORMAT_FLAG_USE_LOWER_CASE, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, - "%s: unable to print GUID value.", - function ); - - goto on_error; - } - } - if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - || ( io_handle->version == LIBBDE_VERSION_TO_GO ) ) - { - libcnotify_printf( - "%s: first metadata offset\t\t: 0x%08" PRIx64 "\n", - function, - io_handle->first_metadata_offset ); - - libcnotify_printf( - "%s: second metadata offset\t\t: 0x%08" PRIx64 "\n", - function, - io_handle->second_metadata_offset ); - - libcnotify_printf( - "%s: third metadata offset\t\t: 0x%08" PRIx64 "\n", - function, - io_handle->third_metadata_offset ); - } - if( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - { - libcnotify_printf( - "%s: unknown5:\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_windows_7_t *) volume_header_data )->unknown5, - 310, - 0 ); - } - else if( io_handle->version == LIBBDE_VERSION_TO_GO ) - { - libcnotify_printf( - "%s: unknown5:\n", - function ); - libcnotify_print_data( - ( (bde_volume_header_to_go_t *) volume_header_data )->unknown5, - 46, - 0 ); - } - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->sector_signature, - value_16bit ); - libcnotify_printf( - "%s: sector signature\t\t\t: 0x%04" PRIx16 "\n", - function, - value_16bit ); - - libcnotify_printf( - "\n" ); - } -#endif - if( total_number_of_sectors != 0 ) - { - io_handle->volume_size = total_number_of_sectors; - io_handle->volume_size *= io_handle->bytes_per_sector; - } - if( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) - { - io_handle->first_metadata_offset *= io_handle->sectors_per_cluster_block; - io_handle->first_metadata_offset *= io_handle->bytes_per_sector; - - io_handle->metadata_size = 16384; - } - else if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - || ( io_handle->version == LIBBDE_VERSION_TO_GO ) ) - { - io_handle->metadata_size = 65536; - } - memory_free( - volume_header_data ); - - volume_header_data = NULL; - return( 1 ); - -on_error: - if( volume_header_data != NULL ) - { - memory_free( - volume_header_data ); - } - return( -1 ); -} - -/* Reads a sector - * Callback function for the volume vector - * Returns 1 if successful or -1 on error - */ -int libbde_io_handle_read_sector( - libbde_io_handle_t *io_handle, - libbfio_handle_t *file_io_handle, - libfdata_vector_t *vector, - libfcache_cache_t *cache, - int element_index, - int element_data_file_index LIBBDE_ATTRIBUTE_UNUSED, - off64_t element_data_offset, - size64_t element_data_size LIBBDE_ATTRIBUTE_UNUSED, - uint32_t element_data_flags LIBBDE_ATTRIBUTE_UNUSED, - uint8_t read_flags LIBBDE_ATTRIBUTE_UNUSED, - libcerror_error_t **error ) -{ - libbde_sector_data_t *sector_data = NULL; - static char *function = "libbde_io_handle_read_sector"; - - LIBBDE_UNREFERENCED_PARAMETER( element_data_file_index ); - LIBBDE_UNREFERENCED_PARAMETER( element_data_size ); - LIBBDE_UNREFERENCED_PARAMETER( element_data_flags ); - LIBBDE_UNREFERENCED_PARAMETER( read_flags ); - - if( io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid IO handle.", - function ); - - return( -1 ); - } -/* TODO handle virtual sectors, what about different sector sizes? */ - if( libbde_sector_data_initialize( - §or_data, - (size_t) io_handle->bytes_per_sector, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sector data.", - function ); - - goto on_error; - } - if( libbde_sector_data_read( - sector_data, - io_handle, - file_io_handle, - element_data_offset, - io_handle->encryption_context, - 1, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sector data.", - function ); - - goto on_error; - } - if( libfdata_vector_set_element_value_by_index( - vector, - (intptr_t *) file_io_handle, - (libfdata_cache_t *) cache, - element_index, - (intptr_t *) sector_data, - (int (*)(intptr_t **, libcerror_error_t **)) &libbde_sector_data_free, - LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sector data as element value.", - function ); - - goto on_error; - } - return( 1 ); - -on_error: - if( sector_data != NULL ) - { - libbde_sector_data_free( - §or_data, - NULL ); - } - return( -1 ); } /* Reads the unencrypted volume header @@ -921,13 +186,13 @@ int libbde_io_handle_read_unencrypted_volume_header( libbde_io_handle_t *io_handle, libbfio_handle_t *file_io_handle, + off64_t volume_header_offset, + libbde_encryption_context_t *encryption_context, libcerror_error_t **error ) { - libbde_sector_data_t *sector_data = NULL; - uint8_t *volume_header_data = NULL; - static char *function = "libbde_io_handle_read_unencrypted_volume_header"; - off64_t volume_header_offset = 0; - uint64_t total_number_of_sectors = 0; + libbde_ntfs_volume_header_t *ntfs_volume_header = NULL; + libbde_sector_data_t *sector_data = NULL; + static char *function = "libbde_io_handle_read_unencrypted_volume_header"; if( io_handle == NULL ) { @@ -940,11 +205,6 @@ goto on_error; } - if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) - || ( io_handle->version == LIBBDE_VERSION_TO_GO ) ) - { - volume_header_offset = io_handle->volume_header_offset; - } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { @@ -969,12 +229,12 @@ goto on_error; } - if( libbde_sector_data_read( + if( libbde_sector_data_read_file_io_handle( sector_data, io_handle, file_io_handle, volume_header_offset, - io_handle->encryption_context, + encryption_context, 0, error ) != 1 ) { @@ -987,52 +247,47 @@ goto on_error; } - volume_header_data = sector_data->data; - if( io_handle->volume_size == 0 ) { - if( memory_compare( - &( volume_header_data[ 3 ] ), - bde_ntfs_volume_file_system_signature, - 8 ) == 0 ) + if( libbde_ntfs_volume_header_initialize( + &ntfs_volume_header, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create NTFS volume header.", + function ); + + goto on_error; + } + if( libbde_ntfs_volume_header_read_data( + ntfs_volume_header, + sector_data->data, + sector_data->data_size, + error ) != 1 ) { - byte_stream_copy_to_uint16_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_16bit, - total_number_of_sectors ); - - if( total_number_of_sectors == 0 ) - { - byte_stream_copy_to_uint32_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_32bit, - total_number_of_sectors ); - } - if( total_number_of_sectors == 0 ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_volume_header_windows_vista_t *) volume_header_data )->total_number_of_sectors_64bit, - total_number_of_sectors ); - } - if( total_number_of_sectors == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing total number of sectors.", - function ); - - goto on_error; - } - io_handle->volume_size = total_number_of_sectors; - io_handle->volume_size *= io_handle->bytes_per_sector; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read NTFS volume header.", + function ); + + goto on_error; } - else + io_handle->volume_size = ntfs_volume_header->volume_size; + + if( libbde_ntfs_volume_header_free( + &ntfs_volume_header, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine volume size.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free NTFS volume header.", function ); goto on_error; @@ -1051,11 +306,15 @@ goto on_error; } - sector_data = NULL; - return( 1 ); on_error: + if( ntfs_volume_header != NULL ) + { + libbde_ntfs_volume_header_free( + &ntfs_volume_header, + NULL ); + } if( sector_data != NULL ) { libbde_sector_data_free( diff -Nru libbde-20190102/libbde/libbde_io_handle.h libbde-20240223/libbde/libbde_io_handle.h --- libbde-20190102/libbde/libbde_io_handle.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_io_handle.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Input/Output (IO) handle functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_IO_HANDLE_H ) @@ -25,19 +25,19 @@ #include #include -#include "libbde_encryption.h" +#include "libbde_encryption_context.h" #include "libbde_libbfio.h" #include "libbde_libcerror.h" -#include "libbde_libfcache.h" -#include "libbde_libfdata.h" #if defined( __cplusplus ) extern "C" { #endif extern const uint8_t bde_boot_entry_point_vista[ 3 ]; -extern const uint8_t bde_boot_entry_point_win7[ 3 ]; +extern const uint8_t bde_boot_entry_point_windows7[ 3 ]; + extern const uint8_t bde_identifier[ 16 ]; +extern const uint8_t bde_identifier_used_disk_space_only[ 16 ]; extern const char* bde_signature; @@ -49,14 +49,10 @@ */ int version; - /* The bytes per sector + /* The number of bytes per sector */ uint16_t bytes_per_sector; - /* The sectors per cluster block - */ - uint8_t sectors_per_cluster_block; - /* The first metadata offset */ off64_t first_metadata_offset; @@ -81,47 +77,20 @@ */ size64_t encrypted_volume_size; - union - { - /* The MFT mirror cluster block number - * Used by Windows Vista (version 1) - */ - uint64_t mft_mirror_cluster_block_number; - - /* The volume header offset - * Used by Windows 7 (version 2) - */ - off64_t volume_header_offset; - }; - - /* The volume header size - * Used by Windows 7 (version 2) - */ - size64_t volume_header_size; - - /* The encryption context - */ - libbde_encryption_context_t *encryption_context; - - /* External provided full volume encryption key + /* The MFT mirror cluster block number + * Used by Windows Vista (version 1) */ - uint8_t full_volume_encryption_key[ 32 ]; + uint64_t mft_mirror_cluster_block_number; - /* Size of the external provided full volume encryption key - */ - size_t full_volume_encryption_key_size; - - /* External provided tweak key - */ - uint8_t tweak_key[ 32 ]; - - /* Size of the tweak key + /* The volume header offset + * Used by Windows 7 (version 2) */ - size_t tweak_key_size; + off64_t volume_header_offset; - /* Value to indicate the keys are set + /* The volume header size + * Used by Windows 7 (version 2) */ - uint8_t keys_are_set; + size64_t volume_header_size; /* Value to indicate if abort was signalled */ @@ -140,28 +109,11 @@ libbde_io_handle_t *io_handle, libcerror_error_t **error ); -int libbde_io_handle_read_volume_header( - libbde_io_handle_t *io_handle, - libbfio_handle_t *file_io_handle, - off64_t file_offset, - libcerror_error_t **error ); - -int libbde_io_handle_read_sector( - libbde_io_handle_t *io_handle, - libbfio_handle_t *file_io_handle, - libfdata_vector_t *vector, - libfcache_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ); - int libbde_io_handle_read_unencrypted_volume_header( libbde_io_handle_t *io_handle, libbfio_handle_t *file_io_handle, + off64_t volume_header_offset, + libbde_encryption_context_t *encryption_context, libcerror_error_t **error ); #if defined( __cplusplus ) diff -Nru libbde-20190102/libbde/libbde_key.c libbde-20240223/libbde/libbde_key.c --- libbde-20190102/libbde/libbde_key.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_key.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -201,13 +201,14 @@ value_data = metadata_entry->value_data; value_data_size = metadata_entry->value_data_size; - if( value_data_size < sizeof( bde_metadata_entry_key_header_t ) ) + if( ( value_data_size < sizeof( bde_metadata_entry_key_header_t ) ) + || ( value_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: value data size value out of bounds.", + "%s: invalid metadata entry - value data size value out of bounds.", function ); return( -1 ); diff -Nru libbde-20190102/libbde/libbde_key.h libbde-20240223/libbde/libbde_key.h --- libbde-20190102/libbde/libbde_key.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_key.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_KEY_H ) diff -Nru libbde-20190102/libbde/libbde_key_protector.c libbde-20240223/libbde/libbde_key_protector.c --- libbde-20190102/libbde/libbde_key_protector.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_key_protector.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Key protector functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_key_protector.h libbde-20240223/libbde/libbde_key_protector.h --- libbde-20190102/libbde/libbde_key_protector.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_key_protector.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Key protector functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_KEY_PROTECTOR_H ) diff -Nru libbde-20190102/libbde/libbde_libbfio.h libbde-20240223/libbde/libbde_libbfio.h --- libbde-20190102/libbde/libbde_libbfio.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libbfio.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBBFIO_H ) diff -Nru libbde-20190102/libbde/libbde_libcaes.h libbde-20240223/libbde/libbde_libcaes.h --- libbde-20190102/libbde/libbde_libcaes.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libcaes.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcaes header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBCAES_H ) diff -Nru libbde-20190102/libbde/libbde_libcdata.h libbde-20240223/libbde/libbde_libcdata.h --- libbde-20190102/libbde/libbde_libcdata.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libcdata.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcdata header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBCDATA_H ) diff -Nru libbde-20190102/libbde/libbde_libcerror.h libbde-20240223/libbde/libbde_libcerror.h --- libbde-20190102/libbde/libbde_libcerror.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libcerror.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBCERROR_H ) diff -Nru libbde-20190102/libbde/libbde_libclocale.h libbde-20240223/libbde/libbde_libclocale.h --- libbde-20190102/libbde/libbde_libclocale.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libclocale.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libclocale header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBCLOCALE_H ) diff -Nru libbde-20190102/libbde/libbde_libcnotify.h libbde-20240223/libbde/libbde_libcnotify.h --- libbde-20190102/libbde/libbde_libcnotify.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libcnotify.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcnotify header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBCNOTIFY_H ) diff -Nru libbde-20190102/libbde/libbde_libcthreads.h libbde-20240223/libbde/libbde_libcthreads.h --- libbde-20190102/libbde/libbde_libcthreads.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libcthreads.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcthreads header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBCTHREADS_H ) diff -Nru libbde-20190102/libbde/libbde_libfcache.h libbde-20240223/libbde/libbde_libfcache.h --- libbde-20190102/libbde/libbde_libfcache.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libfcache.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfcache header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBFCACHE_H ) diff -Nru libbde-20190102/libbde/libbde_libfdata.h libbde-20240223/libbde/libbde_libfdata.h --- libbde-20190102/libbde/libbde_libfdata.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libfdata.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * The libfdata header wrapper - * - * Copyright (C) 2011-2019, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBBDE_LIBFDATA_H ) -#define _LIBBDE_LIBFDATA_H - -#include - -/* Define HAVE_LOCAL_LIBFDATA for local use of libfdata - */ -#if defined( HAVE_LOCAL_LIBFDATA ) - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBFDATA_DLL_IMPORT - * before including libfdata.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBFDATA_DLL_IMPORT -#endif - -#include - -#endif /* defined( HAVE_LOCAL_LIBFDATA ) */ - -#endif /* !defined( _LIBBDE_LIBFDATA_H ) */ - diff -Nru libbde-20190102/libbde/libbde_libfdatetime.h libbde-20240223/libbde/libbde_libfdatetime.h --- libbde-20190102/libbde/libbde_libfdatetime.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libfdatetime.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfdatetime header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBFDATETIME_H ) diff -Nru libbde-20190102/libbde/libbde_libfguid.h libbde-20240223/libbde/libbde_libfguid.h --- libbde-20190102/libbde/libbde_libfguid.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libfguid.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfguid header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBFGUID_H ) diff -Nru libbde-20190102/libbde/libbde_libfvalue.h libbde-20240223/libbde/libbde_libfvalue.h --- libbde-20190102/libbde/libbde_libfvalue.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libfvalue.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfvalue header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBFVALUE_H ) diff -Nru libbde-20190102/libbde/libbde_libhmac.h libbde-20240223/libbde/libbde_libhmac.h --- libbde-20190102/libbde/libbde_libhmac.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libhmac.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libhmac header * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBHMAC_H ) diff -Nru libbde-20190102/libbde/libbde_libuna.h libbde-20240223/libbde/libbde_libuna.h --- libbde-20190102/libbde/libbde_libuna.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_libuna.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_LIBUNA_H ) diff -Nru libbde-20190102/libbde/libbde_metadata.c libbde-20240223/libbde/libbde_metadata.c --- libbde-20190102/libbde/libbde_metadata.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Metadata functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -26,7 +26,6 @@ #include #include "libbde_aes_ccm_encrypted_key.h" -#include "libbde_debug.h" #include "libbde_definitions.h" #include "libbde_external_key.h" #include "libbde_io_handle.h" @@ -36,11 +35,11 @@ #include "libbde_libcdata.h" #include "libbde_libcerror.h" #include "libbde_libcnotify.h" -#include "libbde_libfdatetime.h" -#include "libbde_libfguid.h" #include "libbde_libuna.h" #include "libbde_metadata.h" +#include "libbde_metadata_block_header.h" #include "libbde_metadata_entry.h" +#include "libbde_metadata_header.h" #include "libbde_password.h" #include "libbde_password_keep.h" #include "libbde_volume_master_key.h" @@ -188,6 +187,22 @@ memory_free( ( *metadata )->description ); } + if( ( *metadata )->startup_key_external_key != NULL ) + { + if( libbde_external_key_free( + &( ( *metadata )->startup_key_external_key ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free startup key external key.", + function ); + + result = -1; + } + } if( ( *metadata )->full_volume_encryption_key != NULL ) { if( libbde_aes_ccm_encrypted_key_free( @@ -252,23 +267,11 @@ size_t startup_key_identifier_size, libcerror_error_t **error ) { - uint8_t *fve_metadata_block = NULL; - void *reallocation = NULL; - static char *function = "libbde_metadata_read_block"; - size_t fve_metadata_block_offset = 0; - size_t read_size = 8192; - ssize_t read_count = 0; - uint64_t first_metadata_offset = 0; - uint64_t second_metadata_offset = 0; - uint64_t third_metadata_offset = 0; - uint64_t volume_header_size = 0; - uint32_t metadata_size = 0; - uint32_t number_of_volume_header_sectors = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - uint32_t value_32bit = 0; - uint16_t value_16bit = 0; -#endif + libbde_metadata_block_header_t *block_header = NULL; + libbde_metadata_header_t *header = NULL; + static char *function = "libbde_metadata_read_block"; + uint64_t volume_header_size = 0; + uint32_t entries_data_size = 0; if( metadata == NULL ) { @@ -292,59 +295,15 @@ return( -1 ); } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading metadata at offset: %" PRIi64 " (0x%08" PRIx64 ")\n", - function, - file_offset, - file_offset ); - } -#endif - if( libbfio_handle_seek_offset( - file_io_handle, - file_offset, - SEEK_SET, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek metadata offset: %" PRIi64 ".", - function, - file_offset ); - - goto on_error; - } - fve_metadata_block = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * read_size ); - - if( fve_metadata_block == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create FVE metadata block.", - function ); - - goto on_error; - } - read_count = libbfio_handle_read_buffer( - file_io_handle, - fve_metadata_block, - read_size, - error ); - - if( read_count != (ssize_t) read_size ) + if( libbde_metadata_block_header_initialize( + &block_header, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read FVE metadata block.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create metadata block header.", function ); goto on_error; @@ -353,196 +312,45 @@ if( libcnotify_verbose != 0 ) { libcnotify_printf( - "%s: FVE metadata block header:\n", - function ); - libcnotify_print_data( - fve_metadata_block, - sizeof( bde_metadata_block_header_v1_t ), - 0 ); + "%s: reading metadata block header at offset: %" PRIi64 " (0x%08" PRIx64 ")\n", + function, + file_offset, + file_offset ); } #endif - if( memory_compare( - fve_metadata_block, - bde_signature, - 8 ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: invalid metadata block signature.", - function ); - - goto on_error; - } - byte_stream_copy_to_uint16_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->version, - metadata->version ); - - if( ( metadata->version != 1 ) - && ( metadata->version != 2 ) ) + if( libbde_metadata_block_header_read_file_io_handle( + block_header, + file_io_handle, + file_offset, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported metadata block version.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read metadata block header.", function ); goto on_error; } - if( metadata->version == 1 ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->mft_mirror_cluster_block, - metadata->mft_mirror_cluster_block_number ); - } - else if( metadata->version == 2 ) - { - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_block_header_v2_t *) fve_metadata_block )->encrypted_volume_size, - metadata->encrypted_volume_size ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_block_header_v2_t *) fve_metadata_block )->volume_header_offset, - metadata->volume_header_offset ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_block_header_v2_t *) fve_metadata_block )->number_of_volume_header_sectors, - number_of_volume_header_sectors ); - } - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->first_metadata_offset, - first_metadata_offset ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->second_metadata_offset, - second_metadata_offset ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->third_metadata_offset, - third_metadata_offset ); - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: signature\t\t\t\t\t: %c%c%c%c%c%c%c%c\n", - function, - fve_metadata_block[ 0 ], - fve_metadata_block[ 1 ], - fve_metadata_block[ 2 ], - fve_metadata_block[ 3 ], - fve_metadata_block[ 4 ], - fve_metadata_block[ 5 ], - fve_metadata_block[ 6 ], - fve_metadata_block[ 7 ] ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->size, - value_16bit ); - libcnotify_printf( - "%s: size\t\t\t\t\t: %" PRIu16 "\n", - function, - value_16bit ); - - libcnotify_printf( - "%s: version\t\t\t\t\t: %" PRIu16 "\n", - function, - metadata->version ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->unknown1, - value_16bit ); - libcnotify_printf( - "%s: unknown1\t\t\t\t\t: %" PRIu16 "\n", - function, - value_16bit ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->unknown2, - value_16bit ); - libcnotify_printf( - "%s: unknown2\t\t\t\t\t: %" PRIu16 "\n", - function, - value_16bit ); - - if( metadata->version == 1 ) - { - libcnotify_printf( - "%s: unknown3:\n", - function ); - libcnotify_print_data( - ( (bde_metadata_block_header_v1_t *) fve_metadata_block )->unknown3, - 16, - 0 ); - } - else if( metadata->version == 2 ) - { - libcnotify_printf( - "%s: encrypted volume size\t\t\t: %" PRIu64 "\n", - function, - metadata->encrypted_volume_size ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_block_header_v2_t *) fve_metadata_block )->unknown3, - value_32bit ); - libcnotify_printf( - "%s: unknown3\t\t\t\t\t: %" PRIu32 "\n", - function, - value_32bit ); + metadata->version = block_header->version; + metadata->encrypted_volume_size = block_header->encrypted_volume_size; + metadata->volume_header_offset = block_header->volume_header_offset; - libcnotify_printf( - "%s: number of volume header sectors\t\t: %" PRIu32 "\n", - function, - number_of_volume_header_sectors ); - } - libcnotify_printf( - "%s: first metadata offset\t\t\t: 0x%08" PRIx64 "\n", - function, - first_metadata_offset ); - - libcnotify_printf( - "%s: second metadata offset\t\t\t: 0x%08" PRIx64 "\n", - function, - second_metadata_offset ); - - libcnotify_printf( - "%s: third metadata offset\t\t\t: 0x%08" PRIx64 "\n", - function, - third_metadata_offset ); - - if( metadata->version == 1 ) - { - libcnotify_printf( - "%s: MFT mirror cluster block\t\t\t: 0x%08" PRIx64 "\n", - function, - metadata->mft_mirror_cluster_block_number ); - } - else if( metadata->version == 2 ) - { - libcnotify_printf( - "%s: volume header offset\t\t\t: 0x%08" PRIx64 "\n", - function, - metadata->volume_header_offset ); - } - libcnotify_printf( - "\n" ); - } -#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + volume_header_size = block_header->number_of_volume_header_sectors * io_handle->bytes_per_sector; if( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) { if( io_handle->second_metadata_offset == 0 ) { - io_handle->second_metadata_offset = second_metadata_offset; + io_handle->second_metadata_offset = block_header->second_metadata_offset; } if( io_handle->third_metadata_offset == 0 ) { - io_handle->third_metadata_offset = third_metadata_offset; + io_handle->third_metadata_offset = block_header->third_metadata_offset; } } - if( (uint64_t) io_handle->first_metadata_offset != first_metadata_offset ) + if( (uint64_t) io_handle->first_metadata_offset != block_header->first_metadata_offset ) { libcerror_error_set( error, @@ -553,7 +361,7 @@ goto on_error; } - if( (uint64_t) io_handle->second_metadata_offset != second_metadata_offset ) + if( (uint64_t) io_handle->second_metadata_offset != block_header->second_metadata_offset ) { libcerror_error_set( error, @@ -564,7 +372,7 @@ goto on_error; } - if( (uint64_t) io_handle->third_metadata_offset != third_metadata_offset ) + if( (uint64_t) io_handle->third_metadata_offset != block_header->third_metadata_offset ) { libcerror_error_set( error, @@ -575,17 +383,36 @@ goto on_error; } - fve_metadata_block_offset += sizeof( bde_metadata_block_header_v1_t ); - read_size -= sizeof( bde_metadata_block_header_v1_t ); + file_offset += sizeof( bde_metadata_block_header_v1_t ); - read_count = libbde_metadata_read_header( - metadata, - &( fve_metadata_block[ fve_metadata_block_offset ] ), - read_size, - &metadata_size, - error ); +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: reading metadata header at offset: %" PRIi64 " (0x%08" PRIx64 ")\n", + function, + file_offset, + file_offset ); + } +#endif + if( libbde_metadata_header_initialize( + &header, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create metadata header.", + function ); - if( read_count == -1 ) + goto on_error; + } + if( libbde_metadata_header_read_file_io_handle( + header, + file_io_handle, + file_offset, + error ) != 1 ) { libcerror_error_set( error, @@ -596,10 +423,26 @@ goto on_error; } - fve_metadata_block_offset += read_count; - read_size -= read_count; + if( memory_copy( + metadata->volume_identifier, + header->volume_identifier, + 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy volume identifier.", + function ); + + goto on_error; + } + metadata->encryption_method = header->encryption_method; + metadata->creation_time = header->creation_time; + + entries_data_size = header->metadata_size; - if( metadata_size < ( sizeof( bde_metadata_header_v1_t ) + read_count ) ) + if( entries_data_size < sizeof( bde_metadata_header_v1_t ) ) { libcerror_error_set( error, @@ -610,46 +453,25 @@ goto on_error; } - if( metadata_size > read_size ) - { - reallocation = memory_reallocate( - fve_metadata_block, - metadata_size ); + entries_data_size -= sizeof( bde_metadata_header_v1_t ); - if( reallocation == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to resize metadata.", - function ); - - goto on_error; - } - fve_metadata_block = (uint8_t *) reallocation; - } - read_count = libbde_metadata_read_entries( - metadata, - &( fve_metadata_block[ fve_metadata_block_offset ] ), - (size_t) metadata_size - sizeof( bde_metadata_header_v1_t ), - startup_key_identifier, - startup_key_identifier_size, - error ); - - if( read_count == -1 ) + if( libbde_metadata_read_entries_file_io_handle( + metadata, + file_io_handle, + (size_t) entries_data_size, + startup_key_identifier, + startup_key_identifier_size, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read metadata header.", + "%s: unable to read metadata entries.", function ); goto on_error; } - volume_header_size = number_of_volume_header_sectors * io_handle->bytes_per_sector; - #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { @@ -672,46 +494,69 @@ "%s: volume header size in FVE Volume header block does not match number of volume header sectors.\n", function ); - return( -1 ); + goto on_error; } } #endif /* defined( HAVE_DEBUG_OUTPUT ) */ - memory_free( - fve_metadata_block ); + if( libbde_metadata_header_free( + &header, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free metadata header.", + function ); - fve_metadata_block = NULL; + goto on_error; + } + if( libbde_metadata_block_header_free( + &block_header, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free metadata block header.", + function ); + goto on_error; + } return( 1 ); on_error: - if( fve_metadata_block != NULL ) + if( header != NULL ) { - memory_free( - fve_metadata_block ); + libbde_metadata_header_free( + &header, + NULL ); + } + if( block_header != NULL ) + { + libbde_metadata_block_header_free( + &block_header, + NULL ); } return( -1 ); } -/* Reads a metadata header - * Returns the number of byte read if successful or -1 on error +/* Reads metadata entries + * Returns 1 if successful or -1 on error */ -ssize_t libbde_metadata_read_header( - libbde_metadata_t *metadata, - uint8_t *header_data, - size_t header_data_size, - uint32_t *metadata_size, - libcerror_error_t **error ) +int libbde_metadata_read_entries_file_io_handle( + libbde_metadata_t *metadata, + libbfio_handle_t *file_io_handle, + size_t entries_data_size, + const uint8_t *startup_key_identifier, + size_t startup_key_identifier_size, + libcerror_error_t **error ) { - static char *function = "libbde_metadata_read_header"; - uint32_t metadata_header_size = 0; - uint32_t metadata_size_copy = 0; - uint32_t version = 0; - uint16_t encryption_method_copy = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - uint32_t value_32bit = 0; -#endif + uint8_t *entries_data = NULL; + static char *function = "libbde_metadata_read_entries_file_io_handle"; + ssize_t read_count = 0; if( metadata == NULL ) { @@ -724,258 +569,109 @@ return( -1 ); } - if( header_data == NULL ) + if( ( entries_data_size == 0 ) + || ( entries_data_size > (size_t) LIBBDE_MAXIMUM_FVE_METADATA_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid header data.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid entries data size value out of bounds.", function ); return( -1 ); } - if( header_data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid header data size value exceeds maximum.", - function ); + entries_data = (uint8_t *) memory_allocate( + sizeof( uint8_t ) * entries_data_size ); - return( -1 ); - } - if( header_data_size < sizeof( bde_metadata_header_v1_t ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: header data size value out of bounds.", - function ); - - return( -1 ); - } - if( metadata_size == NULL ) + if( entries_data == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid metadata size.", + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create metadata entries data.", function ); - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: FVE metadata header:\n", - function ); - libcnotify_print_data( - header_data, - sizeof( bde_metadata_header_v1_t ), - 0 ); + goto on_error; } -#endif - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->metadata_size, - *metadata_size ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->version, - version ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->metadata_header_size, - metadata_header_size ); - - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->metadata_size_copy, - metadata_size_copy ); + read_count = libbfio_handle_read_buffer( + file_io_handle, + entries_data, + (size_t) entries_data_size, + error ); - if( memory_copy( - metadata->volume_identifier, - ( (bde_metadata_header_v1_t *) header_data )->volume_identifier, - 16 ) == NULL ) + if( read_count != (ssize_t) entries_data_size ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy volume identifier.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read metadata entries data.", function ); - return( -1 ); + goto on_error; } - byte_stream_copy_to_uint16_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->encryption_method, - metadata->encryption_method ); - - byte_stream_copy_to_uint16_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->encryption_method_copy, - encryption_method_copy ); - - byte_stream_copy_to_uint64_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->creation_time, - metadata->creation_time ); - - if( version != 1 ) + if( libbde_metadata_read_entries_data( + metadata, + entries_data, + entries_data_size, + startup_key_identifier, + startup_key_identifier_size, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported metadata header version.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read metadata entries.", function ); - return( -1 ); + goto on_error; } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: metadata size\t\t\t\t: %" PRIu32 "\n", - function, - *metadata_size ); - - libcnotify_printf( - "%s: version\t\t\t\t\t: %" PRIu32 "\n", - function, - version ); - - libcnotify_printf( - "%s: metadata header size\t\t\t: %" PRIu32 "\n", - function, - metadata_header_size ); - - libcnotify_printf( - "%s: metadata size copy\t\t\t\t: %" PRIu32 "\n", - function, - metadata_size_copy ); - - if( libbde_debug_print_guid_value( - function, - "volume identifier\t\t\t\t", - metadata->volume_identifier, - 16, - LIBFGUID_ENDIAN_LITTLE, - LIBFGUID_STRING_FORMAT_FLAG_USE_LOWER_CASE, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, - "%s: unable to print GUID value.", - function ); - - return( -1 ); - } - byte_stream_copy_to_uint32_little_endian( - ( (bde_metadata_header_v1_t *) header_data )->next_nonce_counter, - value_32bit ); - libcnotify_printf( - "%s: next nonce counter\t\t\t\t: 0x%08" PRIx32 "\n", - function, - value_32bit ); - - libcnotify_printf( - "%s: encryption method\t\t\t\t: 0x%08" PRIx32 " (%s)\n", - function, - metadata->encryption_method, - libbde_debug_print_encryption_method( - metadata->encryption_method ) ); - - libcnotify_printf( - "%s: encryption method copy\t\t\t: 0x%08" PRIx32 " (%s)\n", - function, - encryption_method_copy, - libbde_debug_print_encryption_method( - encryption_method_copy ) ); - - if( libbde_debug_print_filetime_value( - function, - "creation time\t\t\t\t", - ( (bde_metadata_header_v1_t *) header_data )->creation_time, - 8, - LIBFDATETIME_ENDIAN_LITTLE, - LIBFDATETIME_STRING_FORMAT_TYPE_CTIME | LIBFDATETIME_STRING_FORMAT_FLAG_DATE_TIME_NANO_SECONDS, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, - "%s: unable to print FILETIME value.", - function ); + memory_free( + entries_data ); - return( -1 ); - } - libcnotify_printf( - "\n" ); - } -#endif - if( metadata_header_size != sizeof( bde_metadata_header_v1_t ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_INPUT, - LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, - "%s: value mismatch for metadata header size.", - function ); + entries_data = NULL; - return( -1 ); - } - if( *metadata_size != metadata_size_copy ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_INPUT, - LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, - "%s: value mismatch for metadata size and copy.", - function ); + return( 1 ); - return( -1 ); - } - if( *metadata_size < sizeof( bde_metadata_header_v1_t ) ) +on_error: + if( entries_data != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: metadata size value out of bounds.", - function ); - - return( -1 ); + memory_free( + entries_data ); } - return( sizeof( bde_metadata_header_v1_t ) ); + return( -1 ); } -/* Reads a metadata entries - * Returns the number of byte read if successful or -1 on error +/* Reads metadata entries + * Returns 1 if successful or -1 on error */ -ssize_t libbde_metadata_read_entries( - libbde_metadata_t *metadata, - uint8_t *entries_data, - size_t entries_data_size, - const uint8_t *startup_key_identifier, - size_t startup_key_identifier_size, - libcerror_error_t **error ) +int libbde_metadata_read_entries_data( + libbde_metadata_t *metadata, + uint8_t *entries_data, + size_t entries_data_size, + const uint8_t *startup_key_identifier, + size_t startup_key_identifier_size, + libcerror_error_t **error ) { libbde_aes_ccm_encrypted_key_t *aes_ccm_encrypted_key = NULL; libbde_external_key_t *external_key = NULL; libbde_metadata_entry_t *metadata_entry = NULL; libbde_volume_master_key_t *volume_master_key = NULL; - static char *function = "libbde_metadata_read_entries"; + static char *function = "libbde_metadata_read_entries_data"; size_t entries_data_offset = 0; ssize_t read_count = 0; uint64_t volume_header_offset = 0; uint64_t volume_header_size = 0; int entry_index = 0; +#if defined( HAVE_DEBUG_OUTPUT ) + size_t value_data_offset = 0; + uint16_t value_16bit = 0; +#endif + if( metadata == NULL ) { libcerror_error_set( @@ -1305,7 +1001,7 @@ && ( metadata_entry->value_data_size > 0 ) ) { metadata->description = (uint8_t *) memory_allocate( - metadata_entry->value_data_size ); + (size_t) metadata_entry->value_data_size ); if( metadata->description == NULL ) { @@ -1321,7 +1017,7 @@ if( memory_copy( metadata->description, metadata_entry->value_data, - metadata_entry->value_data_size ) == NULL ) + (size_t) metadata_entry->value_data_size ) == NULL ) { libcerror_error_set( error, @@ -1363,7 +1059,7 @@ if( libcnotify_verbose != 0 ) { libcnotify_printf( - "%s: offset\t\t\t\t\t: 0x%" PRIx64 "\n", + "%s: offset\t\t\t\t: 0x%" PRIx64 "\n", function, volume_header_offset ); @@ -1372,14 +1068,36 @@ function, volume_header_size ); - if( metadata_entry->value_data_size > 16 ) + value_data_offset = 16; + + if( metadata_entry->value_data_size >= 20 ) { + byte_stream_copy_to_uint16_little_endian( + &( metadata_entry->value_data[ 16 ] ), + value_16bit ); libcnotify_printf( - "%s: unknown1:\n", + "%s: unknown1\t\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + &( metadata_entry->value_data[ 18 ] ), + value_16bit ); + libcnotify_printf( + "%s: unknown2\t\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + value_data_offset = 20; + } + if( value_data_offset < metadata_entry->value_data_size ) + { + libcnotify_printf( + "%s: unknown6:\n", function ); libcnotify_print_data( - &( metadata_entry->value_data[ 16 ] ), - metadata_entry->value_data_size - 16, + &( metadata_entry->value_data[ value_data_offset ] ), + metadata_entry->value_data_size - value_data_offset, 0 ); } else @@ -1388,7 +1106,8 @@ "\n" ); } } -#endif +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + if( (off64_t) volume_header_offset != metadata->volume_header_offset ) { libcerror_error_set( @@ -1438,8 +1157,9 @@ LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA ); } } -#endif - return( (ssize_t) entries_data_offset ); +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + return( 1 ); on_error: if( aes_ccm_encrypted_key != NULL ) @@ -1487,7 +1207,6 @@ */ int libbde_metadata_read_volume_master_key( libbde_metadata_t *metadata, - libbde_io_handle_t *io_handle, libbde_password_keep_t *password_keep, const uint8_t *external_key, size_t external_key_size, @@ -1516,17 +1235,6 @@ return( -1 ); } - if( io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid IO handle.", - function ); - - return( -1 ); - } if( password_keep == NULL ) { libcerror_error_set( @@ -1571,7 +1279,7 @@ "%s: invalid metadata - invalid clear key volume master key - missing key.", function ); - return( -1 ); + goto on_error; } if( metadata->clear_key_volume_master_key->aes_ccm_encrypted_key == NULL ) { @@ -1582,7 +1290,7 @@ "%s: invalid metadata - invalid clear key volume master key - missing AES-CCM encrypted key.", function ); - return( -1 ); + goto on_error; } if( metadata->clear_key_volume_master_key->key->data_size != 32 ) { @@ -1621,19 +1329,20 @@ 0 ); } #endif - if( metadata->clear_key_volume_master_key->aes_ccm_encrypted_key->data_size < 28 ) + unencrypted_data_size = metadata->clear_key_volume_master_key->aes_ccm_encrypted_key->data_size; + + if( ( unencrypted_data_size < 28 ) + || ( unencrypted_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: clear key volume master key - AES-CCM encrypted key data size value out of bounds.", + "%s: invalid clear key volume master key - AES-CCM encrypted key data size value out of bounds.", function ); goto on_error; } - unencrypted_data_size = metadata->clear_key_volume_master_key->aes_ccm_encrypted_key->data_size; - unencrypted_data = (uint8_t *) memory_allocate( unencrypted_data_size ); @@ -1736,6 +1445,17 @@ { if( data_size == 0x2c ) { + if( unencrypted_data_size < ( 28 + 32 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: unencrypted volume master key data size value out of bounds.", + function ); + + goto on_error; + } if( memory_copy( volume_master_key, &( unencrypted_data[ 28 ] ), @@ -1799,7 +1519,7 @@ "%s: invalid metadata - missing startup key volume master key.", function ); - return( -1 ); + goto on_error; } if( metadata->startup_key_volume_master_key->aes_ccm_encrypted_key == NULL ) { @@ -1810,7 +1530,7 @@ "%s: invalid metadata - invalid startup key volume master key - missing AES-CCM encrypted key.", function ); - return( -1 ); + goto on_error; } if( memory_set( aes_ccm_key, @@ -1852,19 +1572,20 @@ 0 ); } #endif - if( metadata->startup_key_volume_master_key->aes_ccm_encrypted_key->data_size < 28 ) + unencrypted_data_size = metadata->startup_key_volume_master_key->aes_ccm_encrypted_key->data_size; + + if( ( unencrypted_data_size < 28 ) + || ( unencrypted_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: startup key volume master key - AES-CCM encrypted key data size value out of bounds.", + "%s: invalid startup key volume master key - AES-CCM encrypted key data size value out of bounds.", function ); goto on_error; } - unencrypted_data_size = metadata->startup_key_volume_master_key->aes_ccm_encrypted_key->data_size; - unencrypted_data = (uint8_t *) memory_allocate( unencrypted_data_size ); @@ -2030,7 +1751,7 @@ "%s: invalid metadata - missing password volume master key.", function ); - return( -1 ); + goto on_error; } if( metadata->password_volume_master_key->stretch_key == NULL ) { @@ -2041,7 +1762,7 @@ "%s: invalid metadata - invalid password volume master key - missing stretch key.", function ); - return( -1 ); + goto on_error; } if( metadata->password_volume_master_key->aes_ccm_encrypted_key == NULL ) { @@ -2052,7 +1773,7 @@ "%s: invalid metadata - invalid password volume master key - missing AES-CCM encrypted key.", function ); - return( -1 ); + goto on_error; } if( memory_set( aes_ccm_key, @@ -2098,19 +1819,20 @@ 0 ); } #endif - if( metadata->password_volume_master_key->aes_ccm_encrypted_key->data_size < 28 ) + unencrypted_data_size = metadata->password_volume_master_key->aes_ccm_encrypted_key->data_size; + + if( ( unencrypted_data_size < 28 ) + || ( unencrypted_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: password volume master key - AES-CCM encrypted key data size value out of bounds.", + "%s: invalid password volume master key - AES-CCM encrypted key data size value out of bounds.", function ); goto on_error; } - unencrypted_data_size = metadata->password_volume_master_key->aes_ccm_encrypted_key->data_size; - unencrypted_data = (uint8_t *) memory_allocate( unencrypted_data_size ); @@ -2276,7 +1998,7 @@ "%s: invalid metadata - missing recovery password volume master key.", function ); - return( -1 ); + goto on_error; } if( metadata->recovery_password_volume_master_key->stretch_key == NULL ) { @@ -2287,7 +2009,7 @@ "%s: invalid metadata - invalid recovery password volume master key - missing stretch key.", function ); - return( -1 ); + goto on_error; } if( metadata->recovery_password_volume_master_key->aes_ccm_encrypted_key == NULL ) { @@ -2298,7 +2020,7 @@ "%s: invalid metadata - invalid recovery password volume master key - missing AES-CCM encrypted key.", function ); - return( -1 ); + goto on_error; } if( memory_set( aes_ccm_key, @@ -2344,19 +2066,20 @@ 0 ); } #endif - if( metadata->recovery_password_volume_master_key->aes_ccm_encrypted_key->data_size < 28 ) + unencrypted_data_size = metadata->recovery_password_volume_master_key->aes_ccm_encrypted_key->data_size; + + if( ( unencrypted_data_size < 28 ) + || ( unencrypted_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: recovery password volume master key - AES-CCM encrypted key data size value out of bounds.", + "%s: invalid recovery password volume master key - AES-CCM encrypted key data size value out of bounds.", function ); goto on_error; } - unencrypted_data_size = metadata->recovery_password_volume_master_key->aes_ccm_encrypted_key->data_size; - unencrypted_data = (uint8_t *) memory_allocate( unencrypted_data_size ); @@ -2509,15 +2232,6 @@ unencrypted_data = NULL; } } - if( result == 0 ) - { - /* Keys were set manually - */ - if( io_handle->keys_are_set != 0 ) - { - result = 1; - } - } return( result ); on_error: @@ -2544,7 +2258,7 @@ */ int libbde_metadata_read_full_volume_encryption_key( libbde_metadata_t *metadata, - libbde_io_handle_t *io_handle, + uint16_t encryption_method, const uint8_t *volume_master_key, size_t volume_master_key_size, uint8_t *full_volume_encryption_key, @@ -2592,15 +2306,20 @@ "%s: full volume encryption key data size value out of bounds.", function ); - goto on_error; + return( -1 ); } - if( io_handle == NULL ) + if( ( encryption_method != LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) + && ( encryption_method != LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + && ( encryption_method != LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + && ( encryption_method != LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) + && ( encryption_method != LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) + && ( encryption_method != LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid IO handle.", + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported encryption method.", function ); return( -1 ); @@ -2638,7 +2357,7 @@ return( -1 ); } - if( full_volume_encryption_key_size < 32 ) + if( full_volume_encryption_key_size < 64 ) { libcerror_error_set( error, @@ -2673,6 +2392,18 @@ } unencrypted_data_size = metadata->full_volume_encryption_key->data_size; + if( ( unencrypted_data_size == 0 ) + || ( unencrypted_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid unencrypted data size value out of bounds.", + function ); + + goto on_error; + } unencrypted_data = (uint8_t *) memory_allocate( unencrypted_data_size ); @@ -2773,8 +2504,30 @@ if( version == 1 ) { - if( data_size == 0x1c ) + if( encryption_method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC ) { + if( data_size != 0x1c ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported data size.", + function ); + + goto on_error; + } + if( unencrypted_data_size < 44 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid unencrypted data size value out of bounds.", + function ); + + goto on_error; + } if( memory_copy( full_volume_encryption_key, &( unencrypted_data[ 28 ] ), @@ -2791,8 +2544,31 @@ } result = 1; } - else if( data_size == 0x2c ) + else if( ( encryption_method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC ) + || ( encryption_method == LIBBDE_ENCRYPTION_METHOD_AES_128_XTS ) ) { + if( data_size != 0x2c ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported data size.", + function ); + + goto on_error; + } + if( unencrypted_data_size < 60 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid unencrypted data size value out of bounds.", + function ); + + goto on_error; + } if( memory_copy( full_volume_encryption_key, &( unencrypted_data[ 28 ] ), @@ -2809,8 +2585,31 @@ } result = 1; } - else if( data_size == 0x4c ) + else if( ( encryption_method == LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER ) + || ( encryption_method == LIBBDE_ENCRYPTION_METHOD_AES_256_CBC_DIFFUSER ) ) { + if( data_size != 0x4c ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported data size.", + function ); + + goto on_error; + } + if( unencrypted_data_size < 92 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid unencrypted data size value out of bounds.", + function ); + + goto on_error; + } if( memory_copy( full_volume_encryption_key, &( unencrypted_data[ 28 ] ), @@ -2841,6 +2640,46 @@ } result = 1; } + else if( encryption_method == LIBBDE_ENCRYPTION_METHOD_AES_256_XTS ) + { + if( data_size != 0x4c ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported data size.", + function ); + + goto on_error; + } + if( unencrypted_data_size < 92 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid unencrypted data size value out of bounds.", + function ); + + goto on_error; + } + if( memory_copy( + full_volume_encryption_key, + &( unencrypted_data[ 28 ] ), + 64 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy unencrypted full volume encryption key.", + function ); + + goto on_error; + } + result = 1; + } } if( libcaes_context_free( &aes_context, @@ -2874,46 +2713,6 @@ memory_free( unencrypted_data ); } - if( result == 0 ) - { - /* Keys were set manually - */ - if( io_handle->keys_are_set != 0 ) - { - if( memory_copy( - full_volume_encryption_key, - io_handle->full_volume_encryption_key, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy full volume encryption key.", - function ); - - goto on_error; - } - if( io_handle->tweak_key_size > 0 ) - { - if( memory_copy( - tweak_key, - io_handle->tweak_key, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy tweak key.", - function ); - - goto on_error; - } - } - result = 1; - } - } return( result ); on_error: @@ -2941,8 +2740,8 @@ */ int libbde_metadata_get_volume_identifier( libbde_metadata_t *metadata, - uint8_t *volume_identifier, - size_t size, + uint8_t *guid_data, + size_t guid_data_size, libcerror_error_t **error ) { static char *function = "libbde_metadata_get_volume_identifier"; @@ -2958,30 +2757,30 @@ return( -1 ); } - if( volume_identifier == NULL ) + if( guid_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid volume identifier.", + "%s: invalid GUID data.", function ); return( -1 ); } - if( size < 16 ) + if( guid_data_size < 16 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: volume identifier too small.", + "%s: invalid GUID data value too small.", function ); return( -1 ); } if( memory_copy( - volume_identifier, + guid_data, metadata->volume_identifier, 16 ) == NULL ) { diff -Nru libbde-20190102/libbde/libbde_metadata.h libbde-20240223/libbde/libbde_metadata.h --- libbde-20190102/libbde/libbde_metadata.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Metadata functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_METADATA_H ) @@ -45,26 +45,19 @@ */ uint16_t version; - /* The encryption method - */ - uint16_t encryption_method; - /* The encrypted volume size */ size64_t encrypted_volume_size; - union - { - /* The MFT mirror cluster block number - * Used by Windows Vista (version 1) - */ - uint64_t mft_mirror_cluster_block_number; - - /* The volume header offset - * Used by Windows 7 (version 2) - */ - off64_t volume_header_offset; - }; + /* The MFT mirror cluster block number + * Used by Windows Vista (version 1) + */ + uint64_t mft_mirror_cluster_block_number; + + /* The volume header offset + * Used by Windows 7 (version 2) + */ + off64_t volume_header_offset; /* The volume header size * Used by Windows 7 (version 2) @@ -76,6 +69,10 @@ */ uint8_t volume_identifier[ 16 ]; + /* The encryption method + */ + uint16_t encryption_method; + /* The creation date and time */ uint64_t creation_time; @@ -138,24 +135,24 @@ size_t startup_key_identifier_size, libcerror_error_t **error ); -ssize_t libbde_metadata_read_header( - libbde_metadata_t *metadata, - uint8_t *header_data, - size_t header_data_size, - uint32_t *metadata_size, - libcerror_error_t **error ); - -ssize_t libbde_metadata_read_entries( - libbde_metadata_t *metadata, - uint8_t *entries_data, - size_t entries_data_size, - const uint8_t *startup_key_identifier, - size_t startup_key_identifier_size, - libcerror_error_t **error ); +int libbde_metadata_read_entries_file_io_handle( + libbde_metadata_t *metadata, + libbfio_handle_t *file_io_handle, + size_t entries_data_size, + const uint8_t *startup_key_identifier, + size_t startup_key_identifier_size, + libcerror_error_t **error ); + +int libbde_metadata_read_entries_data( + libbde_metadata_t *metadata, + uint8_t *entries_data, + size_t entries_data_size, + const uint8_t *startup_key_identifier, + size_t startup_key_identifier_size, + libcerror_error_t **error ); int libbde_metadata_read_volume_master_key( libbde_metadata_t *metadata, - libbde_io_handle_t *io_handle, libbde_password_keep_t *password_keep, const uint8_t *external_key, size_t external_key_size, @@ -165,7 +162,7 @@ int libbde_metadata_read_full_volume_encryption_key( libbde_metadata_t *metadata, - libbde_io_handle_t *io_handle, + uint16_t encryption_method, const uint8_t *volume_master_key, size_t volume_master_key_size, uint8_t *full_volume_encryption_key, @@ -176,8 +173,8 @@ int libbde_metadata_get_volume_identifier( libbde_metadata_t *metadata, - uint8_t *volume_identifier, - size_t size, + uint8_t *guid_data, + size_t guid_data_size, libcerror_error_t **error ); int libbde_metadata_get_creation_time( diff -Nru libbde-20190102/libbde/libbde_metadata_block_header.c libbde-20240223/libbde/libbde_metadata_block_header.c --- libbde-20190102/libbde/libbde_metadata_block_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata_block_header.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,438 @@ +/* + * Metadata block header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include "libbde_io_handle.h" +#include "libbde_libbfio.h" +#include "libbde_libcerror.h" +#include "libbde_libcnotify.h" +#include "libbde_metadata_block_header.h" + +#include "bde_metadata.h" + +/* Creates a metadata block header + * Make sure the value metadata block header is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_block_header_initialize( + libbde_metadata_block_header_t **metadata_block_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_metadata_block_header_initialize"; + + if( metadata_block_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata block header.", + function ); + + return( -1 ); + } + if( *metadata_block_header != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid metadata block header value already set.", + function ); + + return( -1 ); + } + *metadata_block_header = memory_allocate_structure( + libbde_metadata_block_header_t ); + + if( *metadata_block_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create metadata block header.", + function ); + + goto on_error; + } + if( memory_set( + *metadata_block_header, + 0, + sizeof( libbde_metadata_block_header_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear metadata block header.", + function ); + + goto on_error; + } + return( 1 ); + +on_error: + if( *metadata_block_header != NULL ) + { + memory_free( + *metadata_block_header ); + + *metadata_block_header = NULL; + } + return( -1 ); +} + +/* Frees a metadata block header + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_block_header_free( + libbde_metadata_block_header_t **metadata_block_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_metadata_block_header_free"; + + if( metadata_block_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata block header.", + function ); + + return( -1 ); + } + if( *metadata_block_header != NULL ) + { + memory_free( + *metadata_block_header ); + + *metadata_block_header = NULL; + } + return( 1 ); +} + +/* Reads a metadata block header + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_block_header_read_data( + libbde_metadata_block_header_t *metadata_block_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ) +{ + static char *function = "libbde_metadata_block_header_read_data"; + uint64_t safe_volume_header_offset = 0; + +#if defined( HAVE_DEBUG_OUTPUT ) + uint32_t value_32bit = 0; + uint16_t value_16bit = 0; +#endif + + if( metadata_block_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata block header.", + function ); + + return( -1 ); + } + if( data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid data.", + function ); + + return( -1 ); + } + if( ( data_size < sizeof( bde_metadata_block_header_v1_t ) ) + || ( data_size > (size_t) SSIZE_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: FVE metadata block header:\n", + function ); + libcnotify_print_data( + data, + sizeof( bde_metadata_block_header_v1_t ), + 0 ); + } +#endif + if( memory_compare( + data, + bde_signature, + 8 ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: invalid metadata block signature.", + function ); + + return( -1 ); + } + byte_stream_copy_to_uint16_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->version, + metadata_block_header->version ); + + if( metadata_block_header->version == 1 ) + { + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->mft_mirror_cluster_block, + metadata_block_header->mft_mirror_cluster_block_number ); + } + else if( metadata_block_header->version == 2 ) + { + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_block_header_v2_t *) data )->encrypted_volume_size, + metadata_block_header->encrypted_volume_size ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_block_header_v2_t *) data )->volume_header_offset, + safe_volume_header_offset ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_block_header_v2_t *) data )->number_of_volume_header_sectors, + metadata_block_header->number_of_volume_header_sectors ); + } + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->first_metadata_offset, + metadata_block_header->first_metadata_offset ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->second_metadata_offset, + metadata_block_header->second_metadata_offset ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->third_metadata_offset, + metadata_block_header->third_metadata_offset ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: signature\t\t\t: %c%c%c%c%c%c%c%c\n", + function, + data[ 0 ], + data[ 1 ], + data[ 2 ], + data[ 3 ], + data[ 4 ], + data[ 5 ], + data[ 6 ], + data[ 7 ] ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->size, + value_16bit ); + libcnotify_printf( + "%s: unknown size\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + libcnotify_printf( + "%s: format version\t\t\t: %" PRIu16 "\n", + function, + metadata_block_header->version ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->unknown1, + value_16bit ); + libcnotify_printf( + "%s: unknown1\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_metadata_block_header_v1_t *) data )->unknown2, + value_16bit ); + libcnotify_printf( + "%s: unknown2\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + if( metadata_block_header->version == 1 ) + { + libcnotify_printf( + "%s: unknown3:\n", + function ); + libcnotify_print_data( + ( (bde_metadata_block_header_v1_t *) data )->unknown3, + 16, + 0 ); + } + else if( metadata_block_header->version == 2 ) + { + libcnotify_printf( + "%s: encrypted volume size\t\t: %" PRIu64 "\n", + function, + metadata_block_header->encrypted_volume_size ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_block_header_v2_t *) data )->unknown3, + value_32bit ); + libcnotify_printf( + "%s: unknown3\t\t\t: %" PRIu32 "\n", + function, + value_32bit ); + + libcnotify_printf( + "%s: number of volume header sectors\t: %" PRIu32 "\n", + function, + metadata_block_header->number_of_volume_header_sectors ); + } + libcnotify_printf( + "%s: first metadata offset\t\t: 0x%08" PRIx64 "\n", + function, + metadata_block_header->first_metadata_offset ); + + libcnotify_printf( + "%s: second metadata offset\t\t: 0x%08" PRIx64 "\n", + function, + metadata_block_header->second_metadata_offset ); + + libcnotify_printf( + "%s: third metadata offset\t\t: 0x%08" PRIx64 "\n", + function, + metadata_block_header->third_metadata_offset ); + + if( metadata_block_header->version == 1 ) + { + libcnotify_printf( + "%s: MFT mirror cluster block\t\t: 0x%08" PRIx64 "\n", + function, + metadata_block_header->mft_mirror_cluster_block_number ); + } + else if( metadata_block_header->version == 2 ) + { + libcnotify_printf( + "%s: volume header offset\t\t: 0x%08" PRIx64 "\n", + function, + safe_volume_header_offset ); + } + libcnotify_printf( + "\n" ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + metadata_block_header->volume_header_offset = (off64_t) safe_volume_header_offset; + + if( ( metadata_block_header->version != 1 ) + && ( metadata_block_header->version != 2 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported format version.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Reads a metadata block header + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_block_header_read_file_io_handle( + libbde_metadata_block_header_t *metadata_block_header, + libbfio_handle_t *file_io_handle, + off64_t file_offset, + libcerror_error_t **error ) +{ + uint8_t metadata_block_header_data[ sizeof( bde_metadata_block_header_v1_t ) ]; + + static char *function = "libbde_metadata_block_header_read_file_io_handle"; + ssize_t read_count = 0; + + if( metadata_block_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata block header.", + function ); + + return( -1 ); + } + read_count = libbfio_handle_read_buffer_at_offset( + file_io_handle, + metadata_block_header_data, + sizeof( bde_metadata_block_header_v1_t ), + file_offset, + error ); + + if( read_count != (ssize_t) sizeof( bde_metadata_block_header_v1_t ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read FVE metadata block header data at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + file_offset, + file_offset ); + + return( -1 ); + } + if( libbde_metadata_block_header_read_data( + metadata_block_header, + metadata_block_header_data, + sizeof( bde_metadata_block_header_v1_t ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read FVE metadata block header.", + function ); + + return( -1 ); + } + return( 1 ); +} + diff -Nru libbde-20190102/libbde/libbde_metadata_block_header.h libbde-20240223/libbde/libbde_metadata_block_header.h --- libbde-20190102/libbde/libbde_metadata_block_header.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata_block_header.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Metadata block header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBBDE_METADATA_BLOCK_HEADER_H ) +#define _LIBBDE_METADATA_BLOCK_HEADER_H + +#include +#include + +#include "libbde_libcerror.h" +#include "libbde_libbfio.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libbde_metadata_block_header libbde_metadata_block_header_t; + +struct libbde_metadata_block_header +{ + /* The format version + */ + uint16_t version; + + /* The encrypted volume size + */ + size64_t encrypted_volume_size; + + union + { + /* The MFT mirror cluster block number + * Used by Windows Vista (version 1) + */ + uint64_t mft_mirror_cluster_block_number; + + /* The volume header offset + * Used by Windows 7 (version 2) + */ + off64_t volume_header_offset; + }; + + /* The number of volume header sectors + * Used by Windows 7 (version 2) + */ + uint32_t number_of_volume_header_sectors; + + /* The first metadata offset + */ + uint64_t first_metadata_offset; + + /* The second metadata offset + */ + uint64_t second_metadata_offset; + + /* The third metadata offset + */ + uint64_t third_metadata_offset; +}; + +int libbde_metadata_block_header_initialize( + libbde_metadata_block_header_t **metadata_block_header, + libcerror_error_t **error ); + +int libbde_metadata_block_header_free( + libbde_metadata_block_header_t **metadata_block_header, + libcerror_error_t **error ); + +int libbde_metadata_block_header_read_data( + libbde_metadata_block_header_t *metadata_block_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ); + +int libbde_metadata_block_header_read_file_io_handle( + libbde_metadata_block_header_t *metadata_block_header, + libbfio_handle_t *file_io_handle, + off64_t file_offset, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBBDE_METADATA_BLOCK_HEADER_H ) */ + diff -Nru libbde-20190102/libbde/libbde_metadata_entry.c libbde-20240223/libbde/libbde_metadata_entry.c --- libbde-20190102/libbde/libbde_metadata_entry.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata_entry.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -247,8 +247,10 @@ function, version ); } -#endif - if( version != 1 ) +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + if( ( version != 1 ) + && ( version != 3 ) ) { libcerror_error_set( error, @@ -393,12 +395,11 @@ "%s: unable to determine size of name string.", function ); - return( -1 ); + goto on_error; } if( value_string_size > 0 ) { - if( ( value_string_size > (size_t) SSIZE_MAX ) - || ( ( sizeof( system_character_t ) * value_string_size ) > (size_t) SSIZE_MAX ) ) + if( value_string_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) { libcerror_error_set( error, @@ -407,7 +408,7 @@ "%s: invalid value string size value exceeds maximum.", function ); - return( -1 ); + goto on_error; } value_string = system_string_allocate( value_string_size ); @@ -421,7 +422,7 @@ "%s: unable to create name string.", function ); - return( -1 ); + goto on_error; } #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_utf16_stream( @@ -449,10 +450,7 @@ "%s: unable to set name string.", function ); - memory_free( - value_string ); - - return( -1 ); + goto on_error; } libcnotify_printf( "%s: string\t\t\t\t: %" PRIs_SYSTEM "\n", @@ -461,11 +459,24 @@ memory_free( value_string ); + + value_string = NULL; } libcnotify_printf( "\n" ); } -#endif +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + return( 1 ); + +on_error: +#if defined( HAVE_DEBUG_OUTPUT ) + if( value_string != NULL ) + { + memory_free( + value_string ); + } +#endif + return( -1 ); } diff -Nru libbde-20190102/libbde/libbde_metadata_entry.h libbde-20240223/libbde/libbde_metadata_entry.h --- libbde-20190102/libbde/libbde_metadata_entry.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata_entry.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_METADATA_ENTRY_H ) diff -Nru libbde-20190102/libbde/libbde_metadata_header.c libbde-20240223/libbde/libbde_metadata_header.c --- libbde-20190102/libbde/libbde_metadata_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata_header.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,430 @@ +/* + * Metadata header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include "libbde_debug.h" +#include "libbde_libcerror.h" +#include "libbde_libcnotify.h" +#include "libbde_libfdatetime.h" +#include "libbde_libfguid.h" +#include "libbde_metadata_header.h" + +#include "bde_metadata.h" + +/* Creates a metadata header + * Make sure the value metadata header is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_header_initialize( + libbde_metadata_header_t **metadata_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_metadata_header_initialize"; + + if( metadata_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata header.", + function ); + + return( -1 ); + } + if( *metadata_header != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid metadata header value already set.", + function ); + + return( -1 ); + } + *metadata_header = memory_allocate_structure( + libbde_metadata_header_t ); + + if( *metadata_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create metadata header.", + function ); + + goto on_error; + } + if( memory_set( + *metadata_header, + 0, + sizeof( libbde_metadata_header_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear metadata header.", + function ); + + goto on_error; + } + return( 1 ); + +on_error: + if( *metadata_header != NULL ) + { + memory_free( + *metadata_header ); + + *metadata_header = NULL; + } + return( -1 ); +} + +/* Frees a metadata header + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_header_free( + libbde_metadata_header_t **metadata_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_metadata_header_free"; + + if( metadata_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata header.", + function ); + + return( -1 ); + } + if( *metadata_header != NULL ) + { + memory_free( + *metadata_header ); + + *metadata_header = NULL; + } + return( 1 ); +} + +/* Reads a metadata header + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_header_read_data( + libbde_metadata_header_t *metadata_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ) +{ + static char *function = "libbde_metadata_header_read_data"; + uint32_t format_version = 0; + uint32_t header_size = 0; + uint32_t metadata_size_copy = 0; + uint16_t encryption_method_copy = 0; + +#if defined( HAVE_DEBUG_OUTPUT ) + uint32_t value_32bit = 0; +#endif + + if( metadata_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata header.", + function ); + + return( -1 ); + } + if( data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid data.", + function ); + + return( -1 ); + } + if( ( data_size < sizeof( bde_metadata_header_v1_t ) ) + || ( data_size > (size_t) SSIZE_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: FVE metadata header:\n", + function ); + libcnotify_print_data( + data, + sizeof( bde_metadata_header_v1_t ), + 0 ); + } +#endif + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_header_v1_t *) data )->metadata_size, + metadata_header->metadata_size ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_header_v1_t *) data )->version, + format_version ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_header_v1_t *) data )->metadata_header_size, + header_size ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_header_v1_t *) data )->metadata_size_copy, + metadata_size_copy ); + + if( memory_copy( + metadata_header->volume_identifier, + ( (bde_metadata_header_v1_t *) data )->volume_identifier, + 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy volume identifier.", + function ); + + return( -1 ); + } + byte_stream_copy_to_uint16_little_endian( + ( (bde_metadata_header_v1_t *) data )->encryption_method, + metadata_header->encryption_method ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_metadata_header_v1_t *) data )->encryption_method_copy, + encryption_method_copy ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_metadata_header_v1_t *) data )->creation_time, + metadata_header->creation_time ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: metadata size\t\t\t\t: %" PRIu32 "\n", + function, + metadata_header->metadata_size ); + + libcnotify_printf( + "%s: format version\t\t\t: %" PRIu32 "\n", + function, + format_version ); + + libcnotify_printf( + "%s: header size\t\t\t\t: %" PRIu32 "\n", + function, + header_size ); + + libcnotify_printf( + "%s: metadata size copy\t\t\t: %" PRIu32 "\n", + function, + metadata_size_copy ); + + if( libbde_debug_print_guid_value( + function, + "volume identifier\t\t\t", + metadata_header->volume_identifier, + 16, + LIBFGUID_ENDIAN_LITTLE, + LIBFGUID_STRING_FORMAT_FLAG_USE_LOWER_CASE, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, + "%s: unable to print GUID value.", + function ); + + return( -1 ); + } + byte_stream_copy_to_uint32_little_endian( + ( (bde_metadata_header_v1_t *) data )->next_nonce_counter, + value_32bit ); + libcnotify_printf( + "%s: next nonce counter\t\t\t: 0x%08" PRIx32 "\n", + function, + value_32bit ); + + libcnotify_printf( + "%s: encryption method\t\t\t: 0x%08" PRIx32 " (%s)\n", + function, + metadata_header->encryption_method, + libbde_debug_print_encryption_method( + metadata_header->encryption_method ) ); + + libcnotify_printf( + "%s: encryption method copy\t\t: 0x%08" PRIx32 " (%s)\n", + function, + encryption_method_copy, + libbde_debug_print_encryption_method( + encryption_method_copy ) ); + + if( libbde_debug_print_filetime_value( + function, + "creation time\t\t\t\t", + ( (bde_metadata_header_v1_t *) data )->creation_time, + 8, + LIBFDATETIME_ENDIAN_LITTLE, + LIBFDATETIME_STRING_FORMAT_TYPE_CTIME | LIBFDATETIME_STRING_FORMAT_FLAG_DATE_TIME_NANO_SECONDS, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, + "%s: unable to print FILETIME value.", + function ); + + return( -1 ); + } + libcnotify_printf( + "\n" ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + if( format_version != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported format version.", + function ); + + return( -1 ); + } + if( header_size != sizeof( bde_metadata_header_v1_t ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_INPUT, + LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, + "%s: value mismatch for header size.", + function ); + + return( -1 ); + } + if( metadata_header->metadata_size != metadata_size_copy ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_INPUT, + LIBCERROR_INPUT_ERROR_VALUE_MISMATCH, + "%s: value mismatch for metadata size and copy.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Reads a metadata header + * Returns 1 if successful or -1 on error + */ +int libbde_metadata_header_read_file_io_handle( + libbde_metadata_header_t *metadata_header, + libbfio_handle_t *file_io_handle, + off64_t file_offset, + libcerror_error_t **error ) +{ + uint8_t metadata_header_data[ sizeof( bde_metadata_header_v1_t ) ]; + + static char *function = "libbde_metadata_header_read_file_io_handle"; + ssize_t read_count = 0; + + if( metadata_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid metadata header.", + function ); + + return( -1 ); + } + read_count = libbfio_handle_read_buffer_at_offset( + file_io_handle, + metadata_header_data, + sizeof( bde_metadata_header_v1_t ), + file_offset, + error ); + + if( read_count != (ssize_t) sizeof( bde_metadata_header_v1_t ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read FVE metadata header data at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + file_offset, + file_offset ); + + return( -1 ); + } + if( libbde_metadata_header_read_data( + metadata_header, + metadata_header_data, + sizeof( bde_metadata_header_v1_t ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read FVE metadata header.", + function ); + + return( -1 ); + } + return( 1 ); +} + diff -Nru libbde-20190102/libbde/libbde_metadata_header.h libbde-20240223/libbde/libbde_metadata_header.h --- libbde-20190102/libbde/libbde_metadata_header.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_metadata_header.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Metadata header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBBDE_METADATA_HEADER_H ) +#define _LIBBDE_METADATA_HEADER_H + +#include +#include + +#include "libbde_libcerror.h" +#include "libbde_libbfio.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libbde_metadata_header libbde_metadata_header_t; + +struct libbde_metadata_header +{ + /* The metadata size + */ + uint32_t metadata_size; + + /* The volume identifier + * Contains a GUID + */ + uint8_t volume_identifier[ 16 ]; + + /* The encryption method + */ + uint16_t encryption_method; + + /* The creation date and time + */ + uint64_t creation_time; +}; + +int libbde_metadata_header_initialize( + libbde_metadata_header_t **metadata_header, + libcerror_error_t **error ); + +int libbde_metadata_header_free( + libbde_metadata_header_t **metadata_header, + libcerror_error_t **error ); + +int libbde_metadata_header_read_data( + libbde_metadata_header_t *metadata_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ); + +int libbde_metadata_header_read_file_io_handle( + libbde_metadata_header_t *metadata_header, + libbfio_handle_t *file_io_handle, + off64_t file_offset, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBBDE_METADATA_HEADER_H ) */ + diff -Nru libbde-20190102/libbde/libbde_notify.c libbde-20240223/libbde/libbde_notify.c --- libbde-20190102/libbde/libbde_notify.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_notify.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_notify.h libbde-20240223/libbde/libbde_notify.h --- libbde-20190102/libbde/libbde_notify.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_notify.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_NOTIFY_H ) diff -Nru libbde-20190102/libbde/libbde_ntfs_volume_header.c libbde-20240223/libbde/libbde_ntfs_volume_header.c --- libbde-20190102/libbde/libbde_ntfs_volume_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_ntfs_volume_header.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,626 @@ +/* + * The NTFS volume header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include "libbde_libcerror.h" +#include "libbde_libcnotify.h" +#include "libbde_ntfs_volume_header.h" + +#include "bde_volume.h" + +/* Creates a NTFS volume header + * Make sure the value ntfs_volume_header is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libbde_ntfs_volume_header_initialize( + libbde_ntfs_volume_header_t **ntfs_volume_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_ntfs_volume_header_initialize"; + + if( ntfs_volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid NTFS volume header.", + function ); + + return( -1 ); + } + if( *ntfs_volume_header != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid NTFS volume header value already set.", + function ); + + return( -1 ); + } + *ntfs_volume_header = memory_allocate_structure( + libbde_ntfs_volume_header_t ); + + if( *ntfs_volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create NTFS volume header.", + function ); + + goto on_error; + } + if( memory_set( + *ntfs_volume_header, + 0, + sizeof( libbde_ntfs_volume_header_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear NTFS volume header.", + function ); + + goto on_error; + } + return( 1 ); + +on_error: + if( *ntfs_volume_header != NULL ) + { + memory_free( + *ntfs_volume_header ); + + *ntfs_volume_header = NULL; + } + return( -1 ); +} + +/* Frees a NTFS volume header + * Returns 1 if successful or -1 on error + */ +int libbde_ntfs_volume_header_free( + libbde_ntfs_volume_header_t **ntfs_volume_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_ntfs_volume_header_free"; + + if( ntfs_volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid NTFS volume header.", + function ); + + return( -1 ); + } + if( *ntfs_volume_header != NULL ) + { + memory_free( + *ntfs_volume_header ); + + *ntfs_volume_header = NULL; + } + return( 1 ); +} + +/* Reads the NTFS volume header + * Returns 1 if successful or -1 on error + */ +int libbde_ntfs_volume_header_read_data( + libbde_ntfs_volume_header_t *ntfs_volume_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ) +{ + static char *function = "libbde_ntfs_volume_header_read_data"; + uint64_t mft_cluster_block_number = 0; + uint64_t mirror_mft_cluster_block_number = 0; + uint32_t cluster_block_size = 0; + uint32_t index_entry_size = 0; + uint32_t mft_entry_size = 0; + +#if defined( HAVE_DEBUG_OUTPUT ) + uint64_t value_64bit = 0; + uint32_t value_32bit = 0; + uint16_t value_16bit = 0; +#endif + + if( ntfs_volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid NTFS volume header.", + function ); + + return( -1 ); + } + if( data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid data.", + function ); + + return( -1 ); + } + if( ( data_size < sizeof( bde_ntfs_volume_header_t ) ) + || ( data_size > (size_t) SSIZE_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: NTFS volume header data:\n", + function ); + libcnotify_print_data( + data, + sizeof( bde_ntfs_volume_header_t ), + LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA ); + } +#endif + if( memory_compare( + ( (bde_ntfs_volume_header_t *) data )->file_system_signature, + "NTFS ", + 8 ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: invalid volume system signature.", + function ); + + return( -1 ); + } + byte_stream_copy_to_uint16_little_endian( + ( (bde_ntfs_volume_header_t *) data )->bytes_per_sector, + ntfs_volume_header->bytes_per_sector ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_ntfs_volume_header_t *) data )->total_number_of_sectors, + ntfs_volume_header->volume_size ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_ntfs_volume_header_t *) data )->mft_cluster_block_number, + mft_cluster_block_number ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_ntfs_volume_header_t *) data )->mirror_mft_cluster_block_number, + mirror_mft_cluster_block_number ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_ntfs_volume_header_t *) data )->mft_entry_size, + mft_entry_size ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_ntfs_volume_header_t *) data )->index_entry_size, + index_entry_size ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: boot entry point\t\t\t: 0x%02x 0x%02x 0x%02x\n", + function, + ( (bde_ntfs_volume_header_t *) data )->boot_entry_point[ 0 ], + ( (bde_ntfs_volume_header_t *) data )->boot_entry_point[ 1 ], + ( (bde_ntfs_volume_header_t *) data )->boot_entry_point[ 2 ] ); + + libcnotify_printf( + "%s: file system signature\t\t: %c%c%c%c%c%c%c%c\n", + function, + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 0 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 1 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 2 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 3 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 4 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 5 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 6 ], + ( (bde_ntfs_volume_header_t *) data )->file_system_signature[ 7 ] ); + + libcnotify_printf( + "%s: bytes per sector\t\t\t: %" PRIu16 "\n", + function, + ntfs_volume_header->bytes_per_sector ); + + libcnotify_printf( + "%s: sectors per cluster block\t\t: %" PRIu8 "\n", + function, + ( (bde_ntfs_volume_header_t *) data )->sectors_per_cluster_block ); + + libcnotify_printf( + "%s: unknown1\n", + function ); + libcnotify_print_data( + ( (bde_ntfs_volume_header_t *) data )->unknown1, + 7, + 0 ); + + libcnotify_printf( + "%s: media descriptor\t\t\t: 0x%02" PRIx8 "\n", + function, + ( (bde_ntfs_volume_header_t *) data )->media_descriptor ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_ntfs_volume_header_t *) data )->unknown2, + value_16bit ); + libcnotify_printf( + "%s: unknown2\t\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_ntfs_volume_header_t *) data )->sectors_per_track, + value_16bit ); + libcnotify_printf( + "%s: sectors per track\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_ntfs_volume_header_t *) data )->number_of_heads, + value_16bit ); + libcnotify_printf( + "%s: number of heads\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_ntfs_volume_header_t *) data )->number_of_hidden_sectors, + value_32bit ); + libcnotify_printf( + "%s: number of hidden sectors\t\t: %" PRIu32 "\n", + function, + value_32bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_ntfs_volume_header_t *) data )->unknown3, + value_32bit ); + libcnotify_printf( + "%s: unknown3\t\t\t\t: 0x%08" PRIx32 " (%" PRIu32 ")\n", + function, + value_32bit, + value_32bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_ntfs_volume_header_t *) data )->unknown4, + value_32bit ); + libcnotify_printf( + "%s: unknown4\t\t\t\t: 0x%08" PRIx32 " (%" PRIu32 ")\n", + function, + value_32bit, + value_32bit ); + + libcnotify_printf( + "%s: total number of sectors\t\t: %" PRIu64 "\n", + function, + ntfs_volume_header->volume_size ); + + libcnotify_printf( + "%s: MFT cluster block number\t\t: %" PRIu64 "\n", + function, + mft_cluster_block_number ); + + libcnotify_printf( + "%s: mirror MFT cluster block number\t: %" PRIu64 "\n", + function, + mirror_mft_cluster_block_number ); + + libcnotify_printf( + "%s: MFT entry size\t\t\t: %" PRIu32 "\n", + function, + mft_entry_size ); + + libcnotify_printf( + "%s: index entry size\t\t\t: %" PRIu32 "\n", + function, + index_entry_size ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_ntfs_volume_header_t *) data )->volume_serial_number, + value_64bit ); + libcnotify_printf( + "%s: volume serial number\t\t: 0x%08" PRIx64 "\n", + function, + value_64bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_ntfs_volume_header_t *) data )->checksum, + value_32bit ); + libcnotify_printf( + "%s: checksum\t\t\t\t: 0x%08" PRIx32 "\n", + function, + value_32bit ); + + libcnotify_printf( + "%s: bootcode\n", + function ); + libcnotify_print_data( + ( (bde_ntfs_volume_header_t *) data )->bootcode, + 426, + 0 ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_ntfs_volume_header_t *) data )->sector_signature, + value_16bit ); + libcnotify_printf( + "%s: sector signature\t\t\t: 0x%04" PRIx16 "\n", + function, + value_16bit ); + + libcnotify_printf( + "\n" ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + if( ( ntfs_volume_header->bytes_per_sector != 256 ) + && ( ntfs_volume_header->bytes_per_sector != 512 ) + && ( ntfs_volume_header->bytes_per_sector != 1024 ) + && ( ntfs_volume_header->bytes_per_sector != 2048 ) + && ( ntfs_volume_header->bytes_per_sector != 4096 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported bytes per sector: %" PRIu16 ".", + function, + ntfs_volume_header->bytes_per_sector ); + + return( -1 ); + } + cluster_block_size = ( (bde_ntfs_volume_header_t *) data )->sectors_per_cluster_block; + + if( cluster_block_size > 128 ) + { + /* The size is calculated as: 2 ^ ( 256 - value ) + */ + cluster_block_size = 256 - cluster_block_size; + + if( cluster_block_size > 12 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid cluster block size value out of bounds.", + function ); + + return( -1 ); + } + cluster_block_size = 1 << cluster_block_size; + } + cluster_block_size *= ntfs_volume_header->bytes_per_sector; + + if( ( cluster_block_size != 256 ) + && ( cluster_block_size != 512 ) + && ( cluster_block_size != 1024 ) + && ( cluster_block_size != 2048 ) + && ( cluster_block_size != 4096 ) + && ( cluster_block_size != 8192 ) + && ( cluster_block_size != 16384 ) + && ( cluster_block_size != 32768 ) + && ( cluster_block_size != 65536 ) + && ( cluster_block_size != 131072 ) + && ( cluster_block_size != 262144 ) + && ( cluster_block_size != 524288 ) + && ( cluster_block_size != 1048576 ) + && ( cluster_block_size != 2097152 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported cluster block size: %" PRIu32 ".", + function, + cluster_block_size ); + + return( -1 ); + } + if( ( mft_entry_size == 0 ) + || ( mft_entry_size > 255 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported MFT entry size: %" PRIu32 ".", + function, + mft_entry_size ); + + return( -1 ); + } + if( mft_entry_size < 128 ) + { + if( mft_entry_size >= (size32_t) ( ( UINT32_MAX / cluster_block_size ) + 1 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid MFT entry size value out of bounds.", + function ); + + return( -1 ); + } + mft_entry_size *= cluster_block_size; + } + else + { + /* The size is calculated as: 2 ^ ( 256 - value ) + */ + mft_entry_size = 256 - mft_entry_size; + + if( mft_entry_size >= 32 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid MFT entry size value out of bounds.", + function ); + + return( -1 ); + } + mft_entry_size = (uint32_t) 1UL << mft_entry_size; + } + if( ( (size_t) mft_entry_size < 42 ) + || ( mft_entry_size >= (uint32_t) MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid MFT entry size: %" PRIu32 " value out of bounds.", + function, + mft_entry_size ); + + return( -1 ); + } + if( ( index_entry_size == 0 ) + || ( index_entry_size > 255 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported index entry size: %" PRIu32 ".", + function, + index_entry_size ); + + return( -1 ); + } + if( index_entry_size < 128 ) + { + if( index_entry_size >= (size32_t) ( ( UINT32_MAX / cluster_block_size ) + 1 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid index entry size value out of bounds.", + function ); + + return( -1 ); + } + index_entry_size *= cluster_block_size; + } + else + { + /* The size is calculated as: 2 ^ ( 256 - value ) + */ + index_entry_size = 256 - index_entry_size; + + if( index_entry_size >= 32 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid index entry size value out of bounds.", + function ); + + return( -1 ); + } + index_entry_size = (uint32_t) 1UL << index_entry_size; + } + if( (size_t) index_entry_size < 32 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid MFT entry size: %" PRIu32 " value out of bounds.", + function, + index_entry_size ); + + return( -1 ); + } + if( ntfs_volume_header->volume_size > (size64_t) ( ( UINT64_MAX / ntfs_volume_header->bytes_per_sector ) + 1 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid volume size value out of bounds.", + function ); + + return( -1 ); + } + ntfs_volume_header->volume_size *= ntfs_volume_header->bytes_per_sector; + ntfs_volume_header->volume_size += ntfs_volume_header->bytes_per_sector; + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: calculated cluster block size\t: %" PRIu32 "\n", + function, + cluster_block_size ); + + libcnotify_printf( + "%s: calculated MFT entry size\t\t: %" PRIu32 "\n", + function, + mft_entry_size ); + + libcnotify_printf( + "%s: calculated index entry size\t: %" PRIu32 "\n", + function, + index_entry_size ); + + libcnotify_printf( + "%s: calculated volume size\t\t: %" PRIu64 "\n", + function, + ntfs_volume_header->volume_size ); + + libcnotify_printf( + "\n" ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + return( 1 ); +} + diff -Nru libbde-20190102/libbde/libbde_ntfs_volume_header.h libbde-20240223/libbde/libbde_ntfs_volume_header.h --- libbde-20190102/libbde/libbde_ntfs_volume_header.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_ntfs_volume_header.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * The NTFS volume header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBBDE_NTFS_VOLUME_HEADER_H ) +#define _LIBBDE_NTFS_VOLUME_HEADER_H + +#include +#include + +#include "libbde_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libbde_ntfs_volume_header libbde_ntfs_volume_header_t; + +struct libbde_ntfs_volume_header +{ + /* The number of bytes per sector + */ + uint16_t bytes_per_sector; + + /* The volume size + */ + size64_t volume_size; +}; + +int libbde_ntfs_volume_header_initialize( + libbde_ntfs_volume_header_t **ntfs_volume_header, + libcerror_error_t **error ); + +int libbde_ntfs_volume_header_free( + libbde_ntfs_volume_header_t **ntfs_volume_header, + libcerror_error_t **error ); + +int libbde_ntfs_volume_header_read_data( + libbde_ntfs_volume_header_t *ntfs_volume_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBBDE_NTFS_VOLUME_HEADER_H ) */ + diff -Nru libbde-20190102/libbde/libbde_password.c libbde-20240223/libbde/libbde_password.c --- libbde-20190102/libbde/libbde_password.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_password.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Password functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -81,6 +81,18 @@ goto on_error; } + if( ( utf16_stream_size == 0 ) + || ( utf16_stream_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid UTF-16 stream size value out of bounds.", + function ); + + goto on_error; + } utf16_stream = (uint8_t *) memory_allocate( sizeof( uint8_t ) * utf16_stream_size ); @@ -240,6 +252,18 @@ function ); goto on_error; + } + if( ( utf16_stream_size == 0 ) + || ( utf16_stream_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid UTF-16 stream size value out of bounds.", + function ); + + goto on_error; } utf16_stream = (uint8_t *) memory_allocate( sizeof( uint8_t ) * utf16_stream_size ); diff -Nru libbde-20190102/libbde/libbde_password.h libbde-20240223/libbde/libbde_password.h --- libbde-20190102/libbde/libbde_password.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_password.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Password functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_PASSWORD_H ) diff -Nru libbde-20190102/libbde/libbde_password_keep.c libbde-20240223/libbde/libbde_password_keep.c --- libbde-20190102/libbde/libbde_password_keep.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_password_keep.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Password keep functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_password_keep.h libbde-20240223/libbde/libbde_password_keep.h --- libbde-20190102/libbde/libbde_password_keep.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_password_keep.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Password keep functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_PASSWORD_KEEP_H ) diff -Nru libbde-20190102/libbde/libbde_recovery.c libbde-20240223/libbde/libbde_recovery.c --- libbde-20190102/libbde/libbde_recovery.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_recovery.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Recovery functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_recovery.h libbde-20240223/libbde/libbde_recovery.h --- libbde-20190102/libbde/libbde_recovery.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_recovery.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Recovery functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_RECOVERY_H ) diff -Nru libbde-20190102/libbde/libbde_sector_data.c libbde-20240223/libbde/libbde_sector_data.c --- libbde-20190102/libbde/libbde_sector_data.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_sector_data.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Sector data functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include #include "libbde_definitions.h" -#include "libbde_encryption.h" +#include "libbde_encryption_context.h" #include "libbde_io_handle.h" #include "libbde_libbfio.h" #include "libbde_libcerror.h" @@ -65,13 +65,14 @@ return( -1 ); } - if( data_size > (size_t) SSIZE_MAX ) + if( ( data_size == 0 ) + || ( data_size > (size_t) MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid data size value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", function ); return( -1 ); @@ -109,48 +110,27 @@ return( -1 ); } - if( data_size > 0 ) - { - ( *sector_data )->encrypted_data = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * data_size ); - - if( ( *sector_data )->encrypted_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create encrypted data.", - function ); + ( *sector_data )->data = (uint8_t *) memory_allocate( + sizeof( uint8_t ) * data_size ); - goto on_error; - } - ( *sector_data )->data = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * data_size ); - - if( ( *sector_data )->data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create data.", - function ); + if( ( *sector_data )->data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create data.", + function ); - goto on_error; - } - ( *sector_data )->data_size = data_size; + goto on_error; } + ( *sector_data )->data_size = data_size; + return( 1 ); on_error: if( *sector_data != NULL ) { - if( ( *sector_data )->encrypted_data != NULL ) - { - memory_free( - ( *sector_data )->encrypted_data ); - } memory_free( *sector_data ); @@ -182,29 +162,24 @@ } if( *sector_data != NULL ) { - if( ( *sector_data )->data != NULL ) + if( memory_set( + ( *sector_data )->data, + 0, + ( *sector_data )->data_size ) == NULL ) { - if( memory_set( - ( *sector_data )->data, - 0, - ( *sector_data )->data_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear data.", - function ); - - result = -1; - } - memory_free( - ( *sector_data )->data ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear data.", + function ); - memory_free( - ( *sector_data )->encrypted_data ); + result = -1; } memory_free( + ( *sector_data )->data ); + + memory_free( *sector_data ); *sector_data = NULL; @@ -215,7 +190,7 @@ /* Reads sector data * Returns 1 if successful or -1 on error */ -int libbde_sector_data_read( +int libbde_sector_data_read_file_io_handle( libbde_sector_data_t *sector_data, libbde_io_handle_t *io_handle, libbfio_handle_t *file_io_handle, @@ -224,9 +199,11 @@ uint8_t zero_metadata, libcerror_error_t **error ) { - static char *function = "libbde_sector_data_read"; - ssize_t read_count = 0; - uint64_t block_key = 0; + uint8_t *encrypted_data = NULL; + uint8_t *read_buffer = 0; + static char *function = "libbde_sector_data_read_file_io_handle"; + ssize_t read_count = 0; + uint64_t block_key = 0; if( sector_data == NULL ) { @@ -239,17 +216,6 @@ return( -1 ); } - if( sector_data->encrypted_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid sector data - missing encrypted data.", - function ); - - return( -1 ); - } if( sector_data->data == NULL ) { libcerror_error_set( @@ -327,7 +293,7 @@ "%s: unable to clear data.", function ); - return( -1 ); + goto on_error; } return( 1 ); } @@ -352,7 +318,7 @@ "%s: unable to clear data.", function ); - return( -1 ); + goto on_error; } return( 1 ); } @@ -371,29 +337,62 @@ io_handle->volume_header_offset ); } #endif + if( ( io_handle->volume_header_offset < 0 ) + || ( sector_data_offset > (off64_t) ( INT64_MAX - io_handle->volume_header_offset ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid sector data offset value out of bounds.", + function ); + + goto on_error; + } sector_data_offset += io_handle->volume_header_offset; } } - if( libbfio_handle_seek_offset( - file_io_handle, - sector_data_offset, - SEEK_SET, - error ) == -1 ) + /* In Windows Vista the first 16 sectors are unencrypted + */ + if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) + && ( (size64_t) sector_data_offset < 8192 ) ) + { + read_buffer = sector_data->data; + } + else if( encryption_context->method == LIBBDE_ENCRYPTION_METHOD_NONE ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek sector data offset: %" PRIi64 ".", - function, - sector_data_offset ); + read_buffer = sector_data->data; + } + /* Check if the offset is outside the encrypted part of the volume + */ + else if( ( io_handle->encrypted_volume_size != 0 ) + && ( sector_data_offset >= (off64_t) io_handle->encrypted_volume_size ) ) + { + read_buffer = sector_data->data; + } + else + { + encrypted_data = (uint8_t *) memory_allocate( + sizeof( uint8_t ) * sector_data->data_size ); - return( -1 ); + if( encrypted_data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create encrypted data.", + function ); + + goto on_error; + } + read_buffer = encrypted_data; } - read_count = libbfio_handle_read_buffer( + read_count = libbfio_handle_read_buffer_at_offset( file_io_handle, - sector_data->encrypted_data, + read_buffer, sector_data->data_size, + sector_data_offset, error ); if( read_count != (ssize_t) sector_data->data_size ) @@ -402,92 +401,59 @@ error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sector data.", - function ); + "%s: unable to read sector data at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + sector_data_offset, + sector_data_offset ); - return( -1 ); + goto on_error; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { - libcnotify_printf( - "%s: encrypted sector data:\n", - function ); - libcnotify_print_data( - sector_data->encrypted_data, - sector_data->data_size, - 0 ); - } -#endif - /* In Windows Vista the first 16 sectors are unencrypted - */ - if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) - && ( (size64_t) sector_data_offset < 8192 ) ) - { - if( memory_copy( - sector_data->data, - sector_data->encrypted_data, - sector_data->data_size ) == NULL ) + if( read_buffer == encrypted_data ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy encrypted data.", + libcnotify_printf( + "%s: encrypted sector data:\n", function ); - - return( -1 ); - } - /* In Windows Vista the first sector is altered - */ - if( sector_data_offset < 512 ) - { - /* Change the volume header signature "-FVE-FS-" - * into "NTFS " - */ - if( memory_copy( - &( sector_data->data[ 3 ] ), - "NTFS ", - 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy encrypted data.", - function ); - - return( -1 ); - } - /* Change the FVE metadatsa block 1 cluster block number - * into the MFT mirror cluster block number - */ - byte_stream_copy_from_uint64_little_endian( - &( sector_data->data[ 56 ] ), - io_handle->mft_mirror_cluster_block_number ); + libcnotify_print_data( + encrypted_data, + sector_data->data_size, + 0 ); } } - /* Check if the offset is outside the encrypted part of the volume +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + /* In Windows Vista the first sector is altered */ - else if( ( io_handle->encrypted_volume_size != 0 ) - && ( sector_data_offset >= (off64_t) io_handle->encrypted_volume_size ) ) + if( ( io_handle->version == LIBBDE_VERSION_WINDOWS_VISTA ) + && ( (size64_t) sector_data_offset < 512 ) ) { + /* Change the volume header signature "-FVE-FS-" + * into "NTFS " + */ if( memory_copy( - sector_data->data, - sector_data->encrypted_data, - sector_data->data_size ) == NULL ) + &( sector_data->data[ 3 ] ), + "NTFS ", + 8 ) == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy encrypted data.", + "%s: unable to copy NTFS signature.", function ); - return( -1 ); + goto on_error; } + /* Change the FVE metadata block 1 cluster block number + * into the MFT mirror cluster block number + */ + byte_stream_copy_from_uint64_little_endian( + &( sector_data->data[ 56 ] ), + io_handle->mft_mirror_cluster_block_number ); } - else + if( read_buffer == encrypted_data ) { block_key = (uint64_t) sector_data_offset; @@ -496,10 +462,10 @@ { block_key /= io_handle->bytes_per_sector; } - if( libbde_encryption_crypt( + if( libbde_encryption_context_crypt( encryption_context, LIBBDE_ENCRYPTION_CRYPT_MODE_DECRYPT, - sector_data->encrypted_data, + encrypted_data, sector_data->data_size, sector_data->data, sector_data->data_size, @@ -513,8 +479,12 @@ "%s: unable to decrypt sector data.", function ); - return( -1 ); + goto on_error; } + memory_free( + encrypted_data ); + + encrypted_data = NULL; } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) @@ -527,7 +497,16 @@ sector_data->data_size, 0 ); } -#endif +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + return( 1 ); + +on_error: + if( encrypted_data != NULL ) + { + memory_free( + encrypted_data ); + } + return( -1 ); } diff -Nru libbde-20190102/libbde/libbde_sector_data.h libbde-20240223/libbde/libbde_sector_data.h --- libbde-20190102/libbde/libbde_sector_data.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_sector_data.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Sector data functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_SECTOR_DATA_H ) @@ -25,7 +25,7 @@ #include #include -#include "libbde_encryption.h" +#include "libbde_encryption_context.h" #include "libbde_io_handle.h" #include "libbde_libbfio.h" #include "libbde_libcerror.h" @@ -38,10 +38,6 @@ struct libbde_sector_data { - /* The encrypted data - */ - uint8_t *encrypted_data; - /* The data */ uint8_t *data; @@ -60,7 +56,7 @@ libbde_sector_data_t **sector_data, libcerror_error_t **error ); -int libbde_sector_data_read( +int libbde_sector_data_read_file_io_handle( libbde_sector_data_t *sector_data, libbde_io_handle_t *io_handle, libbfio_handle_t *file_io_handle, diff -Nru libbde-20190102/libbde/libbde_sector_data_vector.c libbde-20240223/libbde/libbde_sector_data_vector.c --- libbde-20190102/libbde/libbde_sector_data_vector.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_sector_data_vector.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,368 @@ +/* + * Sector data vector functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include "libbde_definitions.h" +#include "libbde_encryption_context.h" +#include "libbde_libbfio.h" +#include "libbde_libcerror.h" +#include "libbde_libcnotify.h" +#include "libbde_libfcache.h" +#include "libbde_sector_data.h" +#include "libbde_sector_data_vector.h" + +/* Creates a sector data vector + * Make sure the value sector data vector is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libbde_sector_data_vector_initialize( + libbde_sector_data_vector_t **sector_data_vector, + uint16_t bytes_per_sector, + off64_t data_offset, + size64_t data_size, + libcerror_error_t **error ) +{ + static char *function = "libbde_sector_data_vector_initialize"; + + if( sector_data_vector == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid sector data vector.", + function ); + + return( -1 ); + } + if( *sector_data_vector != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid sector data vector value already set.", + function ); + + return( -1 ); + } + if( data_offset < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data offset value out of bounds.", + function ); + + return( -1 ); + } + *sector_data_vector = memory_allocate_structure( + libbde_sector_data_vector_t ); + + if( *sector_data_vector == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create sector data vector.", + function ); + + goto on_error; + } + if( memory_set( + *sector_data_vector, + 0, + sizeof( libbde_sector_data_vector_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear sector data vector.", + function ); + + goto on_error; + } + if( libfcache_date_time_get_timestamp( + &( ( *sector_data_vector )->cache_timestamp ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve cache timestamp.", + function ); + + goto on_error; + } + if( libfcache_cache_initialize( + &( ( *sector_data_vector )->cache ), + LIBBDE_MAXIMUM_CACHE_ENTRIES_SECTOR_DATA, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create sectors cache.", + function ); + + goto on_error; + } + ( *sector_data_vector )->bytes_per_sector = bytes_per_sector; + ( *sector_data_vector )->data_offset = data_offset; + ( *sector_data_vector )->data_size = data_size; + + return( 1 ); + +on_error: + if( *sector_data_vector != NULL ) + { + memory_free( + *sector_data_vector ); + + *sector_data_vector = NULL; + } + return( -1 ); +} + +/* Frees a sector data vector + * Returns 1 if successful or -1 on error + */ +int libbde_sector_data_vector_free( + libbde_sector_data_vector_t **sector_data_vector, + libcerror_error_t **error ) +{ + static char *function = "libbde_sector_data_vector_free"; + int result = 1; + + if( sector_data_vector == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid sector data vector.", + function ); + + return( -1 ); + } + if( *sector_data_vector != NULL ) + { + if( libfcache_cache_free( + &( ( *sector_data_vector )->cache ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free cache.", + function ); + + result = -1; + } + memory_free( + *sector_data_vector ); + + *sector_data_vector = NULL; + } + return( result ); +} + +/* Reads sector data at a specific offset + * Returns 1 if successful or -1 on error + */ +int libbde_sector_data_vector_get_sector_data_at_offset( + libbde_sector_data_vector_t *sector_data_vector, + libbde_io_handle_t *io_handle, + libbfio_handle_t *file_io_handle, + libbde_encryption_context_t *encryption_context, + off64_t offset, + libbde_sector_data_t **sector_data, + libcerror_error_t **error ) +{ + libbde_sector_data_t *safe_sector_data = NULL; + libfcache_cache_value_t *cache_value = NULL; + static char *function = "libbde_sector_data_vector_get_sector_data_at_offset"; + off64_t sector_data_offset = 0; + int result = 0; + + if( sector_data_vector == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid sector data vector.", + function ); + + return( -1 ); + } + if( io_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid IO handle.", + function ); + + return( -1 ); + } + result = libfcache_cache_get_value_by_identifier( + sector_data_vector->cache, + 0, + offset, + sector_data_vector->cache_timestamp, + &cache_value, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from cache.", + function ); + + goto on_error; + } + else if( result != 0 ) + { +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: cache: 0x%08" PRIjx " hit for offset: %" PRIi64 " (0x%08" PRIx64 ")\n", + function, + (intptr_t) sector_data_vector->cache, + offset, + offset ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + if( libfcache_cache_value_get_value( + cache_value, + (intptr_t **) sector_data, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sector data from cache.", + function ); + + goto on_error; + } + } + else + { +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: cache: 0x%08" PRIjx " miss for offset: %" PRIi64 " (0x%08" PRIx64 ")\n", + function, + (intptr_t) sector_data_vector->cache, + offset, + offset ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + if( libbde_sector_data_initialize( + &safe_sector_data, + (size_t) sector_data_vector->bytes_per_sector, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create sector data.", + function ); + + goto on_error; + } + sector_data_offset = sector_data_vector->data_offset + offset; + + if( libbde_sector_data_read_file_io_handle( + safe_sector_data, + io_handle, + file_io_handle, + sector_data_offset, + encryption_context, + 1, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read sector data at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + sector_data_offset, + sector_data_offset ); + + goto on_error; + } + if( libfcache_cache_set_value_by_identifier( + sector_data_vector->cache, + 0, + offset, + sector_data_vector->cache_timestamp, + (intptr_t *) safe_sector_data, + (int (*)(intptr_t **, libcerror_error_t **)) &libbde_sector_data_free, + LIBFCACHE_CACHE_VALUE_FLAG_MANAGED, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set sector data in cache.", + function ); + + goto on_error; + } + *sector_data = safe_sector_data; + safe_sector_data = NULL; + } + return( 1 ); + +on_error: + if( safe_sector_data != NULL ) + { + libbde_sector_data_free( + &safe_sector_data, + NULL ); + } + return( -1 ); +} + diff -Nru libbde-20190102/libbde/libbde_sector_data_vector.h libbde-20240223/libbde/libbde_sector_data_vector.h --- libbde-20190102/libbde/libbde_sector_data_vector.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_sector_data_vector.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,89 @@ +/* + * Sector data vector functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBBDE_SECTOR_DATA_VECTOR_H ) +#define _LIBBDE_SECTOR_DATA_VECTOR_H + +#include +#include + +#include "libbde_encryption_context.h" +#include "libbde_io_handle.h" +#include "libbde_libcerror.h" +#include "libbde_libbfio.h" +#include "libbde_libfcache.h" +#include "libbde_sector_data.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libbde_sector_data_vector libbde_sector_data_vector_t; + +struct libbde_sector_data_vector +{ + /* The cache timestamp + */ + int64_t cache_timestamp; + + /* The sector data cache + */ + libfcache_cache_t *cache; + + /* The number of bytes per sector + */ + uint16_t bytes_per_sector; + + /* The data offset + */ + off64_t data_offset; + + /* The data size + */ + size64_t data_size; +}; + +int libbde_sector_data_vector_initialize( + libbde_sector_data_vector_t **sector_data_vector, + uint16_t bytes_per_sector, + off64_t data_offset, + size64_t data_size, + libcerror_error_t **error ); + +int libbde_sector_data_vector_free( + libbde_sector_data_vector_t **sector_data_vector, + libcerror_error_t **error ); + +int libbde_sector_data_vector_get_sector_data_at_offset( + libbde_sector_data_vector_t *sector_data_vector, + libbde_io_handle_t *io_handle, + libbfio_handle_t *file_io_handle, + libbde_encryption_context_t *encryption_context, + off64_t offset, + libbde_sector_data_t **sector_data, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBBDE_SECTOR_DATA_VECTOR_H ) */ + diff -Nru libbde-20190102/libbde/libbde_stretch_key.c libbde-20240223/libbde/libbde_stretch_key.c --- libbde-20190102/libbde/libbde_stretch_key.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_stretch_key.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Stretch Key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -201,7 +201,8 @@ value_data = metadata_entry->value_data; value_data_size = metadata_entry->value_data_size; - if( value_data_size < sizeof( bde_metadata_entry_stretch_key_header_t ) ) + if( ( value_data_size < sizeof( bde_metadata_entry_stretch_key_header_t ) ) + || ( value_data_size > MEMORY_MAXIMUM_ALLOCATION_SIZE ) ) { libcerror_error_set( error, diff -Nru libbde-20190102/libbde/libbde_stretch_key.h libbde-20240223/libbde/libbde_stretch_key.h --- libbde-20190102/libbde/libbde_stretch_key.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_stretch_key.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Stretch Key metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_STRETCH_KEY_H ) diff -Nru libbde-20190102/libbde/libbde_support.c libbde-20240223/libbde/libbde_support.c --- libbde-20190102/libbde/libbde_support.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_support.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -375,25 +375,11 @@ goto on_error; } } - if( libbfio_handle_seek_offset( - file_io_handle, - 0, - SEEK_SET, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek file header offset: 0.", - function ); - - goto on_error; - } - read_count = libbfio_handle_read_buffer( + read_count = libbfio_handle_read_buffer_at_offset( file_io_handle, signature, 512, + 0, error ); if( read_count != 512 ) @@ -402,7 +388,7 @@ error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read signature.", + "%s: unable to read signature at offset: 0 (0x00000000).", function ); goto on_error; @@ -432,7 +418,7 @@ } else if( memory_compare( signature, - bde_boot_entry_point_win7, + bde_boot_entry_point_windows7, 3 ) == 0 ) { if( memory_compare( @@ -442,6 +428,15 @@ { found_boot_entry_point = 1; } +#if defined( HAVE_DEBUG_OUTPUT ) + else if( memory_compare( + &( signature[ 160 ] ), + bde_identifier_used_disk_space_only, + 16 ) == 0 ) + { + found_boot_entry_point = 1; + } +#endif else if( memory_compare( &( signature[ 424 ] ), bde_identifier, diff -Nru libbde-20190102/libbde/libbde_support.h libbde-20240223/libbde/libbde_support.h --- libbde-20190102/libbde/libbde_support.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_support.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_SUPPORT_H ) diff -Nru libbde-20190102/libbde/libbde_types.h libbde-20240223/libbde/libbde_types.h --- libbde-20190102/libbde/libbde_types.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_types.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libbde/libbde_unused.h libbde-20240223/libbde/libbde_unused.h --- libbde-20190102/libbde/libbde_unused.h 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_unused.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_UNUSED_H ) diff -Nru libbde-20190102/libbde/libbde_volume.c libbde-20240223/libbde/libbde_volume.c --- libbde-20190102/libbde/libbde_volume.c 2019-01-02 14:14:12.000000000 +0000 +++ libbde-20240223/libbde/libbde_volume.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Volume functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -27,19 +27,21 @@ #include "libbde_debug.h" #include "libbde_definitions.h" +#include "libbde_encryption_context.h" #include "libbde_io_handle.h" #include "libbde_libbfio.h" #include "libbde_libcerror.h" #include "libbde_libcnotify.h" #include "libbde_libcthreads.h" -#include "libbde_libfcache.h" -#include "libbde_libfdata.h" #include "libbde_metadata.h" +#include "libbde_metadata_header.h" #include "libbde_key_protector.h" #include "libbde_password.h" #include "libbde_recovery.h" #include "libbde_sector_data.h" +#include "libbde_sector_data_vector.h" #include "libbde_volume.h" +#include "libbde_volume_header.h" #include "bde_metadata.h" @@ -142,7 +144,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -306,7 +308,7 @@ } /* Opens a volume - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ int libbde_volume_open( libbde_volume_t *volume, @@ -318,7 +320,6 @@ libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_open"; size_t filename_length = 0; - int result = 0; if( volume == NULL ) { @@ -425,13 +426,11 @@ goto on_error; } - result = libbde_volume_open_file_io_handle( - volume, - file_io_handle, - access_flags, - error ); - - if( result == -1 ) + if( libbde_volume_open_file_io_handle( + volume, + file_io_handle, + access_flags, + error ) != 1 ) { libcerror_error_set( error, @@ -443,58 +442,39 @@ goto on_error; } - else if( result == 0 ) +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_grab_for_write( + internal_volume->read_write_lock, + error ) != 1 ) { - if( libbfio_handle_free( - &file_io_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free file IO handle.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); - goto on_error; - } + return( -1 ); } - else - { -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_grab_for_write( - internal_volume->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } #endif - internal_volume->file_io_handle_created_in_library = 1; + internal_volume->file_io_handle_created_in_library = 1; #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + if( libcthreads_read_write_lock_release_for_write( + internal_volume->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); - return( -1 ); - } -#endif + return( -1 ); } - return( result ); +#endif + return( 1 ); on_error: if( file_io_handle != NULL ) @@ -509,7 +489,7 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) /* Opens a volume - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ int libbde_volume_open_wide( libbde_volume_t *volume, @@ -521,7 +501,6 @@ libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_open_wide"; size_t filename_length = 0; - int result = 0; if( volume == NULL ) { @@ -628,13 +607,11 @@ goto on_error; } - result = libbde_volume_open_file_io_handle( - volume, - file_io_handle, - access_flags, - error ); - - if( result == -1 ) + if( libbde_volume_open_file_io_handle( + volume, + file_io_handle, + access_flags, + error ) != 1 ) { libcerror_error_set( error, @@ -646,58 +623,39 @@ goto on_error; } - else if( result == 0 ) +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_grab_for_write( + internal_volume->read_write_lock, + error ) != 1 ) { - if( libbfio_handle_free( - &file_io_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free file IO handle.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); - goto on_error; - } + return( -1 ); } - else - { -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_grab_for_write( - internal_volume->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } #endif - internal_volume->file_io_handle_created_in_library = 1; + internal_volume->file_io_handle_created_in_library = 1; #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + if( libcthreads_read_write_lock_release_for_write( + internal_volume->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); - return( -1 ); - } -#endif + return( -1 ); } - return( result ); +#endif + return( 1 ); on_error: if( file_io_handle != NULL ) @@ -712,7 +670,7 @@ #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Opens a volume using a Basic File IO (bfio) handle - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ int libbde_volume_open_file_io_handle( libbde_volume_t *volume, @@ -722,10 +680,10 @@ { libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_open_file_io_handle"; + uint8_t file_io_handle_opened_in_library = 0; int bfio_access_flags = 0; int file_io_handle_is_open = 0; - int file_io_handle_opened_in_library = 0; - int result = 0; + int result = 1; if( volume == NULL ) { @@ -822,12 +780,25 @@ } file_io_handle_opened_in_library = 1; } - result = libbde_volume_open_read( - internal_volume, - file_io_handle, - error ); +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_grab_for_write( + internal_volume->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); - if( result == -1 ) + return( -1 ); + } +#endif + if( libbde_internal_volume_open_read( + internal_volume, + file_io_handle, + error ) != 1 ) { libcerror_error_set( error, @@ -836,66 +807,33 @@ "%s: unable to read from file IO handle.", function ); - goto on_error; - } - else if( result == 0 ) - { - if( file_io_handle_opened_in_library != 0 ) - { - file_io_handle_opened_in_library = 0; - - if( libbfio_handle_close( - file_io_handle, - error ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_CLOSE_FAILED, - "%s: unable to close file IO handle.", - function ); - - goto on_error; - } - } + result = -1; } else { -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_grab_for_write( - internal_volume->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif internal_volume->file_io_handle = file_io_handle; internal_volume->file_io_handle_opened_in_library = file_io_handle_opened_in_library; - + } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + if( libcthreads_read_write_lock_release_for_write( + internal_volume->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); - return( -1 ); - } + return( -1 ); + } #endif + if( result == -1 ) + { + goto on_error; } - return( result ); + return( 1 ); on_error: if( file_io_handle_opened_in_library != 0 ) @@ -931,13 +869,13 @@ } internal_volume = (libbde_internal_volume_t *) volume; - if( internal_volume->io_handle == NULL ) + if( internal_volume->file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid volume - missing IO handle.", + "%s: invalid volume - missing file IO handle.", function ); return( -1 ); @@ -1027,32 +965,81 @@ result = -1; } - if( libfdata_vector_free( - &( internal_volume->sectors_vector ), - error ) != 1 ) + if( memory_set( + internal_volume->full_volume_encryption_key, + 0, + 32 ) == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free sectors vector.", + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear full volume encryption key.", function ); result = -1; } - if( libfcache_cache_free( - &( internal_volume->sectors_cache ), + if( memory_set( + internal_volume->tweak_key, + 0, + 32 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear tweak key.", + function ); + + result = -1; + } + internal_volume->keys_are_set = 0; + + if( libbde_sector_data_vector_free( + &( internal_volume->sector_data_vector ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free sectors cache.", + "%s: unable to free sector data vector.", function ); result = -1; } + if( internal_volume->encryption_context != NULL ) + { + if( libbde_encryption_context_free( + &( internal_volume->encryption_context ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free encryption context.", + function ); + + result = -1; + } + } + if( internal_volume->volume_header != NULL ) + { + if( libbde_volume_header_free( + &( internal_volume->volume_header ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free volume header.", + function ); + + result = -1; + } + } if( internal_volume->primary_metadata != NULL ) { if( libbde_metadata_free( @@ -1101,6 +1088,22 @@ result = -1; } } + if( internal_volume->external_key_metadata != NULL ) + { + if( libbde_metadata_free( + &( internal_volume->external_key_metadata ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free external key metadata.", + function ); + + result = -1; + } + } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_volume->read_write_lock, @@ -1120,18 +1123,17 @@ } /* Opens a volume for reading - * Returns 1 if successful, 0 if the keys could not be read or -1 on error + * Returns 1 if successful or -1 on error */ -int libbde_volume_open_read( +int libbde_internal_volume_open_read( libbde_internal_volume_t *internal_volume, libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { uint8_t *startup_key_identifier = NULL; - static char *function = "libbde_volume_open_read"; + static char *function = "libbde_internal_volume_open_read"; size64_t file_size = 0; size_t startup_key_identifier_size = 0; - int element_index = 0; int result = 0; if( internal_volume == NULL ) @@ -1156,115 +1158,118 @@ return( -1 ); } - if( internal_volume->primary_metadata != NULL ) + if( internal_volume->volume_header != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid file - primary metadata.", + "%s: invalid volume - volume header value already set.", function ); return( -1 ); } - if( internal_volume->secondary_metadata != NULL ) + if( internal_volume->primary_metadata != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid file - secondary metadata.", + "%s: invalid volume - primary metadata value already set.", function ); return( -1 ); } - if( internal_volume->tertiary_metadata != NULL ) + if( internal_volume->secondary_metadata != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid file - tertiary metadata.", + "%s: invalid volume - secondary metadata value already set.", function ); return( -1 ); } - if( internal_volume->sectors_vector != NULL ) + if( internal_volume->tertiary_metadata != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid file - sectors vector already set.", + "%s: invalid volume - tertiary metadata value already set.", function ); return( -1 ); } - if( internal_volume->sectors_cache != NULL ) + if( internal_volume->sector_data_vector != NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid file - sectors cache already set.", + "%s: invalid volume - sector data vector already set.", function ); return( -1 ); } -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_grab_for_write( - internal_volume->read_write_lock, - error ) != 1 ) + if( libbfio_handle_get_size( + file_io_handle, + &file_size, + error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve file size.", function ); - return( -1 ); + goto on_error; } -#endif - if( libbde_metadata_initialize( - &( internal_volume->primary_metadata ), - error ) != 1 ) +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create primary metadata.", - function ); - - goto on_error; + libcnotify_printf( + "Reading BitLocker volume header:\n" ); } - if( libbde_metadata_initialize( - &( internal_volume->secondary_metadata ), +#endif + if( libbde_volume_header_initialize( + &( internal_volume->volume_header ), error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create secondary metadata.", + "%s: unable to create volume header.", function ); goto on_error; } - if( libbde_metadata_initialize( - &( internal_volume->tertiary_metadata ), + if( libbde_volume_header_read_file_io_handle( + internal_volume->volume_header, + file_io_handle, + 0, error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create tertiary metadata.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read volume header.", function ); goto on_error; } + internal_volume->io_handle->version = internal_volume->volume_header->version; + internal_volume->io_handle->bytes_per_sector = internal_volume->volume_header->bytes_per_sector; + internal_volume->io_handle->first_metadata_offset = internal_volume->volume_header->first_metadata_offset; + internal_volume->io_handle->second_metadata_offset = internal_volume->volume_header->second_metadata_offset; + internal_volume->io_handle->third_metadata_offset = internal_volume->volume_header->third_metadata_offset; + internal_volume->io_handle->metadata_size = internal_volume->volume_header->metadata_size; + internal_volume->io_handle->volume_size = internal_volume->volume_header->volume_size; + if( ( internal_volume->external_key_metadata != NULL ) && ( internal_volume->external_key_metadata->startup_key_external_key != NULL ) ) { @@ -1275,36 +1280,27 @@ if( libcnotify_verbose != 0 ) { libcnotify_printf( - "Reading BitLocker volume header:\n" ); + "Reading BitLocker primary metadata block:\n" ); } #endif - if( libbde_io_handle_read_volume_header( - internal_volume->io_handle, - file_io_handle, - 0, + if( libbde_metadata_initialize( + &( internal_volume->primary_metadata ), error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read volume header.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create primary metadata.", function ); goto on_error; } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "Reading BitLocker primary metadata block:\n" ); - } -#endif if( libbde_metadata_read_block( internal_volume->primary_metadata, internal_volume->io_handle, file_io_handle, - internal_volume->io_handle->first_metadata_offset, + internal_volume->volume_header->first_metadata_offset, startup_key_identifier, startup_key_identifier_size, error ) != 1 ) @@ -1325,11 +1321,24 @@ "Reading BitLocker secondary metadata block:\n" ); } #endif + if( libbde_metadata_initialize( + &( internal_volume->secondary_metadata ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create secondary metadata.", + function ); + + goto on_error; + } if( libbde_metadata_read_block( internal_volume->secondary_metadata, internal_volume->io_handle, file_io_handle, - internal_volume->io_handle->second_metadata_offset, + internal_volume->volume_header->second_metadata_offset, startup_key_identifier, startup_key_identifier_size, error ) != 1 ) @@ -1350,11 +1359,24 @@ "Reading BitLocker tertiary metadata block:\n" ); } #endif + if( libbde_metadata_initialize( + &( internal_volume->tertiary_metadata ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create tertiary metadata.", + function ); + + goto on_error; + } if( libbde_metadata_read_block( internal_volume->tertiary_metadata, internal_volume->io_handle, file_io_handle, - internal_volume->io_handle->third_metadata_offset, + internal_volume->volume_header->third_metadata_offset, startup_key_identifier, startup_key_identifier_size, error ) != 1 ) @@ -1368,247 +1390,237 @@ goto on_error; } - result = libbde_volume_open_read_keys_from_metadata( + if( ( internal_volume->primary_metadata->volume_header_offset != 0 ) + && ( internal_volume->primary_metadata->volume_header_size == 0 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid volume header size value out of bounds.", + function ); + + goto on_error; + } + internal_volume->io_handle->encrypted_volume_size = internal_volume->primary_metadata->encrypted_volume_size; + internal_volume->io_handle->mft_mirror_cluster_block_number = internal_volume->primary_metadata->mft_mirror_cluster_block_number; + internal_volume->io_handle->volume_header_offset = internal_volume->primary_metadata->volume_header_offset; + internal_volume->io_handle->volume_header_size = internal_volume->primary_metadata->volume_header_size; + internal_volume->encryption_method = internal_volume->primary_metadata->encryption_method; + + result = libbde_internal_volume_unlock( internal_volume, - internal_volume->primary_metadata, + file_io_handle, error ); if( result == -1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read keys from primary metadata.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to unlock volume.", function ); goto on_error; } - if( result == 0 ) + if( file_size == 0 ) + { + file_size = internal_volume->io_handle->volume_size; + } + if( file_size == 0 ) { - result = libbde_volume_open_read_keys_from_metadata( - internal_volume, - internal_volume->secondary_metadata, - error ); + file_size = internal_volume->io_handle->encrypted_volume_size; + } + if( libbde_sector_data_vector_initialize( + &( internal_volume->sector_data_vector ), + (size64_t) internal_volume->io_handle->bytes_per_sector, + 0, + file_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create sector data vector.", + function ); - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read keys from secondary metadata.", - function ); + goto on_error; + } + return( 1 ); - goto on_error; - } +on_error: + if( internal_volume->sector_data_vector != NULL ) + { + libbde_sector_data_vector_free( + &( internal_volume->sector_data_vector ), + NULL ); + } + if( internal_volume->encryption_context != NULL ) + { + libbde_encryption_context_free( + &( internal_volume->encryption_context ), + NULL ); } - if( result == 0 ) + if( internal_volume->tertiary_metadata != NULL ) { - result = libbde_volume_open_read_keys_from_metadata( - internal_volume, - internal_volume->tertiary_metadata, - error ); + libbde_metadata_free( + &( internal_volume->tertiary_metadata ), + NULL ); + } + if( internal_volume->secondary_metadata != NULL ) + { + libbde_metadata_free( + &( internal_volume->secondary_metadata ), + NULL ); + } + if( internal_volume->primary_metadata != NULL ) + { + libbde_metadata_free( + &( internal_volume->primary_metadata ), + NULL ); + } + if( internal_volume->volume_header != NULL ) + { + libbde_volume_header_free( + &( internal_volume->volume_header ), + NULL ); + } + return( -1 ); +} - if( result == -1 ) +/* Reads the keys from when unlocking the volume + * Returns 1 if successful, 0 if not or -1 on error + */ +int libbde_internal_volume_open_read_keys( + libbde_internal_volume_t *internal_volume, + libcerror_error_t **error ) +{ + static char *function = "libbde_internal_volume_open_read_keys"; + + if( internal_volume == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume.", + function ); + + return( -1 ); + } + if( internal_volume->keys_are_set == 0 ) + { + if( libbde_internal_volume_open_read_keys_from_metadata( + internal_volume, + internal_volume->primary_metadata, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read keys from tertiary metadata.", + "%s: unable to read keys from primary metadata.", function ); - goto on_error; + return( -1 ); } } - if( result != 0 ) + if( internal_volume->keys_are_set == 0 ) { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "Reading unencrypted volume header:\n" ); - } -#endif - if( libbde_io_handle_read_unencrypted_volume_header( - internal_volume->io_handle, - file_io_handle, + if( libbde_internal_volume_open_read_keys_from_metadata( + internal_volume, + internal_volume->secondary_metadata, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read unencrypted volume header.", + "%s: unable to read keys from secondary metadata.", function ); - goto on_error; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: volume size\t\t\t\t\t: %" PRIu64 "\n", - function, - internal_volume->io_handle->volume_size ); - - libcnotify_printf( - "\n" ); + return( -1 ); } -#endif - if( libbfio_handle_get_size( - file_io_handle, - &file_size, - error ) == -1 ) + } + if( internal_volume->keys_are_set == 0 ) + { + if( libbde_internal_volume_open_read_keys_from_metadata( + internal_volume, + internal_volume->tertiary_metadata, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve file size.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read keys from tertiary metadata.", function ); - goto on_error; - } - /* Correct a volume size that is 1 sector short - */ - if( ( internal_volume->io_handle->encrypted_volume_size == ( internal_volume->io_handle->volume_size + internal_volume->io_handle->bytes_per_sector ) ) - && ( ( internal_volume->io_handle->volume_size + internal_volume->io_handle->bytes_per_sector ) <= file_size ) ) - { - internal_volume->io_handle->volume_size += internal_volume->io_handle->bytes_per_sector; + return( -1 ); } -/* TODO clone function ? */ - if( libfdata_vector_initialize( - &( internal_volume->sectors_vector ), - (size64_t) internal_volume->io_handle->bytes_per_sector, - (intptr_t *) internal_volume->io_handle, - NULL, - NULL, - (int (*)(intptr_t *, intptr_t *, libfdata_vector_t *, libfdata_cache_t *, int, int, off64_t, size64_t, uint32_t, uint8_t, libcerror_error_t **)) &libbde_io_handle_read_sector, - NULL, - LIBFDATA_DATA_HANDLE_FLAG_NON_MANAGED, + } + if( ( internal_volume->encryption_context == NULL ) + && ( internal_volume->keys_are_set != 0 ) ) + { + if( libbde_encryption_context_initialize( + &( internal_volume->encryption_context ), + internal_volume->encryption_method, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sectors vector.", + "%s: unable to create encryption context.", function ); - goto on_error; + return( -1 ); } - if( libfdata_vector_append_segment( - internal_volume->sectors_vector, - &element_index, - 0, - 0, - internal_volume->io_handle->volume_size, - 0, + if( libbde_encryption_context_set_keys( + internal_volume->encryption_context, + internal_volume->full_volume_encryption_key, + 64, + internal_volume->tweak_key, + 32, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append segment to sectors vector.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set keys in encryption context.", function ); - goto on_error; - } - if( libfcache_cache_initialize( - &( internal_volume->sectors_cache ), - LIBBDE_MAXIMUM_CACHE_ENTRIES_SECTORS, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sectors cache.", - function ); + libbde_encryption_context_free( + &( internal_volume->encryption_context ), + NULL ); - goto on_error; + return( -1 ); } - internal_volume->is_locked = 0; } -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - error ) != 1 ) + if( internal_volume->encryption_context != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); - - return( -1 ); + return( 1 ); } -#endif - return( result ); - -on_error: - if( internal_volume->sectors_cache != NULL ) - { - libfcache_cache_free( - &( internal_volume->sectors_cache ), - NULL ); - } - if( internal_volume->sectors_vector != NULL ) - { - libfdata_vector_free( - &( internal_volume->sectors_vector ), - NULL ); - } - if( internal_volume->tertiary_metadata != NULL ) - { - libbde_metadata_free( - &( internal_volume->tertiary_metadata ), - NULL ); - } - if( internal_volume->secondary_metadata != NULL ) - { - libbde_metadata_free( - &( internal_volume->secondary_metadata ), - NULL ); - } - if( internal_volume->primary_metadata != NULL ) - { - libbde_metadata_free( - &( internal_volume->primary_metadata ), - NULL ); - } -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - NULL ); -#endif - return( -1 ); + return( 0 ); } /* Reads the keys from the metadata when opening the volume for reading - * Returns 1 if successful, 0 if not or -1 on error + * Returns 1 if successful or -1 on error */ -int libbde_volume_open_read_keys_from_metadata( +int libbde_internal_volume_open_read_keys_from_metadata( libbde_internal_volume_t *internal_volume, libbde_metadata_t *metadata, libcerror_error_t **error ) { - uint8_t full_volume_encryption_key[ 64 ]; - uint8_t tweak_key[ 32 ]; uint8_t volume_master_key[ 32 ]; - uint8_t *external_key = NULL; - static char *function = "libbde_volume_open_read_keys_from_metadata"; - off64_t volume_header_offset = 0; - size64_t volume_header_size = 0; - size64_t encrypted_volume_size = 0; - size_t external_key_size = 0; - uint16_t encryption_method = 0; - int result = 0; + uint8_t *external_key = NULL; + static char *function = "libbde_internal_volume_open_read_keys_from_metadata"; + size_t external_key_size = 0; + int result = 0; if( internal_volume == NULL ) { @@ -1643,259 +1655,352 @@ return( -1 ); } - if( memory_set( - full_volume_encryption_key, - 0, - 64 ) == NULL ) + if( metadata->encryption_method == LIBBDE_ENCRYPTION_METHOD_NONE ) + { + internal_volume->keys_are_set = 1; + } + else + { + if( ( internal_volume->external_key_metadata != NULL ) + && ( internal_volume->external_key_metadata->startup_key_external_key != NULL ) + && ( internal_volume->external_key_metadata->startup_key_external_key->key != NULL ) ) + { + external_key = internal_volume->external_key_metadata->startup_key_external_key->key->data; + external_key_size = internal_volume->external_key_metadata->startup_key_external_key->key->data_size; + } + if( memory_set( + volume_master_key, + 0, + 32 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear volume master key.", + function ); + + goto on_error; + } + result = libbde_metadata_read_volume_master_key( + metadata, + internal_volume->password_keep, + external_key, + external_key_size, + volume_master_key, + 32, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to read volume master key from metadata.", + function ); + + goto on_error; + } + else if( result != 0 ) + { + if( memory_set( + internal_volume->full_volume_encryption_key, + 0, + 64 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear full volume encryption key.", + function ); + + goto on_error; + } + if( memory_set( + internal_volume->tweak_key, + 0, + 32 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear tweak key.", + function ); + + goto on_error; + } + result = libbde_metadata_read_full_volume_encryption_key( + metadata, + metadata->encryption_method, + volume_master_key, + 32, + internal_volume->full_volume_encryption_key, + 64, + internal_volume->tweak_key, + 32, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to read full volume encryption key from metadata.", + function ); + + goto on_error; + } + else if( result != 0 ) + { +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: volume master key:\n", + function ); + libcnotify_print_data( + volume_master_key, + 32, + 0 ); + + libcnotify_printf( + "%s: full volume encryption key:\n", + function ); + libcnotify_print_data( + internal_volume->full_volume_encryption_key, + 64, + 0 ); + + libcnotify_printf( + "%s: tweak key:\n", + function ); + libcnotify_print_data( + internal_volume->tweak_key, + 32, + 0 ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + internal_volume->keys_are_set = 1; + } + } + if( memory_set( + volume_master_key, + 0, + 32 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to volume master key.", + function ); + + goto on_error; + } + } + return( 1 ); + +on_error: + memory_set( + volume_master_key, + 0, + 32 ); + + return( -1 ); +} + +/* Determines if the volume is locked + * Returns 1 if locked, 0 if not or -1 on error + */ +int libbde_volume_is_locked( + libbde_volume_t *volume, + libcerror_error_t **error ) +{ + libbde_internal_volume_t *internal_volume = NULL; + static char *function = "libbde_volume_is_locked"; + uint8_t is_locked = 0; + + if( volume == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear full volume encryption key.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume.", function ); - goto on_error; + return( -1 ); } - if( memory_set( - tweak_key, - 0, - 32 ) == NULL ) + internal_volume = (libbde_internal_volume_t *) volume; + +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_grab_for_read( + internal_volume->read_write_lock, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear tweak key.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", function ); - goto on_error; + return( -1 ); } - if( memory_set( - volume_master_key, - 0, - 32 ) == NULL ) +#endif + is_locked = internal_volume->is_locked; + +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_release_for_read( + internal_volume->read_write_lock, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear volume master key.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for reading.", function ); - goto on_error; + return( -1 ); } - if( ( internal_volume->external_key_metadata != NULL ) - && ( internal_volume->external_key_metadata->startup_key_external_key != NULL ) - && ( internal_volume->external_key_metadata->startup_key_external_key->key != NULL ) ) +#endif + return( is_locked ); +} + +/* Unlocks the volume + * Returns 1 if the volume is unlocked, 0 if not or -1 on error + */ +int libbde_internal_volume_unlock( + libbde_internal_volume_t *internal_volume, + libbfio_handle_t *file_io_handle, + libcerror_error_t **error ) +{ + static char *function = "libbde_internal_volume_unlock"; + size64_t file_size = 0; + off64_t volume_header_offset = 0; + int result = 0; + + if( internal_volume == NULL ) { - external_key = internal_volume->external_key_metadata->startup_key_external_key->key->data; - external_key_size = internal_volume->external_key_metadata->startup_key_external_key->key->data_size; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume.", + function ); + + return( -1 ); } - encrypted_volume_size = metadata->encrypted_volume_size; - volume_header_offset = metadata->volume_header_offset; - volume_header_size = metadata->volume_header_size; - encryption_method = metadata->encryption_method; + if( internal_volume->io_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid volume - missing IO handle.", + function ); - result = libbde_metadata_read_volume_master_key( - metadata, - internal_volume->io_handle, - internal_volume->password_keep, - external_key, - external_key_size, - volume_master_key, - 32, + return( -1 ); + } + result = libbde_internal_volume_open_read_keys( + internal_volume, error ); if( result == -1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to read volume master key from metadata.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read keys.", function ); - goto on_error; + return( -1 ); } else if( result != 0 ) { - result = libbde_metadata_read_full_volume_encryption_key( - metadata, - internal_volume->io_handle, - volume_master_key, - 32, - full_volume_encryption_key, - 64, - tweak_key, - 32, - error ); - - if( result == -1 ) +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to read full volume encryption key from metadata.", - function ); - - goto on_error; + libcnotify_printf( + "Reading unencrypted volume header:\n" ); } - } - if( result != 0 ) - { - if( ( volume_header_offset != 0 ) - && ( volume_header_size == 0 ) ) +#endif + if( ( internal_volume->io_handle->version == LIBBDE_VERSION_WINDOWS_7 ) + || ( internal_volume->io_handle->version == LIBBDE_VERSION_TO_GO ) ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid volume header size value out of bounds.", - function ); - - goto on_error; + volume_header_offset = internal_volume->io_handle->volume_header_offset; } - internal_volume->io_handle->encrypted_volume_size = encrypted_volume_size; - internal_volume->io_handle->volume_header_offset = volume_header_offset; - internal_volume->io_handle->volume_header_size = volume_header_size; - - if( libbde_encryption_initialize( - &( internal_volume->io_handle->encryption_context ), - encryption_method, + if( libbde_io_handle_read_unencrypted_volume_header( + internal_volume->io_handle, + file_io_handle, + volume_header_offset, + internal_volume->encryption_context, error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create encryption context.", + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read unencrypted volume header.", function ); - goto on_error; + return( -1 ); } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { libcnotify_printf( - "%s: volume master key:\n", - function ); - libcnotify_print_data( - volume_master_key, - 32, - 0 ); - - libcnotify_printf( - "%s: full volume encryption key:\n", - function ); - libcnotify_print_data( - full_volume_encryption_key, - 64, - 0 ); + "%s: volume size\t\t\t\t: %" PRIu64 "\n", + function, + internal_volume->io_handle->volume_size ); libcnotify_printf( - "%s: tweak key:\n", - function ); - libcnotify_print_data( - tweak_key, - 32, - 0 ); + "\n" ); } #endif - if( libbde_encryption_set_keys( - internal_volume->io_handle->encryption_context, - full_volume_encryption_key, - 64, - tweak_key, - 32, - error ) != 1 ) + if( libbfio_handle_get_size( + file_io_handle, + &file_size, + error ) == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set keys in encryption context.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve file size.", function ); - goto on_error; + return( -1 ); } + /* Correct a volume size that is 1 sector short + */ + if( ( internal_volume->io_handle->encrypted_volume_size == ( internal_volume->io_handle->volume_size + internal_volume->io_handle->bytes_per_sector ) ) + && ( ( internal_volume->io_handle->volume_size + internal_volume->io_handle->bytes_per_sector ) <= file_size ) ) + { + internal_volume->io_handle->volume_size += internal_volume->io_handle->bytes_per_sector; + } + internal_volume->is_locked = 0; } - if( memory_set( - full_volume_encryption_key, - 0, - 64 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear full volume encryption key.", - function ); - - goto on_error; - } - if( memory_set( - tweak_key, - 0, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear tweak key.", - function ); - - goto on_error; - } - if( memory_set( - volume_master_key, - 0, - 32 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to volume master key.", - function ); - - goto on_error; - } - internal_volume->encryption_method = encryption_method; - return( result ); - -on_error: - memory_set( - full_volume_encryption_key, - 0, - 32 ); - - memory_set( - tweak_key, - 0, - 32 ); - - memory_set( - volume_master_key, - 0, - 32 ); - - return( -1 ); } -/* Determines if the volume is locked - * Returns 1 if locked, 0 if not or -1 on error +/* Unlocks the volume + * Returns 1 if the volume is unlocked, 0 if not or -1 on error */ -int libbde_volume_is_locked( +int libbde_volume_unlock( libbde_volume_t *volume, libcerror_error_t **error ) { libbde_internal_volume_t *internal_volume = NULL; - static char *function = "libbde_volume_is_locked"; - uint8_t is_locked = 0; + static char *function = "libbde_volume_unlock"; + int result = 1; if( volume == NULL ) { @@ -1911,7 +2016,7 @@ internal_volume = (libbde_internal_volume_t *) volume; #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_grab_for_read( + if( libcthreads_read_write_lock_grab_for_write( internal_volume->read_write_lock, error ) != 1 ) { @@ -1919,16 +2024,33 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for reading.", + "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif - is_locked = internal_volume->is_locked; + if( internal_volume->is_locked != 0 ) + { + result = libbde_internal_volume_unlock( + internal_volume, + internal_volume->file_io_handle, + error ); + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to unlock volume.", + function ); + + result = -1; + } + } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - if( libcthreads_read_write_lock_release_for_read( + if( libcthreads_read_write_lock_release_for_write( internal_volume->read_write_lock, error ) != 1 ) { @@ -1936,16 +2058,16 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for reading.", + "%s: unable to release read/write lock for writing.", function ); return( -1 ); } #endif - return( is_locked ); + return( result ); } -/* Reads (volume) data from the last current into a buffer using a Basic File IO (bfio) handle +/* Reads unencrypted data from the last current into a buffer using a Basic File IO (bfio) handle * This function is not multi-thread safe acquire write lock before call * Returns the number of bytes read or -1 on error */ @@ -1958,11 +2080,11 @@ { libbde_sector_data_t *sector_data = NULL; static char *function = "libbde_internal_volume_read_buffer_from_file_io_handle"; - off64_t element_data_offset = 0; size_t buffer_offset = 0; size_t read_size = 0; + size_t remaining_buffer_size = 0; size_t sector_data_offset = 0; - ssize_t total_read_count = 0; + off64_t sector_file_offset = 0; if( internal_volume == NULL ) { @@ -1997,24 +2119,13 @@ return( -1 ); } - if( internal_volume->sectors_vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid file - missing sectors vector.", - function ); - - return( -1 ); - } - if( internal_volume->sectors_cache == NULL ) + if( internal_volume->sector_data_vector == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid file - missing sectors cache.", + "%s: invalid volume - missing sector data vector.", function ); return( -1 ); @@ -2052,35 +2163,50 @@ return( -1 ); } + internal_volume->io_handle->abort = 0; + if( (size64_t) internal_volume->current_offset >= internal_volume->io_handle->volume_size ) { return( 0 ); } - if( (size64_t) ( internal_volume->current_offset + buffer_size ) >= internal_volume->io_handle->volume_size ) + if( (size64_t) buffer_size > ( internal_volume->io_handle->volume_size - internal_volume->current_offset ) ) { buffer_size = (size_t) ( internal_volume->io_handle->volume_size - internal_volume->current_offset ); } - sector_data_offset = (size_t) ( internal_volume->current_offset % internal_volume->io_handle->bytes_per_sector ); + remaining_buffer_size = buffer_size; + + sector_file_offset = ( internal_volume->current_offset / internal_volume->io_handle->bytes_per_sector ) * internal_volume->io_handle->bytes_per_sector; + sector_data_offset = (size_t) ( internal_volume->current_offset - sector_file_offset ); - while( buffer_size > 0 ) + while( remaining_buffer_size > 0 ) { - if( libfdata_vector_get_element_value_at_offset( - internal_volume->sectors_vector, - (intptr_t *) file_io_handle, - (libfdata_cache_t *) internal_volume->sectors_cache, - internal_volume->current_offset, - &element_data_offset, - (intptr_t **) §or_data, - 0, + read_size = internal_volume->io_handle->bytes_per_sector - sector_data_offset; + + if( read_size > remaining_buffer_size ) + { + read_size = remaining_buffer_size; + } + if( read_size == 0 ) + { + break; + } + if( libbde_sector_data_vector_get_sector_data_at_offset( + internal_volume->sector_data_vector, + internal_volume->io_handle, + file_io_handle, + internal_volume->encryption_context, + sector_file_offset, + §or_data, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sector data at offset: %" PRIi64 ".", + "%s: unable to retrieve sector data at offset: %" PRIi64 " (0x%08" PRIx64 ").", function, - internal_volume->current_offset ); + sector_file_offset, + sector_file_offset ); return( -1 ); } @@ -2090,22 +2216,13 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sector data at offset: %" PRIi64 ".", + "%s: missing sector data at offset: %" PRIi64 " (0x%08" PRIx64 ").", function, - internal_volume->current_offset ); + sector_file_offset, + sector_file_offset ); return( -1 ); } - read_size = sector_data->data_size - sector_data_offset; - - if( read_size > buffer_size ) - { - read_size = buffer_size; - } - if( read_size == 0 ) - { - break; - } if( memory_copy( &( ( (uint8_t *) buffer )[ buffer_offset ] ), &( ( sector_data->data )[ sector_data_offset ] ), @@ -2120,26 +2237,22 @@ return( -1 ); } - buffer_offset += read_size; - buffer_size -= read_size; - total_read_count += (ssize_t) read_size; - sector_data_offset = 0; + buffer_offset += read_size; + remaining_buffer_size -= read_size; + sector_data_offset = 0; + sector_file_offset += read_size; - internal_volume->current_offset += (off64_t) read_size; - - if( (size64_t) internal_volume->current_offset >= internal_volume->io_handle->volume_size ) - { - break; - } if( internal_volume->io_handle->abort != 0 ) { break; } } - return( total_read_count ); + internal_volume->current_offset += (off64_t) buffer_offset; + + return( (ssize_t) buffer_offset ); } -/* Reads data at the current offset into a buffer +/* Reads unencrypted data at the current offset into a buffer * Returns the number of bytes read or -1 on error */ ssize_t libbde_volume_read_buffer( @@ -2216,7 +2329,7 @@ return( read_count ); } -/* Reads (volume) data at a specific offset +/* Reads unencrypted data at a specific offset * Returns the number of bytes read or -1 on error */ ssize_t libbde_volume_read_buffer_at_offset( @@ -2317,71 +2430,7 @@ return( -1 ); } -#ifdef TODO_WRITE_SUPPORT - -/* Writes (volume) data at the current offset - * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error - */ -ssize_t libbde_volume_write_buffer( - libbde_volume_t *volume, - void *buffer, - size_t buffer_size, - libcerror_error_t **error ) -{ - return( -1 ); -} - -/* Writes (volume) data at a specific offset, - * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error - */ -ssize_t libbde_volume_write_buffer_at_offset( - libbde_volume_t *volume, - const void *buffer, - size_t buffer_size, - off64_t offset, - libcerror_error_t **error ) -{ - static char *function = "libbde_volume_write_buffer_at_offset"; - ssize_t write_count = 0; - - if( libbde_volume_seek_offset( - volume, - offset, - SEEK_SET, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek offset.", - function ); - - return( -1 ); - } - write_count = libbde_volume_write_buffer( - volume, - buffer, - buffer_size, - error ); - - if( write_count < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_WRITE_FAILED, - "%s: unable to write buffer.", - function ); - - return( -1 ); - } - return( write_count ); -} - -#endif /* TODO_WRITE_SUPPORT */ - -/* Seeks a certain offset of the (volume) data +/* Seeks a certain offset within the unencrypted data * This function is not multi-thread safe acquire write lock before call * Returns the offset if seek is successful or -1 on error */ @@ -2472,7 +2521,7 @@ return( offset ); } -/* Seeks a certain offset of the data +/* Seeks a certain offset within the unencrypted data * Returns the offset if seek is successful or -1 on error */ off64_t libbde_volume_seek_offset( @@ -2497,17 +2546,6 @@ } internal_volume = (libbde_internal_volume_t *) volume; - if( internal_volume->io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid volume - missing IO handle.", - function ); - - return( -1 ); - } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_volume->read_write_lock, @@ -2558,7 +2596,7 @@ return( offset ); } -/* Retrieves the current offset of the (volume) data +/* Retrieves the current offset within the unencrypted data * Returns 1 if successful or -1 on error */ int libbde_volume_get_offset( @@ -2582,17 +2620,6 @@ } internal_volume = (libbde_internal_volume_t *) volume; - if( internal_volume->io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid volume - missing IO handle.", - function ); - - return( -1 ); - } if( offset == NULL ) { libcerror_error_set( @@ -2674,6 +2701,17 @@ return( -1 ); } + if( internal_volume->is_locked != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid volume - volume is locked.", + function ); + + return( -1 ); + } if( size == NULL ) { libcerror_error_set( @@ -2796,14 +2834,14 @@ */ int libbde_volume_get_volume_identifier( libbde_volume_t *volume, - uint8_t *volume_identifier, - size_t size, + uint8_t *guid_data, + size_t guid_data_size, libcerror_error_t **error ) { libbde_internal_volume_t *internal_volume = NULL; libbde_metadata_t *metadata = NULL; static char *function = "libbde_volume_get_volume_identifier"; - int result = 1; + int result = 0; if( volume == NULL ) { @@ -2843,24 +2881,25 @@ { metadata = internal_volume->tertiary_metadata; } - if( metadata == NULL ) + if( metadata != NULL ) { - result = 0; - } - else if( libbde_metadata_get_volume_identifier( - metadata, - volume_identifier, - size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve volume identifier from primary metadata.", - function ); + result = libbde_metadata_get_volume_identifier( + metadata, + guid_data, + guid_data_size, + error ); - result = -1; + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve volume identifier.", + function ); + + result = -1; + } } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( @@ -2944,7 +2983,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve creation time from primary metadata.", + "%s: unable to retrieve creation time", function ); result = -1; @@ -3023,19 +3062,24 @@ { result = 0; } - else if( libbde_metadata_get_utf8_description_size( - metadata, - utf8_string_size, - error ) != 1 ) + else { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve UTF-8 description size from primary metadata.", - function ); + result = libbde_metadata_get_utf8_description_size( + metadata, + utf8_string_size, + error ); - result = -1; + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve UTF-8 description size.", + function ); + + result = -1; + } } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( @@ -3113,20 +3157,25 @@ { result = 0; } - else if( libbde_metadata_get_utf8_description( - metadata, - utf8_string, - utf8_string_size, - error ) != 1 ) + else { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve UTF-8 description from primary metadata.", - function ); + result = libbde_metadata_get_utf8_description( + metadata, + utf8_string, + utf8_string_size, + error ); - result = -1; + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve UTF-8 description.", + function ); + + result = -1; + } } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( @@ -3202,19 +3251,24 @@ { result = 0; } - else if( libbde_metadata_get_utf16_description_size( - metadata, - utf16_string_size, - error ) != 1 ) + else { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve UTF-16 description size from primary metadata.", - function ); + result = libbde_metadata_get_utf16_description_size( + metadata, + utf16_string_size, + error ); - result = -1; + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve UTF-16 description size.", + function ); + + result = -1; + } } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( @@ -3292,20 +3346,25 @@ { result = 0; } - else if( libbde_metadata_get_utf16_description( - metadata, - utf16_string, - utf16_string_size, - error ) != 1 ) + else { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve UTF-16 description from primary metadata.", - function ); + result = libbde_metadata_get_utf16_description( + metadata, + utf16_string, + utf16_string_size, + error ); - result = -1; + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve UTF-16 description.", + function ); + + result = -1; + } } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_read( @@ -3389,7 +3448,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of volume master key from primary metadata.", + "%s: unable to retrieve number of volume master key.", function ); result = -1; @@ -3415,6 +3474,114 @@ /* Retrieves a specific volume master key protector * Returns 1 if successful or -1 on error */ +int libbde_volume_get_key_protector_by_index( + libbde_volume_t *volume, + int key_protector_index, + libbde_key_protector_t **key_protector, + libcerror_error_t **error ) +{ + libbde_internal_volume_t *internal_volume = NULL; + libbde_metadata_t *metadata = NULL; + libbde_volume_master_key_t *volume_master_key = NULL; + static char *function = "libbde_volume_get_key_protector_by_index"; + int result = 1; + + if( volume == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume.", + function ); + + return( -1 ); + } + internal_volume = (libbde_internal_volume_t *) volume; + +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_grab_for_read( + internal_volume->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + metadata = internal_volume->primary_metadata; + + if( metadata == NULL ) + { + metadata = internal_volume->secondary_metadata; + } + if( metadata == NULL ) + { + metadata = internal_volume->tertiary_metadata; + } + if( metadata == NULL ) + { + result = 0; + } + else if( libbde_metadata_get_volume_master_key_by_index( + metadata, + key_protector_index, + &volume_master_key, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve volume master key: %d.", + function, + key_protector_index ); + + result = -1; + } + if( result == 1 ) + { + if( libbde_key_protector_initialize( + key_protector, + volume_master_key, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create key protector.", + function ); + + result = -1; + } + } +#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) + if( libcthreads_read_write_lock_release_for_read( + internal_volume->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + return( result ); +} + +/* Retrieves a specific volume master key protector + * Returns 1 if successful or -1 on error + */ int libbde_volume_get_key_protector( libbde_volume_t *volume, int key_protector_index, @@ -3479,7 +3646,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve volume master key: %d from primary metadata.", + "%s: unable to retrieve volume master key: %d.", function, key_protector_index ); @@ -3559,17 +3726,6 @@ return( -1 ); } - if( internal_volume->file_io_handle != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid volume - file IO handle already set.", - function ); - - return( -1 ); - } if( full_volume_encryption_key == NULL ) { libcerror_error_set( @@ -3582,7 +3738,8 @@ return( -1 ); } if( ( full_volume_encryption_key_size != 16 ) - && ( full_volume_encryption_key_size != 32 ) ) + && ( full_volume_encryption_key_size != 32 ) + && ( full_volume_encryption_key_size != 64 ) ) { libcerror_error_set( error, @@ -3644,12 +3801,12 @@ return( -1 ); } #endif - if( full_volume_encryption_key_size < 32 ) + if( full_volume_encryption_key_size < 64 ) { if( memory_set( - internal_volume->io_handle->full_volume_encryption_key, + internal_volume->full_volume_encryption_key, 0, - 32 ) == NULL ) + 64 ) == NULL ) { libcerror_error_set( error, @@ -3662,7 +3819,7 @@ } } if( memory_copy( - internal_volume->io_handle->full_volume_encryption_key, + internal_volume->full_volume_encryption_key, full_volume_encryption_key, full_volume_encryption_key_size ) == NULL ) { @@ -3675,12 +3832,12 @@ goto on_error; } - internal_volume->io_handle->full_volume_encryption_key_size = full_volume_encryption_key_size; + internal_volume->full_volume_encryption_key_size = full_volume_encryption_key_size; if( tweak_key_size < 32 ) { if( memory_set( - internal_volume->io_handle->tweak_key, + internal_volume->tweak_key, 0, 32 ) == NULL ) { @@ -3697,7 +3854,7 @@ if( tweak_key_size != 0 ) { if( memory_copy( - internal_volume->io_handle->tweak_key, + internal_volume->tweak_key, tweak_key, tweak_key_size ) == NULL ) { @@ -3711,9 +3868,9 @@ goto on_error; } } - internal_volume->io_handle->tweak_key_size = tweak_key_size; + internal_volume->tweak_key_size = tweak_key_size; - internal_volume->io_handle->keys_are_set = 1; + internal_volume->keys_are_set = 1; #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( @@ -3734,14 +3891,14 @@ on_error: memory_set( - internal_volume->io_handle->tweak_key, + internal_volume->tweak_key, 0, 32 ); memory_set( - internal_volume->io_handle->full_volume_encryption_key, + internal_volume->full_volume_encryption_key, 0, - 32 ); + 64 ); #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) libcthreads_read_write_lock_release_for_write( @@ -3763,6 +3920,7 @@ { libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_set_utf8_password"; + int result = 1; if( volume == NULL ) { @@ -3788,17 +3946,6 @@ return( -1 ); } - if( internal_volume->file_io_handle != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid volume - file IO handle already set.", - function ); - - return( -1 ); - } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_volume->read_write_lock, @@ -3828,10 +3975,12 @@ "%s: unable to set password hash.", function ); - goto on_error; + result = -1; + } + else + { + internal_volume->password_keep->password_is_set = 1; } - internal_volume->password_keep->password_is_set = 1; - #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_volume->read_write_lock, @@ -3847,15 +3996,7 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } /* Sets an UTF-16 formatted password @@ -3870,6 +4011,7 @@ { libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_set_utf16_password"; + int result = 1; if( volume == NULL ) { @@ -3895,17 +4037,6 @@ return( -1 ); } - if( internal_volume->file_io_handle != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid volume - file IO handle already set.", - function ); - - return( -1 ); - } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_volume->read_write_lock, @@ -3935,10 +4066,12 @@ "%s: unable to set password hash.", function ); - goto on_error; + result = -1; + } + else + { + internal_volume->password_keep->password_is_set = 1; } - internal_volume->password_keep->password_is_set = 1; - #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_volume->read_write_lock, @@ -3954,15 +4087,7 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } /* Sets an UTF-8 formatted recovery password @@ -3977,6 +4102,7 @@ { libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_set_utf8_recovery_password"; + int result = 1; if( volume == NULL ) { @@ -4002,17 +4128,6 @@ return( -1 ); } - if( internal_volume->file_io_handle != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid volume - file IO handle already set.", - function ); - - return( -1 ); - } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_volume->read_write_lock, @@ -4042,10 +4157,12 @@ "%s: unable to set recovery password hash.", function ); - goto on_error; + result = -1; + } + else + { + internal_volume->password_keep->recovery_password_is_set = 1; } - internal_volume->password_keep->recovery_password_is_set = 1; - #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_volume->read_write_lock, @@ -4061,15 +4178,7 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } /* Sets an UTF-16 formatted recovery password @@ -4084,6 +4193,7 @@ { libbde_internal_volume_t *internal_volume = NULL; static char *function = "libbde_volume_set_utf16_recovery_password"; + int result = 1; if( volume == NULL ) { @@ -4109,17 +4219,6 @@ return( -1 ); } - if( internal_volume->file_io_handle != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid volume - file IO handle already set.", - function ); - - return( -1 ); - } #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_grab_for_write( internal_volume->read_write_lock, @@ -4149,10 +4248,12 @@ "%s: unable to set recovery password hash.", function ); - goto on_error; + result = -1; + } + else + { + internal_volume->password_keep->recovery_password_is_set = 1; } - internal_volume->password_keep->recovery_password_is_set = 1; - #if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) if( libcthreads_read_write_lock_release_for_write( internal_volume->read_write_lock, @@ -4168,15 +4269,7 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_LIBBDE_MULTI_THREAD_SUPPORT ) - libcthreads_read_write_lock_release_for_write( - internal_volume->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } /* Sets the startup key from a .BEK file @@ -4404,14 +4497,11 @@ libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { - bde_metadata_header_v1_t file_header; - libbde_internal_volume_t *internal_volume = NULL; libbde_metadata_t *external_key_metadata = NULL; - uint8_t *metadata_entries_data = NULL; - static char *function = "libbde_volume_read_startup_key_wide"; - ssize_t read_count = 0; - uint32_t metadata_size = 0; + libbde_metadata_header_t *header = NULL; + static char *function = "libbde_volume_read_startup_key_file_io_handle"; + uint32_t entries_data_size = 0; int file_io_handle_is_open = 0; if( volume == NULL ) @@ -4427,17 +4517,6 @@ } internal_volume = (libbde_internal_volume_t *) volume; - if( internal_volume->io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid volume - missing IO handle.", - function ); - - return( -1 ); - } if( internal_volume->file_io_handle != NULL ) { libcerror_error_set( @@ -4503,21 +4582,6 @@ goto on_error; } } - if( libbfio_handle_seek_offset( - file_io_handle, - 0, - SEEK_SET, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek file header offset: 0.", - function ); - - goto on_error; - } if( libbde_metadata_initialize( &external_key_metadata, error ) != 1 ) @@ -4538,94 +4602,86 @@ "Reading BitLocker External Key (BEK) metadata:\n" ); } #endif - read_count = libbfio_handle_read_buffer( - file_io_handle, - (uint8_t *) &file_header, - sizeof( bde_metadata_header_v1_t ), - error ); - - if( read_count != sizeof( bde_metadata_header_v1_t ) ) + if( libbde_metadata_header_initialize( + &header, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read file header.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create metadata header.", function ); goto on_error; } - read_count = libbde_metadata_read_header( - external_key_metadata, - (uint8_t *) &file_header, - sizeof( bde_metadata_header_v1_t ), - &metadata_size, - error ); - - if( read_count == -1 ) + if( libbde_metadata_header_read_file_io_handle( + header, + file_io_handle, + 0, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read external key metadata header.", + "%s: unable to read metadata header at offset: 0 (0x00000000).", function ); goto on_error; } - if( metadata_size < sizeof( bde_metadata_header_v1_t ) ) + if( memory_copy( + external_key_metadata->volume_identifier, + header->volume_identifier, + 16 ) == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: metadata size value out of bounds.", + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy volume identifier.", function ); goto on_error; } - metadata_size -= sizeof( bde_metadata_header_v1_t ); + external_key_metadata->encryption_method = header->encryption_method; + external_key_metadata->creation_time = header->creation_time; - metadata_entries_data = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * metadata_size ); + entries_data_size = header->metadata_size; - if( metadata_entries_data == NULL ) + if( entries_data_size < sizeof( bde_metadata_header_v1_t ) ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to metadata entries data.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: metadata size value out of bounds.", function ); goto on_error; } - read_count = libbfio_handle_read_buffer( - file_io_handle, - metadata_entries_data, - (size_t) metadata_size, - error ); + entries_data_size -= sizeof( bde_metadata_header_v1_t ); - if( read_count != (ssize_t) metadata_size ) + if( libbde_metadata_header_free( + &header, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read metadata entries data.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free metadata header.", function ); goto on_error; } - read_count = libbde_metadata_read_entries( - external_key_metadata, - metadata_entries_data, - (size_t) metadata_size, - NULL, - 0, - error ); - - if( read_count == -1 ) + if( libbde_metadata_read_entries_file_io_handle( + external_key_metadata, + file_io_handle, + (size_t) entries_data_size, + NULL, + 0, + error ) != 1 ) { libcerror_error_set( error, @@ -4636,11 +4692,6 @@ goto on_error; } - memory_free( - metadata_entries_data ); - - metadata_entries_data = NULL; - if( file_io_handle_is_open == 0 ) { if( libbfio_handle_close( @@ -4692,10 +4743,11 @@ return( 1 ); on_error: - if( metadata_entries_data != NULL ) + if( header != NULL ) { - memory_free( - metadata_entries_data ); + libbde_metadata_header_free( + &header, + NULL ); } if( external_key_metadata != NULL ) { diff -Nru libbde-20190102/libbde/libbde_volume.h libbde-20240223/libbde/libbde_volume.h --- libbde-20190102/libbde/libbde_volume.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/libbde/libbde_volume.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Volume functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_INTERNAL_VOLUME_H ) @@ -25,16 +25,17 @@ #include #include +#include "libbde_encryption_context.h" #include "libbde_extern.h" #include "libbde_io_handle.h" #include "libbde_libbfio.h" #include "libbde_libcerror.h" #include "libbde_libcthreads.h" -#include "libbde_libfcache.h" -#include "libbde_libfdata.h" #include "libbde_metadata.h" #include "libbde_password_keep.h" +#include "libbde_sector_data_vector.h" #include "libbde_types.h" +#include "libbde_volume_header.h" #if defined( __cplusplus ) extern "C" { @@ -52,6 +53,10 @@ */ uint16_t encryption_method; + /* The volume header + */ + libbde_volume_header_t *volume_header; + /* The metadata at the first metadata offset */ libbde_metadata_t *primary_metadata; @@ -68,13 +73,13 @@ */ libbde_metadata_t *external_key_metadata; - /* The sectors vector + /* The encryption context */ - libfdata_vector_t *sectors_vector; + libbde_encryption_context_t *encryption_context; - /* The sectors cache + /* The sector data vector */ - libfcache_cache_t *sectors_cache; + libbde_sector_data_vector_t *sector_data_vector; /* The file IO handle */ @@ -92,6 +97,26 @@ */ uint8_t file_io_handle_opened_in_library; + /* External provided full volume encryption key + */ + uint8_t full_volume_encryption_key[ 64 ]; + + /* Size of the external provided full volume encryption key + */ + size_t full_volume_encryption_key_size; + + /* External provided tweak key + */ + uint8_t tweak_key[ 32 ]; + + /* Size of the tweak key + */ + size_t tweak_key_size; + + /* Value to indicate the keys are set + */ + uint8_t keys_are_set; + /* The password keep */ libbde_password_keep_t *password_keep; @@ -152,12 +177,16 @@ libbde_volume_t *volume, libcerror_error_t **error ); -int libbde_volume_open_read( +int libbde_internal_volume_open_read( libbde_internal_volume_t *internal_volume, libbfio_handle_t *file_io_handle, libcerror_error_t **error ); -int libbde_volume_open_read_keys_from_metadata( +int libbde_internal_volume_open_read_keys( + libbde_internal_volume_t *internal_volume, + libcerror_error_t **error ); + +int libbde_internal_volume_open_read_keys_from_metadata( libbde_internal_volume_t *internal_volume, libbde_metadata_t *metadata, libcerror_error_t **error ); @@ -167,6 +196,16 @@ libbde_volume_t *volume, libcerror_error_t **error ); +int libbde_internal_volume_unlock( + libbde_internal_volume_t *internal_volume, + libbfio_handle_t *file_io_handle, + libcerror_error_t **error ); + +LIBBDE_EXTERN \ +int libbde_volume_unlock( + libbde_volume_t *volume, + libcerror_error_t **error ); + ssize_t libbde_internal_volume_read_buffer_from_file_io_handle( libbde_internal_volume_t *internal_volume, libbfio_handle_t *file_io_handle, @@ -189,25 +228,6 @@ off64_t offset, libcerror_error_t **error ); -#ifdef TODO_WRITE_SUPPORT - -LIBBDE_EXTERN \ -ssize_t libbde_volume_write_buffer( - libbde_volume_t *volume, - void *buffer, - size_t buffer_size, - libcerror_error_t **error ); - -LIBBDE_EXTERN \ -ssize_t libbde_volume_write_buffer_at_offset( - libbde_volume_t *volume, - const void *buffer, - size_t buffer_size, - off64_t offset, - libcerror_error_t **error ); - -#endif /* TODO_WRITE_SUPPORT */ - off64_t libbde_internal_volume_seek_offset( libbde_internal_volume_t *internal_volume, off64_t offset, @@ -242,8 +262,8 @@ LIBBDE_EXTERN \ int libbde_volume_get_volume_identifier( libbde_volume_t *volume, - uint8_t *volume_identifier, - size_t size, + uint8_t *guid_data, + size_t guid_data_size, libcerror_error_t **error ); LIBBDE_EXTERN \ @@ -285,6 +305,13 @@ libcerror_error_t **error ); LIBBDE_EXTERN \ +int libbde_volume_get_key_protector_by_index( + libbde_volume_t *volume, + int key_protector_index, + libbde_key_protector_t **key_protector, + libcerror_error_t **error ); + +LIBBDE_EXTERN \ int libbde_volume_get_key_protector( libbde_volume_t *volume, int key_protector_index, diff -Nru libbde-20190102/libbde/libbde_volume_header.c libbde-20240223/libbde/libbde_volume_header.c --- libbde-20190102/libbde/libbde_volume_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_volume_header.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,935 @@ +/* + * The BDE volume header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include "libbde_debug.h" +#include "libbde_definitions.h" +#include "libbde_libbfio.h" +#include "libbde_libcerror.h" +#include "libbde_libcnotify.h" +#include "libbde_libfguid.h" +#include "libbde_volume_header.h" + +#include "bde_volume.h" + +const uint8_t bde_boot_entry_point_vista[ 3 ] = { + 0xeb, 0x52, 0x90 }; + +const uint8_t bde_boot_entry_point_windows7[ 3 ] = { + 0xeb, 0x58, 0x90 }; + +const uint8_t bde_identifier[ 16 ] = { + 0x3b, 0xd6, 0x67, 0x49, 0x29, 0x2e, 0xd8, 0x4a, 0x83, 0x99, 0xf6, 0xa3, 0x39, 0xe3, 0xd0, 0x01 }; + +const uint8_t bde_identifier_used_disk_space_only[ 16 ] = { + 0x3b, 0x4d, 0xa8, 0x92, 0x80, 0xdd, 0x0e, 0x4d, 0x9e, 0x4e, 0xb1, 0xe3, 0x28, 0x4e, 0xae, 0xd8 }; + +const char *bde_signature = "-FVE-FS-"; + +/* Creates a volume header + * Make sure the value volume_header is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libbde_volume_header_initialize( + libbde_volume_header_t **volume_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_volume_header_initialize"; + + if( volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume header.", + function ); + + return( -1 ); + } + if( *volume_header != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid volume header value already set.", + function ); + + return( -1 ); + } + *volume_header = memory_allocate_structure( + libbde_volume_header_t ); + + if( *volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create volume header.", + function ); + + goto on_error; + } + if( memory_set( + *volume_header, + 0, + sizeof( libbde_volume_header_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear volume header.", + function ); + + goto on_error; + } + return( 1 ); + +on_error: + if( *volume_header != NULL ) + { + memory_free( + *volume_header ); + + *volume_header = NULL; + } + return( -1 ); +} + +/* Frees a volume header + * Returns 1 if successful or -1 on error + */ +int libbde_volume_header_free( + libbde_volume_header_t **volume_header, + libcerror_error_t **error ) +{ + static char *function = "libbde_volume_header_free"; + + if( volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume header.", + function ); + + return( -1 ); + } + if( *volume_header != NULL ) + { + memory_free( + *volume_header ); + + *volume_header = NULL; + } + return( 1 ); +} + +/* Reads the volume header + * Returns 1 if successful or -1 on error + */ +int libbde_volume_header_read_data( + libbde_volume_header_t *volume_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ) +{ + static char *function = "libbde_volume_header_read_data"; + uint64_t safe_first_metadata_offset = 0; + uint64_t safe_second_metadata_offset = 0; + uint64_t safe_third_metadata_offset = 0; + uint64_t total_number_of_sectors = 0; + uint32_t cluster_block_size = 0; + +#if defined( HAVE_DEBUG_OUTPUT ) + uint64_t value_64bit = 0; + uint32_t value_32bit = 0; + uint16_t value_16bit = 0; +#endif + + if( volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume header.", + function ); + + return( -1 ); + } + if( data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid data.", + function ); + + return( -1 ); + } + if( ( data_size < 512 ) + || ( data_size > (size_t) SSIZE_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid data size value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: volume header data:\n", + function ); + libcnotify_print_data( + data, + 512, + LIBCNOTIFY_PRINT_DATA_FLAG_GROUP_DATA ); + } +#endif + if( memory_compare( + data, + bde_boot_entry_point_vista, + 3 ) == 0 ) + { + volume_header->version = LIBBDE_VERSION_WINDOWS_VISTA; + } + else if( memory_compare( + data, + bde_boot_entry_point_windows7, + 3 ) == 0 ) + { + if( memory_compare( + ( (bde_volume_header_windows_7_t *) data )->identifier, + bde_identifier, + 16 ) == 0 ) + { + volume_header->version = LIBBDE_VERSION_WINDOWS_7; + } +#if defined( HAVE_DEBUG_OUTPUT ) + else if( memory_compare( + ( (bde_volume_header_windows_7_t *) data )->identifier, + bde_identifier_used_disk_space_only, + 16 ) == 0 ) + { + volume_header->version = LIBBDE_VERSION_WINDOWS_7; + } +#endif + else if( memory_compare( + ( (bde_volume_header_to_go_t *) data )->identifier, + bde_identifier, + 16 ) == 0 ) + { + volume_header->version = LIBBDE_VERSION_TO_GO; + } + else + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported identifier.", + function ); + + return( -1 ); + } + } + else + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported volume boot entry point.", + function ); + + return( -1 ); + } + if( ( volume_header->version == LIBBDE_VERSION_WINDOWS_VISTA ) + || ( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) ) + { + if( memory_compare( + &( data[ 3 ] ), + bde_signature, + 8 ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: invalid volume signature.", + function ); + + return( -1 ); + } + } + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->bytes_per_sector, + volume_header->bytes_per_sector ); + + volume_header->sectors_per_cluster_block = ( (bde_volume_header_windows_vista_t *) data )->sectors_per_cluster_block; + + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->total_number_of_sectors_16bit, + total_number_of_sectors ); + + if( total_number_of_sectors == 0 ) + { + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->total_number_of_sectors_32bit, + total_number_of_sectors ); + } + if( volume_header->version == LIBBDE_VERSION_WINDOWS_VISTA ) + { + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->first_metadata_cluster_block_number, + safe_first_metadata_offset ); + + if( total_number_of_sectors == 0 ) + { + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->total_number_of_sectors_64bit, + total_number_of_sectors ); + } + } + else if( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) + { + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_7_t *) data )->first_metadata_offset, + safe_first_metadata_offset ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_7_t *) data )->second_metadata_offset, + safe_second_metadata_offset ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_7_t *) data )->third_metadata_offset, + safe_third_metadata_offset ); + } + else if( volume_header->version == LIBBDE_VERSION_TO_GO ) + { + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_to_go_t *) data )->first_metadata_offset, + safe_first_metadata_offset ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_to_go_t *) data )->second_metadata_offset, + safe_second_metadata_offset ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_to_go_t *) data )->third_metadata_offset, + safe_third_metadata_offset ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: boot entry point:\n", + function ); + libcnotify_print_data( + data, + 3, + 0 ); + + libcnotify_printf( + "%s: signature\t\t\t\t: %c%c%c%c%c%c%c%c\n", + function, + data[ 3 ], + data[ 4 ], + data[ 5 ], + data[ 6 ], + data[ 7 ], + data[ 8 ], + data[ 9 ], + data[ 10 ] ); + + libcnotify_printf( + "%s: bytes per sector\t\t\t: %" PRIu16 "\n", + function, + volume_header->bytes_per_sector ); + + libcnotify_printf( + "%s: sectors per cluster block\t\t: %" PRIu8 "\n", + function, + volume_header->sectors_per_cluster_block ); + + libcnotify_printf( + "%s: unknown1\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_windows_vista_t *) data )->unknown1, + 5, + 0 ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->total_number_of_sectors_16bit, + value_16bit ); + libcnotify_printf( + "%s: total number of sectors (16-bit)\t: %" PRIu16 "\n", + function, + value_16bit ); + + libcnotify_printf( + "%s: media descriptor\t\t\t: 0x%02" PRIx8 "\n", + function, + ( (bde_volume_header_windows_vista_t *) data )->media_descriptor ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->unknown2, + value_16bit ); + libcnotify_printf( + "%s: unknown2\t\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->sectors_per_track, + value_16bit ); + libcnotify_printf( + "%s: sectors per track\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->number_of_heads, + value_16bit ); + libcnotify_printf( + "%s: number of heads\t\t\t\t: %" PRIu16 "\n", + function, + value_16bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->number_of_hidden_sectors, + value_32bit ); + libcnotify_printf( + "%s: number of hidden sectors\t\t: %" PRIu32 "\n", + function, + value_32bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->total_number_of_sectors_32bit, + value_32bit ); + libcnotify_printf( + "%s: total number of sectors (32-bit)\t: %" PRIu32 "\n", + function, + value_32bit ); + + if( volume_header->version == LIBBDE_VERSION_WINDOWS_VISTA ) + { + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->unknown4, + value_32bit ); + libcnotify_printf( + "%s: unknown4\t\t\t\t: 0x%08" PRIx32 " (%" PRIu32 ")\n", + function, + value_32bit, + value_32bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->total_number_of_sectors_64bit, + value_64bit ); + libcnotify_printf( + "%s: total number of sectors (64-bit)\t: %" PRIu64 "\n", + function, + value_64bit ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->mft_cluster_block_number, + value_64bit ); + libcnotify_printf( + "%s: MFT cluster block number\t\t: %" PRIu64 "\n", + function, + value_64bit ); + + libcnotify_printf( + "%s: first metadata cluster block\t: 0x%08" PRIx64 "\n", + function, + safe_first_metadata_offset ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->mft_entry_size, + value_32bit ); + libcnotify_printf( + "%s: MFT entry size\t\t\t: %" PRIu32 "\n", + function, + value_32bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->index_entry_size, + value_32bit ); + libcnotify_printf( + "%s: index entry size\t\t\t: %" PRIu32 "\n", + function, + value_32bit ); + + byte_stream_copy_to_uint64_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->volume_serial_number, + value_64bit ); + libcnotify_printf( + "%s: volume serial number\t\t\t: 0x%08" PRIx64 "\n", + function, + value_64bit ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->checksum, + value_32bit ); + libcnotify_printf( + "%s: checksum\t\t\t\t: 0x%08" PRIx32 "\n", + function, + value_32bit ); + + libcnotify_printf( + "%s: bootcode\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_windows_vista_t *) data )->bootcode, + 426, + 0 ); + } + else if( ( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) + || ( volume_header->version == LIBBDE_VERSION_TO_GO ) ) + { + libcnotify_printf( + "%s: unknown4:\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_windows_7_t *) data )->unknown4, + 31, + 0 ); + + byte_stream_copy_to_uint32_little_endian( + &( ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 0 ] ), + value_32bit ); + libcnotify_printf( + "%s: unknown4a\t\t\t\t: 0x%08" PRIx32 " (%" PRIu32 ")\n", + function, + value_32bit, + value_32bit ); + + byte_stream_copy_to_uint64_little_endian( + &( ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 4 ] ), + value_64bit ); + libcnotify_printf( + "%s: unknown4b\t\t\t\t: 0x%08" PRIx64 " (%" PRIu64 ")\n", + function, + value_64bit, + value_64bit ); + + byte_stream_copy_to_uint16_little_endian( + &( ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 12 ] ), + value_16bit ); + libcnotify_printf( + "%s: unknown4c\t\t\t\t: 0x%04" PRIx16 " (%" PRIu16 ")\n", + function, + value_16bit, + value_16bit ); + + byte_stream_copy_to_uint16_little_endian( + &( ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 14 ] ), + value_16bit ); + libcnotify_printf( + "%s: unknown4d\t\t\t\t: 0x%04" PRIx16 " (%" PRIu16 ")\n", + function, + value_16bit, + value_16bit ); + + byte_stream_copy_to_uint64_little_endian( + &( ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 16 ] ), + value_64bit ); + libcnotify_printf( + "%s: unknown4e\t\t\t\t: 0x%08" PRIx64 " (%" PRIu64 ")\n", + function, + value_64bit, + value_64bit ); + + byte_stream_copy_to_uint32_little_endian( + &( ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 24 ] ), + value_32bit ); + libcnotify_printf( + "%s: unknown4f\t\t\t\t: 0x%08" PRIx32 " (%" PRIu32 ")\n", + function, + value_32bit, + value_32bit ); + + libcnotify_printf( + "%s: drive physical number\t\t\t: 0x%02" PRIx8 "\n", + function, + ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 28 ] ); + + libcnotify_printf( + "%s: unknown4g\t\t\t\t: 0x%02" PRIx8 "\n", + function, + ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 29 ] ); + + libcnotify_printf( + "%s: extended boot signature\t\t\t: 0x%02" PRIx8 "\n", + function, + ( ( (bde_volume_header_windows_7_t *) data )->unknown4 )[ 30 ] ); + + libcnotify_printf( + "\n" ); + + byte_stream_copy_to_uint32_little_endian( + ( (bde_volume_header_windows_7_t *) data )->volume_serial_number, + value_32bit ); + libcnotify_printf( + "%s: volume serial number\t\t\t: 0x%08" PRIx32 "\n", + function, + value_32bit ); + + libcnotify_printf( + "%s: volume label\t\t\t\t: %c%c%c%c%c%c%c%c%c%c%c\n", + function, + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 0 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 1 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 2 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 3 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 4 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 5 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 6 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 7 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 8 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 9 ], + ( (bde_volume_header_windows_7_t *) data )->volume_label[ 10 ] ); + + libcnotify_printf( + "%s: file system signature\t\t\t: %c%c%c%c%c%c%c%c\n", + function, + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 0 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 1 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 2 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 3 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 4 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 5 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 6 ], + ( (bde_volume_header_windows_7_t *) data )->file_system_signature[ 7 ] ); + } + if( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) + { + libcnotify_printf( + "%s: bootcode\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_windows_7_t *) data )->bootcode, + 47, + 0 ); + + if( libbde_debug_print_guid_value( + function, + "identifier\t\t\t\t", + ( (bde_volume_header_windows_7_t *) data )->identifier, + 16, + LIBFGUID_ENDIAN_LITTLE, + LIBFGUID_STRING_FORMAT_FLAG_USE_LOWER_CASE, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, + "%s: unable to print GUID value.", + function ); + + return( -1 ); + } + } + else if( volume_header->version == LIBBDE_VERSION_TO_GO ) + { + libcnotify_printf( + "%s: bootcode\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_to_go_t *) data )->bootcode, + 335, + 0 ); + + if( libbde_debug_print_guid_value( + function, + "identifier\t\t\t\t", + ( (bde_volume_header_to_go_t *) data )->identifier, + 16, + LIBFGUID_ENDIAN_LITTLE, + LIBFGUID_STRING_FORMAT_FLAG_USE_LOWER_CASE, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_PRINT_FAILED, + "%s: unable to print GUID value.", + function ); + + return( -1 ); + } + } + if( ( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) + || ( volume_header->version == LIBBDE_VERSION_TO_GO ) ) + { + libcnotify_printf( + "%s: first metadata offset\t\t\t: 0x%08" PRIx64 "\n", + function, + safe_first_metadata_offset ); + + libcnotify_printf( + "%s: second metadata offset\t\t\t: 0x%08" PRIx64 "\n", + function, + safe_second_metadata_offset ); + + libcnotify_printf( + "%s: third metadata offset\t\t\t: 0x%08" PRIx64 "\n", + function, + safe_third_metadata_offset ); + } + if( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) + { + libcnotify_printf( + "%s: unknown5:\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_windows_7_t *) data )->unknown5, + 310, + 0 ); + } + else if( volume_header->version == LIBBDE_VERSION_TO_GO ) + { + libcnotify_printf( + "%s: unknown5:\n", + function ); + libcnotify_print_data( + ( (bde_volume_header_to_go_t *) data )->unknown5, + 46, + 0 ); + } + byte_stream_copy_to_uint16_little_endian( + ( (bde_volume_header_windows_vista_t *) data )->sector_signature, + value_16bit ); + libcnotify_printf( + "%s: sector signature\t\t\t: 0x%04" PRIx16 "\n", + function, + value_16bit ); + + libcnotify_printf( + "\n" ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + if( ( volume_header->bytes_per_sector != 512 ) + && ( volume_header->bytes_per_sector != 1024 ) + && ( volume_header->bytes_per_sector != 2048 ) + && ( volume_header->bytes_per_sector != 4096 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid bytes per sector value out of bounds.", + function ); + + return( -1 ); + } + if( total_number_of_sectors != 0 ) + { + if( total_number_of_sectors > ( (uint64_t) INT64_MAX / volume_header->bytes_per_sector ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid volume size value out of bounds.", + function ); + + return( -1 ); + } + volume_header->volume_size = total_number_of_sectors * volume_header->bytes_per_sector; + } + if( volume_header->version == LIBBDE_VERSION_WINDOWS_VISTA ) + { + if( volume_header->sectors_per_cluster_block == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid sectors per cluster block value out of bounds.", + function ); + + return( -1 ); + } + cluster_block_size = (uint32_t) volume_header->sectors_per_cluster_block * volume_header->bytes_per_sector; + + if( safe_first_metadata_offset > ( (uint64_t) INT64_MAX / cluster_block_size ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid first metadata offset value out of bounds.", + function ); + + return( -1 ); + } + volume_header->first_metadata_offset = (off64_t) ( safe_first_metadata_offset * cluster_block_size ); + volume_header->metadata_size = 16384; + } + else if( ( volume_header->version == LIBBDE_VERSION_WINDOWS_7 ) + || ( volume_header->version == LIBBDE_VERSION_TO_GO ) ) + { + if( safe_first_metadata_offset > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid first metadata offset value out of bounds.", + function ); + + return( -1 ); + } + if( safe_second_metadata_offset > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid second metadata offset value out of bounds.", + function ); + + return( -1 ); + } + if( safe_third_metadata_offset > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid third metadata offset value out of bounds.", + function ); + + return( -1 ); + } + volume_header->first_metadata_offset = (off64_t) safe_first_metadata_offset; + volume_header->second_metadata_offset = (off64_t) safe_second_metadata_offset; + volume_header->third_metadata_offset = (off64_t) safe_third_metadata_offset; + volume_header->metadata_size = 65536; + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: volume size\t\t\t\t: %" PRIu64 "\n", + function, + volume_header->volume_size ); + + libcnotify_printf( + "\n" ); + } +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ + + return( 1 ); +} + +/* Reads the volume header + * Returns 1 if successful or -1 on error + */ +int libbde_volume_header_read_file_io_handle( + libbde_volume_header_t *volume_header, + libbfio_handle_t *file_io_handle, + off64_t file_offset, + libcerror_error_t **error ) +{ + uint8_t volume_header_data[ 512 ]; + + static char *function = "libbde_volume_header_read_file_io_handle"; + ssize_t read_count = 0; + + if( volume_header == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid volume header.", + function ); + + return( -1 ); + } +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + libcnotify_printf( + "%s: reading volume header at offset: %" PRIi64 " (0x%08" PRIx64 ")\n", + function, + file_offset, + file_offset ); + } +#endif + read_count = libbfio_handle_read_buffer_at_offset( + file_io_handle, + (uint8_t *) &volume_header_data, + 512, + file_offset, + error ); + + if( read_count != (ssize_t) 512 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read volume header data at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + file_offset, + file_offset ); + + return( -1 ); + } + if( libbde_volume_header_read_data( + volume_header, + (uint8_t *) &volume_header_data, + 512, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read volume header data.", + function ); + + return( -1 ); + } + return( 1 ); +} + diff -Nru libbde-20190102/libbde/libbde_volume_header.h libbde-20240223/libbde/libbde_volume_header.h --- libbde-20190102/libbde/libbde_volume_header.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libbde/libbde_volume_header.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,97 @@ +/* + * The BDE volume header functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBBDE_VOLUME_HEADER_H ) +#define _LIBBDE_VOLUME_HEADER_H + +#include +#include + +#include "libbde_libbfio.h" +#include "libbde_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libbde_volume_header libbde_volume_header_t; + +struct libbde_volume_header +{ + /* The format version + */ + int version; + + /* The bytes per sector + */ + uint16_t bytes_per_sector; + + /* The sectors per cluster block + */ + uint8_t sectors_per_cluster_block; + + /* The first metadata offset + */ + off64_t first_metadata_offset; + + /* The second metadata offset + */ + off64_t second_metadata_offset; + + /* The third metadata offset + */ + off64_t third_metadata_offset; + + /* The metadata (block) size + */ + size64_t metadata_size; + + /* The volume size + */ + size64_t volume_size; +}; + +int libbde_volume_header_initialize( + libbde_volume_header_t **volume_header, + libcerror_error_t **error ); + +int libbde_volume_header_free( + libbde_volume_header_t **volume_header, + libcerror_error_t **error ); + +int libbde_volume_header_read_data( + libbde_volume_header_t *volume_header, + const uint8_t *data, + size_t data_size, + libcerror_error_t **error ); + +int libbde_volume_header_read_file_io_handle( + libbde_volume_header_t *volume_header, + libbfio_handle_t *file_io_handle, + off64_t file_offset, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBBDE_VOLUME_HEADER_H ) */ + diff -Nru libbde-20190102/libbde/libbde_volume_master_key.c libbde-20240223/libbde/libbde_volume_master_key.c --- libbde-20190102/libbde/libbde_volume_master_key.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/libbde/libbde_volume_master_key.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Volume Master Key (VMK) metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbde/libbde_volume_master_key.h libbde-20240223/libbde/libbde_volume_master_key.h --- libbde-20190102/libbde/libbde_volume_master_key.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/libbde/libbde_volume_master_key.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Volume Master Key (VMK) metadata entry functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBDE_VOLUME_MASTER_KEY_H ) diff -Nru libbde-20190102/libbde.pc.in libbde-20240223/libbde.pc.in --- libbde-20190102/libbde.pc.in 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/libbde.pc.in 2024-02-23 02:47:17.000000000 +0000 @@ -7,6 +7,6 @@ Description: Library to access the BitLocker Drive Encryption (BDE) format Version: @VERSION@ Libs: -L${libdir} -lbde -Libs.private: @ax_libbfio_pc_libs_private@ @ax_libcaes_pc_libs_private@ @ax_libcdata_pc_libs_private@ @ax_libcerror_pc_libs_private@ @ax_libcfile_pc_libs_private@ @ax_libclocale_pc_libs_private@ @ax_libcnotify_pc_libs_private@ @ax_libcpath_pc_libs_private@ @ax_libcrypto_pc_libs_private@ @ax_libcsplit_pc_libs_private@ @ax_libcthreads_pc_libs_private@ @ax_libfcache_pc_libs_private@ @ax_libfdata_pc_libs_private@ @ax_libfdatetime_pc_libs_private@ @ax_libfguid_pc_libs_private@ @ax_libfvalue_pc_libs_private@ @ax_libhmac_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ +Libs.private: @ax_libbfio_pc_libs_private@ @ax_libcaes_pc_libs_private@ @ax_libcdata_pc_libs_private@ @ax_libcerror_pc_libs_private@ @ax_libcfile_pc_libs_private@ @ax_libclocale_pc_libs_private@ @ax_libcnotify_pc_libs_private@ @ax_libcpath_pc_libs_private@ @ax_libcrypto_pc_libs_private@ @ax_libcsplit_pc_libs_private@ @ax_libcthreads_pc_libs_private@ @ax_libfcache_pc_libs_private@ @ax_libfdatetime_pc_libs_private@ @ax_libfguid_pc_libs_private@ @ax_libfvalue_pc_libs_private@ @ax_libhmac_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ Cflags: -I${includedir} diff -Nru libbde-20190102/libbde.spec libbde-20240223/libbde.spec --- libbde-20190102/libbde.spec 2019-01-02 15:58:07.000000000 +0000 +++ libbde-20240223/libbde.spec 2024-02-23 03:04:01.000000000 +0000 @@ -1,18 +1,25 @@ Name: libbde -Version: 20190102 +Version: 20240223 Release: 1 Summary: Library to access the BitLocker Drive Encryption (BDE) format Group: System Environment/Libraries -License: LGPL +License: LGPL-3.0-or-later Source: %{name}-%{version}.tar.gz URL: https://github.com/libyal/libbde -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: openssl -BuildRequires: gcc openssl-devel +Requires: openssl +BuildRequires: gcc openssl-devel %description -n libbde Library to access the BitLocker Drive Encryption (BDE) format +%package -n libbde-static +Summary: Library to access the BitLocker Drive Encryption (BDE) format +Group: Development/Libraries +Requires: libbde = %{version}-%{release} + +%description -n libbde-static +Static library version of libbde. + %package -n libbde-devel Summary: Header files and libraries for developing applications for libbde Group: Development/Libraries @@ -21,22 +28,11 @@ %description -n libbde-devel Header files and libraries for developing applications for libbde. -%package -n libbde-python2 -Obsoletes: libbde-python < %{version} -Provides: libbde-python = %{version} -Summary: Python 2 bindings for libbde -Group: System Environment/Libraries -Requires: libbde = %{version}-%{release} python2 -BuildRequires: python2-devel - -%description -n libbde-python2 -Python 2 bindings for libbde - %package -n libbde-python3 Summary: Python 3 bindings for libbde Group: System Environment/Libraries Requires: libbde = %{version}-%{release} python3 -BuildRequires: python3-devel +BuildRequires: python3-devel python3-setuptools %description -n libbde-python3 Python 3 bindings for libbde @@ -54,7 +50,7 @@ %setup -q %build -%configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python2 --enable-python3 +%configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python make %{?_smp_mflags} %install @@ -69,46 +65,36 @@ %postun -p /sbin/ldconfig %files -n libbde -%defattr(644,root,root,755) -%license COPYING +%license COPYING COPYING.LESSER %doc AUTHORS README -%attr(755,root,root) %{_libdir}/*.so.* +%{_libdir}/*.so.* -%files -n libbde-devel -%defattr(644,root,root,755) -%license COPYING +%files -n libbde-static +%license COPYING COPYING.LESSER %doc AUTHORS README %{_libdir}/*.a -%{_libdir}/*.la + +%files -n libbde-devel +%license COPYING COPYING.LESSER +%doc AUTHORS README %{_libdir}/*.so %{_libdir}/pkgconfig/libbde.pc %{_includedir}/* %{_mandir}/man3/* -%files -n libbde-python2 -%defattr(644,root,root,755) -%license COPYING -%doc AUTHORS README -%{_libdir}/python2*/site-packages/*.a -%{_libdir}/python2*/site-packages/*.la -%{_libdir}/python2*/site-packages/*.so - %files -n libbde-python3 -%defattr(644,root,root,755) -%license COPYING +%license COPYING COPYING.LESSER %doc AUTHORS README %{_libdir}/python3*/site-packages/*.a -%{_libdir}/python3*/site-packages/*.la %{_libdir}/python3*/site-packages/*.so %files -n libbde-tools -%defattr(644,root,root,755) -%license COPYING +%license COPYING COPYING.LESSER %doc AUTHORS README -%attr(755,root,root) %{_bindir}/* +%{_bindir}/* %{_mandir}/man1/* %changelog -* Wed Jan 2 2019 Joachim Metz 20190102-1 +* Fri Feb 23 2024 Joachim Metz 20240223-1 - Auto-generated diff -Nru libbde-20190102/libbde.spec.in libbde-20240223/libbde.spec.in --- libbde-20190102/libbde.spec.in 2019-01-02 14:14:03.000000000 +0000 +++ libbde-20240223/libbde.spec.in 2024-02-23 02:47:17.000000000 +0000 @@ -3,16 +3,23 @@ Release: 1 Summary: Library to access the BitLocker Drive Encryption (BDE) format Group: System Environment/Libraries -License: LGPL +License: LGPL-3.0-or-later Source: %{name}-%{version}.tar.gz URL: https://github.com/libyal/libbde -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -@libbde_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcaes_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfdata_spec_requires@ @ax_libfdatetime_spec_requires@ @ax_libfguid_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libuna_spec_requires@ -BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcaes_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfdata_spec_build_requires@ @ax_libfdatetime_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libuna_spec_build_requires@ +@libbde_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcaes_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfdatetime_spec_requires@ @ax_libfguid_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libuna_spec_requires@ +BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcaes_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfdatetime_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libuna_spec_build_requires@ %description -n libbde Library to access the BitLocker Drive Encryption (BDE) format +%package -n libbde-static +Summary: Library to access the BitLocker Drive Encryption (BDE) format +Group: Development/Libraries +Requires: libbde = %{version}-%{release} + +%description -n libbde-static +Static library version of libbde. + %package -n libbde-devel Summary: Header files and libraries for developing applications for libbde Group: Development/Libraries @@ -21,22 +28,11 @@ %description -n libbde-devel Header files and libraries for developing applications for libbde. -%package -n libbde-python2 -Obsoletes: libbde-python < %{version} -Provides: libbde-python = %{version} -Summary: Python 2 bindings for libbde -Group: System Environment/Libraries -Requires: libbde = %{version}-%{release} python2 -BuildRequires: python2-devel - -%description -n libbde-python2 -Python 2 bindings for libbde - %package -n libbde-python3 Summary: Python 3 bindings for libbde Group: System Environment/Libraries Requires: libbde = %{version}-%{release} python3 -BuildRequires: python3-devel +BuildRequires: python3-devel python3-setuptools %description -n libbde-python3 Python 3 bindings for libbde @@ -54,7 +50,7 @@ %setup -q %build -%configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python2 --enable-python3 +%configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir} --enable-python make %{?_smp_mflags} %install @@ -69,43 +65,33 @@ %postun -p /sbin/ldconfig %files -n libbde -%defattr(644,root,root,755) -%license COPYING +%license COPYING COPYING.LESSER %doc AUTHORS README -%attr(755,root,root) %{_libdir}/*.so.* +%{_libdir}/*.so.* -%files -n libbde-devel -%defattr(644,root,root,755) -%license COPYING +%files -n libbde-static +%license COPYING COPYING.LESSER %doc AUTHORS README %{_libdir}/*.a -%{_libdir}/*.la + +%files -n libbde-devel +%license COPYING COPYING.LESSER +%doc AUTHORS README %{_libdir}/*.so %{_libdir}/pkgconfig/libbde.pc %{_includedir}/* %{_mandir}/man3/* -%files -n libbde-python2 -%defattr(644,root,root,755) -%license COPYING -%doc AUTHORS README -%{_libdir}/python2*/site-packages/*.a -%{_libdir}/python2*/site-packages/*.la -%{_libdir}/python2*/site-packages/*.so - %files -n libbde-python3 -%defattr(644,root,root,755) -%license COPYING +%license COPYING COPYING.LESSER %doc AUTHORS README %{_libdir}/python3*/site-packages/*.a -%{_libdir}/python3*/site-packages/*.la %{_libdir}/python3*/site-packages/*.so %files -n libbde-tools -%defattr(644,root,root,755) -%license COPYING +%license COPYING COPYING.LESSER %doc AUTHORS README -%attr(755,root,root) %{_bindir}/* +%{_bindir}/* %{_mandir}/man1/* %changelog diff -Nru libbde-20190102/libbfio/Makefile.in libbde-20240223/libbfio/Makefile.in --- libbde-20190102/libbfio/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libbfio/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libbfio ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -203,6 +203,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -220,8 +221,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -238,6 +237,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -249,8 +254,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -268,7 +275,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -286,7 +292,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -340,8 +345,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -360,6 +363,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -370,8 +374,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -394,26 +398,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -422,7 +406,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -441,6 +424,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -483,9 +467,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -554,8 +535,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -578,11 +557,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -734,6 +710,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -786,7 +764,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -932,6 +909,12 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -948,7 +931,8 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint splint-am splint-local tags \ + tags-am uninstall uninstall-am .PRECIOUS: Makefile diff -Nru libbde-20190102/libbfio/libbfio_codepage.h libbde-20240223/libbfio/libbfio_codepage.h --- libbde-20190102/libbfio/libbfio_codepage.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_codepage.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Codepage functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_INTERNAL_CODEPAGE_H ) @@ -29,14 +29,14 @@ extern "C" { #endif -#if !defined( HAVE_LOCAL_LIBBFIO ) - -#include - /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio * The definitions in are copied here * for local use of libbfio */ +#if !defined( HAVE_LOCAL_LIBBFIO ) + +#include + #else /* The codepage definitions diff -Nru libbde-20190102/libbfio/libbfio_definitions.h libbde-20240223/libbfio/libbfio_definitions.h --- libbde-20190102/libbfio/libbfio_definitions.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_definitions.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_INTERNAL_DEFINITIONS_H ) @@ -33,11 +33,11 @@ * for local use of libbfio */ #else -#define LIBBFIO_VERSION 20180910 +#define LIBBFIO_VERSION 20221025 /* The libbfio version string */ -#define LIBBFIO_VERSION_STRING "20180910" +#define LIBBFIO_VERSION_STRING "20221025" /* The library flags definitions */ diff -Nru libbde-20190102/libbfio/libbfio_error.c libbde-20240223/libbfio/libbfio_error.c --- libbde-20190102/libbfio/libbfio_error.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_error.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_error.h libbde-20240223/libbfio/libbfio_error.h --- libbde-20190102/libbfio/libbfio_error.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_error.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libbfio/libbfio_extern.h libbde-20240223/libbfio/libbfio_extern.h --- libbde-20190102/libbfio/libbfio_extern.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_extern.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBBFIO_EXTERN_VARIABLE extern +#else #define LIBBFIO_EXTERN_VARIABLE LIBBFIO_EXTERN +#endif #else #define LIBBFIO_EXTERN /* extern */ diff -Nru libbde-20190102/libbfio/libbfio_file.c libbde-20240223/libbfio/libbfio_file.c --- libbde-20190102/libbfio/libbfio_file.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_file.h libbde-20240223/libbfio/libbfio_file.h --- libbde-20190102/libbfio/libbfio_file.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_FILE_H ) diff -Nru libbde-20190102/libbfio/libbfio_file_io_handle.c libbde-20240223/libbfio/libbfio_file_io_handle.c --- libbde-20190102/libbfio/libbfio_file_io_handle.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_io_handle.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File IO handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -416,13 +416,14 @@ return( -1 ); } - if( name_length == 0 ) + if( ( name_length == 0 ) + || ( name_length > ( (size_t) SSIZE_MAX - 1 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, - "%s: invalid name length is zero.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid name length value out of bounds.", function ); return( -1 ); @@ -458,8 +459,8 @@ memory_free( file_io_handle->name ); - file_io_handle->name = NULL; - file_io_handle->name_size = 0; + file_io_handle->name = NULL; + file_io_handle->name_size = 0; } if( libbfio_system_string_size_from_narrow_string( name, @@ -476,13 +477,14 @@ goto on_error; } - if( file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) + if( ( file_io_handle->name_size == 0 ) + || ( file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid file IO handle - name size value exceeds maximum.", + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid file IO handle - name size value out of bounds.", function ); goto on_error; @@ -639,13 +641,25 @@ return( -1 ); } - if( name_length == 0 ) + if( name == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid name.", + function ); + + return( -1 ); + } + if( ( name_length == 0 ) + || ( name_length > ( (size_t) SSIZE_MAX - 1 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, - "%s: invalid name length is zero.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid name length value out of bounds.", function ); return( -1 ); @@ -681,8 +695,8 @@ memory_free( file_io_handle->name ); - file_io_handle->name = NULL; - file_io_handle->name_size = 0; + file_io_handle->name = NULL; + file_io_handle->name_size = 0; } if( libbfio_system_string_size_from_wide_string( name, @@ -699,13 +713,14 @@ goto on_error; } - if( file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) + if( ( file_io_handle->name_size == 0 ) + || ( file_io_handle->name_size > ( (size_t) SSIZE_MAX / sizeof( system_character_t ) ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid file IO handle - name size value exceeds maximum.", + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid file IO handle - name size value out of bounds.", function ); goto on_error; @@ -879,7 +894,7 @@ size_t size, libcerror_error_t **error ) { - static char *function = "libbfio_file_read_buffer"; + static char *function = "libbfio_file_io_handle_read_buffer"; ssize_t read_count = 0; if( file_io_handle == NULL ) diff -Nru libbde-20190102/libbfio/libbfio_file_io_handle.h libbde-20240223/libbfio/libbfio_file_io_handle.h --- libbde-20190102/libbfio/libbfio_file_io_handle.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_io_handle.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File IO handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_FILE_IO_HANDLE_H ) diff -Nru libbde-20190102/libbfio/libbfio_file_pool.c libbde-20240223/libbfio/libbfio_file_pool.c --- libbde-20190102/libbfio/libbfio_file_pool.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_pool.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File pool functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -32,6 +32,230 @@ #include "libbfio_pool.h" #include "libbfio_types.h" +/* Opens a handle in the pool + * Returns 1 if successful or -1 on error + */ +int libbfio_file_pool_open( + libbfio_pool_t *pool, + int entry, + const char *name, + int access_flags, + libcerror_error_t **error ) +{ + libbfio_handle_t *file_io_handle = NULL; + static char *function = "libbfio_file_pool_open"; + size_t name_length = 0; + + if( pool == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); + } + if( name == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid name.", + function ); + + return( -1 ); + } + if( libbfio_file_initialize( + &file_io_handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create file IO handle.", + function ); + + goto on_error; + } + name_length = narrow_string_length( + name ); + + if( libbfio_file_set_name( + file_io_handle, + name, + name_length + 1, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set name in file IO handle.", + function ); + + goto on_error; + } + if( libbfio_handle_open( + file_io_handle, + access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_OPEN_FAILED, + "%s: unable to open file IO handle.", + function ); + + goto on_error; + } + if( libbfio_pool_set_handle( + pool, + entry, + file_io_handle, + access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set file IO handle: %d in pool.", + function, + entry ); + + goto on_error; + } + return( 1 ); + +on_error: + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } + return( -1 ); +} + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +/* Opens a handle in the pool + * Returns 1 if successful or -1 on error + */ +int libbfio_file_pool_open_wide( + libbfio_pool_t *pool, + int entry, + const wchar_t *name, + int access_flags, + libcerror_error_t **error ) +{ + libbfio_handle_t *file_io_handle = NULL; + static char *function = "libbfio_file_pool_open_wide"; + size_t name_length = 0; + + if( pool == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); + } + if( name == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid name.", + function ); + + return( -1 ); + } + if( libbfio_file_initialize( + &file_io_handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create file IO handle.", + function ); + + goto on_error; + } + name_length = wide_string_length( + name ); + + if( libbfio_file_set_name_wide( + file_io_handle, + name, + name_length + 1, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set name in file IO handle.", + function ); + + goto on_error; + } + if( libbfio_handle_open( + file_io_handle, + access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_OPEN_FAILED, + "%s: unable to open file IO handle.", + function ); + + goto on_error; + } + if( libbfio_pool_set_handle( + pool, + entry, + file_io_handle, + access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set file IO handle: %d in pool.", + function, + entry ); + + goto on_error; + } + return( 1 ); + +on_error: + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } + return( -1 ); +} + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + /* Appends file handles to the pool for the corresponding filenames * Returns 1 if successful or -1 on error */ diff -Nru libbde-20190102/libbfio/libbfio_file_pool.h libbde-20240223/libbfio/libbfio_file_pool.h --- libbde-20190102/libbfio/libbfio_file_pool.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_pool.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File pool functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_FILE_POOL_H ) @@ -34,6 +34,26 @@ #endif LIBBFIO_EXTERN \ +int libbfio_file_pool_open( + libbfio_pool_t *pool, + int entry, + const char *name, + int access_flags, + libcerror_error_t **error ); + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +LIBBFIO_EXTERN \ +int libbfio_file_pool_open_wide( + libbfio_pool_t *pool, + int entry, + const wchar_t *name, + int access_flags, + libcerror_error_t **error ); + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +LIBBFIO_EXTERN \ int libbfio_file_pool_append_handles_for_names( libbfio_pool_t *pool, char * const names[], diff -Nru libbde-20190102/libbfio/libbfio_file_range.c libbde-20240223/libbfio/libbfio_file_range.c --- libbde-20190102/libbfio/libbfio_file_range.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_range.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File range functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_file_range.h libbde-20240223/libbfio/libbfio_file_range.h --- libbde-20190102/libbfio/libbfio_file_range.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_range.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File range functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_FILE_RANGE_H ) diff -Nru libbde-20190102/libbfio/libbfio_file_range_io_handle.c libbde-20240223/libbfio/libbfio_file_range_io_handle.c --- libbde-20190102/libbfio/libbfio_file_range_io_handle.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_range_io_handle.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File range IO handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_file_range_io_handle.h libbde-20240223/libbfio/libbfio_file_range_io_handle.h --- libbde-20190102/libbfio/libbfio_file_range_io_handle.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_file_range_io_handle.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * File range IO handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_FILE_RANGE_IO_HANDLE_H ) diff -Nru libbde-20190102/libbfio/libbfio_handle.c libbde-20240223/libbfio/libbfio_handle.c --- libbde-20190102/libbfio/libbfio_handle.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_handle.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -132,7 +132,10 @@ "%s: unable to clear handle.", function ); - goto on_error; + memory_free( + internal_handle ); + + return( -1 ); } if( libcdata_range_list_initialize( &( internal_handle->offsets_read ), @@ -145,10 +148,7 @@ "%s: unable to create read offsets list.", function ); - memory_free( - internal_handle ); - - return( -1 ); + goto on_error; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_initialize( @@ -185,6 +185,13 @@ on_error: if( internal_handle != NULL ) { + if( internal_handle->offsets_read != NULL ) + { + libcdata_range_list_free( + &( internal_handle->offsets_read ), + NULL, + NULL ); + } memory_free( internal_handle ); } @@ -486,13 +493,18 @@ "%s: unable to release read/write lock for reading.", function ); - goto on_error; + libbfio_handle_free( + destination_handle, + NULL ); + + return( -1 ); } #endif return( 1 ); on_error: - if( destination_io_handle != NULL ) + if( ( destination_io_handle != NULL ) + && ( ( destination_flags & LIBBFIO_FLAG_IO_HANDLE_MANAGED ) != 0 ) ) { if( internal_source_handle->free_io_handle == NULL ) { @@ -964,21 +976,22 @@ return( -1 ); } -/* Reads a buffer from the handle +/* Reads data at the current offset into the buffer + * This function is not multi-thread safe acquire write lock before call * Returns the number of bytes read if successful, or -1 on error */ -ssize_t libbfio_handle_read_buffer( - libbfio_handle_t *handle, +ssize_t libbfio_internal_handle_read_buffer( + libbfio_internal_handle_t *internal_handle, uint8_t *buffer, size_t size, libcerror_error_t **error ) { - libbfio_internal_handle_t *internal_handle = NULL; - static char *function = "libbfio_handle_read_buffer"; - ssize_t read_count = 0; - int is_open = 0; + static char *function = "libbfio_internal_handle_read_buffer"; + ssize_t read_count = 0; + int is_open = 0; + int result = 0; - if( handle == NULL ) + if( internal_handle == NULL ) { libcerror_error_set( error, @@ -989,19 +1002,6 @@ return( -1 ); } - internal_handle = (libbfio_internal_handle_t *) handle; - - if( internal_handle->io_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid handle - missing IO handle.", - function ); - - return( -1 ); - } if( internal_handle->read == NULL ) { libcerror_error_set( @@ -1035,21 +1035,6 @@ return( -1 ); } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - if( libcthreads_read_write_lock_grab_for_write( - internal_handle->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif if( internal_handle->open_on_demand != 0 ) { if( internal_handle->is_open == NULL ) @@ -1061,7 +1046,7 @@ "%s: invalid handle - missing is open function.", function ); - goto on_error; + return( -1 ); } if( internal_handle->open == NULL ) { @@ -1072,7 +1057,7 @@ "%s: invalid handle - missing open function.", function ); - goto on_error; + return( -1 ); } if( internal_handle->seek_offset == NULL ) { @@ -1083,7 +1068,7 @@ "%s: invalid handle - missing seek offset function.", function ); - goto on_error; + return( -1 ); } is_open = internal_handle->is_open( internal_handle->io_handle, @@ -1098,7 +1083,7 @@ "%s: unable to determine if handle is open.", function ); - goto on_error; + return( -1 ); } else if( is_open == 0 ) { @@ -1114,7 +1099,7 @@ "%s: unable to open handle on demand.", function ); - goto on_error; + return( -1 ); } if( internal_handle->seek_offset( internal_handle->io_handle, @@ -1130,7 +1115,7 @@ function, internal_handle->current_offset ); - goto on_error; + return( -1 ); } } } @@ -1149,18 +1134,20 @@ "%s: unable to read from handle.", function ); - goto on_error; + return( -1 ); } if( internal_handle->track_offsets_read != 0 ) { - if( libcdata_range_list_insert_range( - internal_handle->offsets_read, - (uint64_t) internal_handle->current_offset, - (uint64_t) read_count, - NULL, - NULL, - NULL, - error ) != 1 ) + result = libcdata_range_list_insert_range( + internal_handle->offsets_read, + (uint64_t) internal_handle->current_offset, + (uint64_t) read_count, + NULL, + NULL, + NULL, + error ); + + if( result == -1 ) { libcerror_error_set( error, @@ -1169,7 +1156,7 @@ "%s: unable to insert offset range to offsets read table.", function ); - goto on_error; + return( -1 ); } } internal_handle->current_offset += (off64_t) read_count; @@ -1185,7 +1172,7 @@ "%s: invalid handle - missing close function.", function ); - goto on_error; + return( -1 ); } if( internal_handle->close( internal_handle->io_handle, @@ -1198,11 +1185,51 @@ "%s: unable to close handle on demand.", function ); - goto on_error; + return( -1 ); } } + return( read_count ); +} + +/* Reads data at the current offset into the buffer + * Returns the number of bytes read if successful, or -1 on error + */ +ssize_t libbfio_handle_read_buffer( + libbfio_handle_t *handle, + uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libbfio_internal_handle_t *internal_handle = NULL; + static char *function = "libbfio_handle_read_buffer"; + ssize_t read_count = 0; + + if( handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } + internal_handle = (libbfio_internal_handle_t *) handle; + + if( internal_handle->io_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid handle - missing IO handle.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - if( libcthreads_read_write_lock_release_for_write( + if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, error ) != 1 ) { @@ -1210,35 +1237,60 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", + "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif - return( read_count ); + read_count = libbfio_internal_handle_read_buffer( + internal_handle, + buffer, + size, + error ); -on_error: + if( read_count < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read buffer.", + function ); + + read_count = -1; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_handle->read_write_lock, - NULL ); + if( libcthreads_read_write_lock_release_for_write( + internal_handle->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); + + return( -1 ); + } #endif - return( -1 ); + return( read_count ); } -/* Writes a buffer to the handle - * Returns the number of bytes written if successful, or -1 on error +/* Reads data at a specific offset into the buffer + * Returns the number of bytes read if successful, or -1 on error */ -ssize_t libbfio_handle_write_buffer( +ssize_t libbfio_handle_read_buffer_at_offset( libbfio_handle_t *handle, - const uint8_t *buffer, + uint8_t *buffer, size_t size, + off64_t offset, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; - static char *function = "libbfio_handle_write_buffer"; - ssize_t write_count = 0; + static char *function = "libbfio_handle_read_buffer_at_offset"; + ssize_t read_count = 0; if( handle == NULL ) { @@ -1264,6 +1316,100 @@ return( -1 ); } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_grab_for_write( + internal_handle->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + + return( -1 ); + } +#endif + if( libbfio_internal_handle_seek_offset( + internal_handle, + offset, + SEEK_SET, + error ) == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_SEEK_FAILED, + "%s: unable to seek offset: %" PRIi64 " (0x%08" PRIx64 ") in handle.", + function, + offset, + offset ); + + read_count = -1; + } + else + { + read_count = libbfio_internal_handle_read_buffer( + internal_handle, + buffer, + size, + error ); + + if( read_count < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read buffer.", + function ); + + read_count = -1; + } + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_release_for_write( + internal_handle->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); + + return( -1 ); + } +#endif + return( read_count ); +} + +/* Writes data at the current offset from the buffer + * This function is not multi-thread safe acquire write lock before call + * Returns the number of bytes written if successful, or -1 on error + */ +ssize_t libbfio_internal_handle_write_buffer( + libbfio_internal_handle_t *internal_handle, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + static char *function = "libbfio_internal_handle_write_buffer"; + ssize_t write_count = 0; + + if( internal_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } if( internal_handle->write == NULL ) { libcerror_error_set( @@ -1297,6 +1443,69 @@ return( -1 ); } + write_count = internal_handle->write( + internal_handle->io_handle, + buffer, + size, + error ); + + if( write_count < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_WRITE_FAILED, + "%s: unable to write to handle.", + function ); + + return( -1 ); + } + internal_handle->current_offset += (off64_t) write_count; + + if( (size64_t) internal_handle->current_offset > internal_handle->size ) + { + internal_handle->size = (size64_t) internal_handle->current_offset; + } + return( write_count ); +} + +/* Writes data at the current offset from the buffer + * Returns the number of bytes written if successful, or -1 on error + */ +ssize_t libbfio_handle_write_buffer( + libbfio_handle_t *handle, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libbfio_internal_handle_t *internal_handle = NULL; + static char *function = "libbfio_handle_write_buffer"; + ssize_t write_count = 0; + + if( handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } + internal_handle = (libbfio_internal_handle_t *) handle; + + if( internal_handle->io_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid handle - missing IO handle.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, @@ -1312,8 +1521,8 @@ return( -1 ); } #endif - write_count = internal_handle->write( - internal_handle->io_handle, + write_count = libbfio_internal_handle_write_buffer( + internal_handle, buffer, size, error ); @@ -1327,13 +1536,7 @@ "%s: unable to write to handle.", function ); - goto on_error; - } - internal_handle->current_offset += (off64_t) write_count; - - if( (size64_t) internal_handle->current_offset > internal_handle->size ) - { - internal_handle->size = (size64_t) internal_handle->current_offset; + write_count = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( @@ -1351,28 +1554,21 @@ } #endif return( write_count ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_handle->read_write_lock, - NULL ); -#endif - return( -1 ); } -/* Seeks a certain offset within the handle - * Returns the offset if the seek is successful or -1 on error +/* Writes data at a specific offset from the buffer + * Returns the number of bytes written if successful, or -1 on error */ -off64_t libbfio_handle_seek_offset( +ssize_t libbfio_handle_write_buffer_at_offset( libbfio_handle_t *handle, + const uint8_t *buffer, + size_t size, off64_t offset, - int whence, libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; - static char *function = "libbfio_handle_seek_offset"; - off64_t seek_offset = 0; + static char *function = "libbfio_handle_write_buffer_at_offset"; + ssize_t write_count = 0; if( handle == NULL ) { @@ -1398,6 +1594,99 @@ return( -1 ); } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_grab_for_write( + internal_handle->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + + return( -1 ); + } +#endif + if( libbfio_internal_handle_seek_offset( + internal_handle, + offset, + SEEK_SET, + error ) == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_SEEK_FAILED, + "%s: unable to seek offset: %" PRIi64 " (0x%08" PRIx64 ") in handle.", + function, + offset, + offset ); + + write_count = -1; + } + else + { + write_count = libbfio_internal_handle_write_buffer( + internal_handle, + buffer, + size, + error ); + + if( write_count < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_WRITE_FAILED, + "%s: unable to write to handle.", + function ); + + write_count = -1; + } + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_release_for_write( + internal_handle->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); + + return( -1 ); + } +#endif + return( write_count ); +} + +/* Seeks a certain offset within the handle + * This function is not multi-thread safe acquire write lock before call + * Returns the offset if the seek is successful or -1 on error + */ +off64_t libbfio_internal_handle_seek_offset( + libbfio_internal_handle_t *internal_handle, + off64_t offset, + int whence, + libcerror_error_t **error ) +{ + static char *function = "libbfio_internal_handle_seek_offset"; + + if( internal_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } if( internal_handle->seek_offset == NULL ) { libcerror_error_set( @@ -1422,6 +1711,64 @@ return( -1 ); } + offset = internal_handle->seek_offset( + internal_handle->io_handle, + offset, + whence, + error ); + + if( offset == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_SEEK_FAILED, + "%s: unable to seek offset in handle.", + function ); + + return( -1 ); + } + internal_handle->current_offset = offset; + + return( offset ); +} + +/* Seeks a certain offset within the handle + * Returns the offset if the seek is successful or -1 on error + */ +off64_t libbfio_handle_seek_offset( + libbfio_handle_t *handle, + off64_t offset, + int whence, + libcerror_error_t **error ) +{ + libbfio_internal_handle_t *internal_handle = NULL; + static char *function = "libbfio_handle_seek_offset"; + + if( handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } + internal_handle = (libbfio_internal_handle_t *) handle; + + if( internal_handle->io_handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid handle - missing IO handle.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_handle->read_write_lock, @@ -1437,26 +1784,23 @@ return( -1 ); } #endif - seek_offset = internal_handle->seek_offset( - internal_handle->io_handle, - offset, - whence, - error ); + offset = libbfio_internal_handle_seek_offset( + internal_handle, + offset, + whence, + error ); - if( seek_offset == -1 ) + if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek offset: %" PRIi64 " in handle.", - function, - offset ); + "%s: unable to seek offset in handle.", + function ); - goto on_error; + offset = -1; } - internal_handle->current_offset = seek_offset; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_handle->read_write_lock, @@ -1472,15 +1816,7 @@ return( -1 ); } #endif - return( seek_offset ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_handle->read_write_lock, - NULL ); -#endif - return( -1 ); + return( offset ); } /* Function to determine if a file object exists @@ -2229,6 +2565,7 @@ { libbfio_internal_handle_t *internal_handle = NULL; static char *function = "libbfio_handle_get_number_of_offsets_read"; + int result = 1; if( handle == NULL ) { @@ -2270,7 +2607,7 @@ "%s: unable to retrieve number of read offsets.", function ); - goto on_error; + result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( @@ -2287,15 +2624,7 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_read( - internal_handle->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } /* Retrieves the information of an offset read @@ -2309,8 +2638,9 @@ libcerror_error_t **error ) { libbfio_internal_handle_t *internal_handle = NULL; - static char *function = "libbfio_handle_get_offset_read"; intptr_t *value = NULL; + static char *function = "libbfio_handle_get_offset_read"; + int result = 1; if( handle == NULL ) { @@ -2356,7 +2686,7 @@ function, index ); - goto on_error; + result = -1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_read( @@ -2373,14 +2703,6 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_read( - internal_handle->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } diff -Nru libbde-20190102/libbfio/libbfio_handle.h libbde-20240223/libbfio/libbfio_handle.h --- libbde-20190102/libbfio/libbfio_handle.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_handle.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_INTERNAL_HANDLE_H ) @@ -234,6 +234,12 @@ libbfio_handle_t *handle, libcerror_error_t **error ); +ssize_t libbfio_internal_handle_read_buffer( + libbfio_internal_handle_t *internal_handle, + uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + LIBBFIO_EXTERN \ ssize_t libbfio_handle_read_buffer( libbfio_handle_t *handle, @@ -242,6 +248,20 @@ libcerror_error_t **error ); LIBBFIO_EXTERN \ +ssize_t libbfio_handle_read_buffer_at_offset( + libbfio_handle_t *handle, + uint8_t *buffer, + size_t size, + off64_t offset, + libcerror_error_t **error ); + +ssize_t libbfio_internal_handle_write_buffer( + libbfio_internal_handle_t *internal_handle, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +LIBBFIO_EXTERN \ ssize_t libbfio_handle_write_buffer( libbfio_handle_t *handle, const uint8_t *buffer, @@ -249,6 +269,20 @@ libcerror_error_t **error ); LIBBFIO_EXTERN \ +ssize_t libbfio_handle_write_buffer_at_offset( + libbfio_handle_t *handle, + const uint8_t *buffer, + size_t size, + off64_t offset, + libcerror_error_t **error ); + +off64_t libbfio_internal_handle_seek_offset( + libbfio_internal_handle_t *internal_handle, + off64_t offset, + int whence, + libcerror_error_t **error ); + +LIBBFIO_EXTERN \ off64_t libbfio_handle_seek_offset( libbfio_handle_t *handle, off64_t offset, diff -Nru libbde-20190102/libbfio/libbfio_libcdata.h libbde-20240223/libbfio/libbfio_libcdata.h --- libbde-20190102/libbfio/libbfio_libcdata.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libcdata.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcdata header wrapper * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBCDATA_H ) diff -Nru libbde-20190102/libbfio/libbfio_libcerror.h libbde-20240223/libbfio/libbfio_libcerror.h --- libbde-20190102/libbfio/libbfio_libcerror.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libcerror.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBCERROR_H ) diff -Nru libbde-20190102/libbfio/libbfio_libcfile.h libbde-20240223/libbfio/libbfio_libcfile.h --- libbde-20190102/libbfio/libbfio_libcfile.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libcfile.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcfile header * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBCFILE_H ) @@ -44,7 +44,7 @@ #include -#endif +#endif /* defined( HAVE_LOCAL_LIBCFILE ) */ -#endif +#endif /* !defined( _LIBBFIO_LIBCFILE_H ) */ diff -Nru libbde-20190102/libbfio/libbfio_libclocale.h libbde-20240223/libbfio/libbfio_libclocale.h --- libbde-20190102/libbfio/libbfio_libclocale.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libclocale.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libclocale header wrapper * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBCLOCALE_H ) diff -Nru libbde-20190102/libbfio/libbfio_libcpath.h libbde-20240223/libbfio/libbfio_libcpath.h --- libbde-20190102/libbfio/libbfio_libcpath.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libcpath.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcpath header * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBCPATH_H ) @@ -42,7 +42,7 @@ #include -#endif +#endif /* defined( HAVE_LOCAL_LIBCPATH ) */ -#endif +#endif /* !defined( _LIBBFIO_LIBCPATH_H ) */ diff -Nru libbde-20190102/libbfio/libbfio_libcthreads.h libbde-20240223/libbfio/libbfio_libcthreads.h --- libbde-20190102/libbfio/libbfio_libcthreads.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libcthreads.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcthreads header wrapper * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBCTHREADS_H ) diff -Nru libbde-20190102/libbfio/libbfio_libuna.h libbde-20240223/libbfio/libbfio_libuna.h --- libbde-20190102/libbfio/libbfio_libuna.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_libuna.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_LIBUNA_H ) diff -Nru libbde-20190102/libbfio/libbfio_memory_range.c libbde-20240223/libbfio/libbfio_memory_range.c --- libbde-20190102/libbfio/libbfio_memory_range.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_memory_range.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory range functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_memory_range.h libbde-20240223/libbfio/libbfio_memory_range.h --- libbde-20190102/libbfio/libbfio_memory_range.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_memory_range.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory range functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_MEMORY_RANGE_H ) diff -Nru libbde-20190102/libbfio/libbfio_memory_range_io_handle.c libbde-20240223/libbfio/libbfio_memory_range_io_handle.c --- libbde-20190102/libbfio/libbfio_memory_range_io_handle.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_memory_range_io_handle.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory range IO handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -499,14 +499,14 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: range offset exceeds range size.", + "%s: invalid range offset value out of bounds.", function ); return( -1 ); } /* Check if the end of the data was reached */ - if( memory_range_io_handle->range_offset == memory_range_io_handle->range_size ) + if( memory_range_io_handle->range_offset >= memory_range_io_handle->range_size ) { return( 0 ); } @@ -617,17 +617,23 @@ return( -1 ); } - if( memory_range_io_handle->range_offset >= memory_range_io_handle->range_size ) + if( memory_range_io_handle->range_offset > memory_range_io_handle->range_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: range offset exceeds range size.", + "%s: invalid range offset value out of bounds.", function ); return( -1 ); } + /* Check if the end of the data was reached + */ + if( memory_range_io_handle->range_offset >= memory_range_io_handle->range_size ) + { + return( 0 ); + } /* Check the amount of data available */ write_size = memory_range_io_handle->range_size - memory_range_io_handle->range_offset; @@ -641,7 +647,7 @@ if( memory_copy( &( memory_range_io_handle->range_start[ memory_range_io_handle->range_offset ] ), buffer, - size ) == NULL ) + write_size ) == NULL ) { libcerror_error_set( error, diff -Nru libbde-20190102/libbfio/libbfio_memory_range_io_handle.h libbde-20240223/libbfio/libbfio_memory_range_io_handle.h --- libbde-20190102/libbfio/libbfio_memory_range_io_handle.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_memory_range_io_handle.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory range IO handle functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_MEMORY_RANGE_IO_HANDLE_H ) diff -Nru libbde-20190102/libbfio/libbfio_pool.c libbde-20240223/libbfio/libbfio_pool.c --- libbde-20190102/libbfio/libbfio_pool.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_pool.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal pool functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -158,13 +158,14 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; } #endif internal_pool->maximum_number_of_open_handles = maximum_number_of_open_handles; + internal_pool->current_entry = -1; *pool = (libbfio_pool_t *) internal_pool; @@ -360,6 +361,9 @@ goto on_error; } + internal_destination_pool->current_entry = -1; + internal_destination_pool->current_handle = NULL; + if( libcdata_array_clone( &( internal_destination_pool->handles_array ), internal_source_pool->handles_array, @@ -398,7 +402,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -418,6 +422,10 @@ "%s: unable to release read/write lock for reading.", function ); + libbfio_pool_free( + (libbfio_pool_t **) &internal_destination_pool, + NULL ); + return( -1 ); } #endif @@ -656,12 +664,13 @@ */ int libbfio_internal_pool_append_handle_to_last_used_list( libbfio_internal_pool_t *internal_pool, - libbfio_handle_t *handle, + const libbfio_handle_t *handle, libcerror_error_t **error ) { - libbfio_internal_handle_t *internal_handle = NULL; - libcdata_list_element_t *last_used_list_element = NULL; - static char *function = "libbfio_internal_pool_append_handle_to_last_used_list"; + libbfio_internal_handle_t *internal_handle = NULL; + libcdata_list_element_t *last_used_list_element = NULL; + libcdata_list_element_t *safe_last_used_list_element = NULL; + static char *function = "libbfio_internal_pool_append_handle_to_last_used_list"; if( internal_pool == NULL ) { @@ -713,8 +722,32 @@ "%s: unable to retrieve last list element from last used list.", function ); - return( -1 ); + goto on_error; + } + } + if( last_used_list_element == NULL ) + { + if( libcdata_list_element_initialize( + &safe_last_used_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create last used list element.", + function ); + + goto on_error; } + internal_pool->number_of_open_handles++; + + last_used_list_element = safe_last_used_list_element; + } + else + { + /* The last used list element is reused to contain the new last used entry + */ if( libcdata_list_element_get_value( last_used_list_element, (intptr_t **) &internal_handle, @@ -727,7 +760,7 @@ "%s: unable to retrieve value from last used list element.", function ); - return( -1 ); + goto on_error; } if( libcdata_list_remove_element( internal_pool->last_used_list, @@ -741,8 +774,12 @@ "%s: unable to remove last list element from last used list.", function ); - return( -1 ); + goto on_error; } + safe_last_used_list_element = last_used_list_element; + + internal_handle->pool_last_used_list_element = NULL; + if( internal_handle != NULL ) { if( libbfio_handle_close( @@ -756,38 +793,12 @@ "%s: unable to close handle.", function ); - libcdata_list_element_free( - &last_used_list_element, - NULL, - NULL ); - - return( -1 ); + goto on_error; } - internal_handle->pool_last_used_list_element = NULL; - /* Make sure the truncate flag is removed from the handle */ internal_handle->access_flags &= ~( LIBBFIO_ACCESS_FLAG_TRUNCATE ); } - /* The last used list element is reused to contain the new last used entry - */ - } - else - { - if( libcdata_list_element_initialize( - &last_used_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create last used list element.", - function ); - - return( -1 ); - } - internal_pool->number_of_open_handles++; } internal_handle = (libbfio_internal_handle_t *) handle; @@ -800,13 +811,11 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value int last used list element.", + "%s: unable to set value in last used list element.", function ); - return( -1 ); + goto on_error; } - internal_handle->pool_last_used_list_element = last_used_list_element; - if( libcdata_list_prepend_element( internal_pool->last_used_list, last_used_list_element, @@ -819,14 +828,21 @@ "%s: unable to prepend last used list element to list.", function ); + goto on_error; + } + internal_handle->pool_last_used_list_element = last_used_list_element; + + return( 1 ); + +on_error: + if( safe_last_used_list_element != NULL ) + { libcdata_list_element_free( - &last_used_list_element, + &safe_last_used_list_element, NULL, NULL ); - - return( -1 ); } - return( 1 ); + return( -1 ); } /* Moves the handle to the front of the last used list @@ -889,11 +905,9 @@ "%s: unable to retrieve first list element from last used list.", function ); - return( -1 ); + goto on_error; } - last_used_list_element = internal_handle->pool_last_used_list_element; - - if( last_used_list_element == NULL ) + if( internal_handle->pool_last_used_list_element == NULL ) { libcerror_error_set( error, @@ -902,9 +916,9 @@ "%s: missing last used list element.", function ); - return( -1 ); + goto on_error; } - if( last_used_list_element != first_list_element ) + if( internal_handle->pool_last_used_list_element != first_list_element ) { if( libcdata_list_remove_element( internal_pool->last_used_list, @@ -918,8 +932,10 @@ "%s: unable to remove last used list element from list.", function ); - return( -1 ); + goto on_error; } + internal_handle->pool_last_used_list_element = NULL; + if( libcdata_list_prepend_element( internal_pool->last_used_list, last_used_list_element, @@ -932,12 +948,133 @@ "%s: unable to prepend last used list element to list.", function ); - internal_handle->pool_last_used_list_element = NULL; + goto on_error; + } + internal_handle->pool_last_used_list_element = last_used_list_element; + } + return( 1 ); + +on_error: + if( last_used_list_element != NULL ) + { + libcdata_list_element_free( + &last_used_list_element, + NULL, + NULL ); + } + return( -1 ); +} - libcdata_list_element_free( - &last_used_list_element, - NULL, - NULL ); +/* Removes a handle from the last used list + * Returns 1 if successful or -1 on error + */ +int libbfio_internal_pool_remove_handle_from_last_used_list( + libbfio_internal_pool_t *internal_pool, + const libbfio_handle_t *handle, + libcerror_error_t **error ) +{ + libbfio_handle_t *last_used_handle = NULL; + libcdata_list_element_t *last_used_list_element = NULL; + static char *function = "libbfio_internal_pool_remove_handle_from_last_used_list"; + + if( internal_pool == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); + } + if( handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } + if( libcdata_list_get_first_element( + internal_pool->last_used_list, + &last_used_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve first list element from last used list.", + function ); + + return( -1 ); + } + while( last_used_list_element != NULL ) + { + if( libcdata_list_element_get_value( + last_used_list_element, + (intptr_t **) &last_used_handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve last used handle.", + function ); + + return( -1 ); + } + if( last_used_handle == handle ) + { + break; + } + if( libcdata_list_element_get_next_element( + last_used_list_element, + &last_used_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next last used list element.", + function ); + + return( -1 ); + } + } + if( last_used_list_element != NULL ) + { + if( libcdata_list_remove_element( + internal_pool->last_used_list, + last_used_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove last list element from last used list.", + function ); + + return( -1 ); + } + if( libcdata_list_element_free( + &last_used_list_element, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free last used list element.", + function ); return( -1 ); } @@ -1017,7 +1154,7 @@ return( result ); } -/* Retrieves a certain handle from the pool +/* Retrieves a specific handle from the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_get_handle( @@ -1107,6 +1244,8 @@ static char *function = "libbfio_pool_append_handle"; int is_open = 0; int number_of_handles = 0; + int result = 1; + int safe_entry = -1; if( pool == NULL ) { @@ -1143,32 +1282,6 @@ return( -1 ); } - if( handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid handle.", - function ); - - return( -1 ); - } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - if( libcthreads_read_write_lock_grab_for_write( - internal_pool->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif /* Check if the handle is open */ is_open = libbfio_handle_is_open( @@ -1184,7 +1297,7 @@ "%s: unable to determine if handle is open.", function ); - goto on_error; + return( -1 ); } else if( is_open == 0 ) { @@ -1202,9 +1315,24 @@ "%s: unable to set access flags.", function ); - goto on_error; + return( -1 ); } } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_grab_for_write( + internal_pool->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + + return( -1 ); + } +#endif if( libcdata_array_get_number_of_entries( internal_pool->handles_array, &number_of_handles, @@ -1217,13 +1345,13 @@ "%s: unable to retrieve number of handles.", function ); - goto on_error; + result = -1; } - if( ( internal_pool->number_of_used_handles + 1 ) >= number_of_handles ) + else if( ( internal_pool->number_of_used_handles + 1 ) >= number_of_handles ) { if( libcdata_array_append_entry( internal_pool->handles_array, - entry, + &safe_entry, (intptr_t *) handle, error ) != 1 ) { @@ -1234,16 +1362,16 @@ "%s: unable to append handle.", function ); - goto on_error; + result = -1; } } else { - *entry = internal_pool->number_of_used_handles; + safe_entry = internal_pool->number_of_used_handles; if( libcdata_array_set_entry_by_index( internal_pool->handles_array, - *entry, + safe_entry, (intptr_t *) handle, error ) != 1 ) { @@ -1253,30 +1381,33 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to set handle: %d.", function, - *entry ); + safe_entry ); - goto on_error; + result = -1; } } - internal_pool->number_of_used_handles += 1; - - if( is_open != 0 ) + if( result == 1 ) { - if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) + internal_pool->number_of_used_handles += 1; + + if( is_open != 0 ) { - if( libbfio_internal_pool_append_handle_to_last_used_list( - internal_pool, - handle, - error ) != 1 ) + if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append handle to last used list.", - function ); + if( libbfio_internal_pool_append_handle_to_last_used_list( + internal_pool, + handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append handle to last used list.", + function ); - goto on_error; + result = -1; + } } } } @@ -1292,21 +1423,32 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif + if( result != 1 ) + { + goto on_error; + } + *entry = safe_entry; + return( 1 ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif + if( safe_entry >= 0 ) + { + libcdata_array_set_entry_by_index( + internal_pool->handles_array, + safe_entry, + NULL, + NULL ); + + internal_pool->number_of_used_handles -= 1; + } return( -1 ); } -/* Sets a certain handle in the pool +/* Sets a specific handle in the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_set_handle( @@ -1316,10 +1458,11 @@ int access_flags, libcerror_error_t **error ) { - libbfio_internal_handle_t *internal_handle = NULL; - libbfio_internal_pool_t *internal_pool = NULL; - static char *function = "libbfio_pool_set_handle"; - int is_open = 0; + libbfio_internal_handle_t *backup_handle = NULL; + libbfio_internal_pool_t *internal_pool = NULL; + static char *function = "libbfio_pool_set_handle"; + int is_open = 0; + int result = 1; if( pool == NULL ) { @@ -1345,21 +1488,6 @@ return( -1 ); } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - if( libcthreads_read_write_lock_grab_for_write( - internal_pool->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif /* Check if the handle is open */ is_open = libbfio_handle_is_open( @@ -1375,7 +1503,7 @@ "%s: unable to determine if handle is open.", function ); - goto on_error; + return( -1 ); } else if( is_open == 0 ) { @@ -1393,13 +1521,28 @@ "%s: unable to set access flags.", function ); - goto on_error; + return( -1 ); } } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_grab_for_write( + internal_pool->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + + return( -1 ); + } +#endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, - (intptr_t **) &internal_handle, + (intptr_t **) &backup_handle, error ) != 1 ) { libcerror_error_set( @@ -1410,10 +1553,10 @@ function, entry ); - goto on_error; + result = -1; } /* TODO allow to re set handles, make sure all pool references are removed */ - if( internal_handle != NULL ) + else if( backup_handle != NULL ) { libcerror_error_set( error, @@ -1423,13 +1566,13 @@ function, entry ); - goto on_error; + result = -1; } - if( libcdata_array_set_entry_by_index( - internal_pool->handles_array, - entry, - (intptr_t *) handle, - error ) != 1 ) + else if( libcdata_array_set_entry_by_index( + internal_pool->handles_array, + entry, + (intptr_t *) handle, + error ) != 1 ) { libcerror_error_set( error, @@ -1439,27 +1582,35 @@ function, entry ); - goto on_error; + result = -1; } - if( is_open != 0 ) + if( result == 1 ) { - if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) + if( is_open != 0 ) { - if( libbfio_internal_pool_append_handle_to_last_used_list( - internal_pool, - handle, - error ) != 1 ) + if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append handle to last used list.", - function ); + if( libbfio_internal_pool_append_handle_to_last_used_list( + internal_pool, + handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append handle to last used list.", + function ); - goto on_error; + result = -1; + } } } + if( entry == internal_pool->current_entry ) + { + internal_pool->current_entry = -1; + internal_pool->current_handle = NULL; + } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( @@ -1473,21 +1624,26 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + if( result != 1 ) + { + goto on_error; + } + return( result ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, + libcdata_array_set_entry_by_index( + internal_pool->handles_array, + entry, + (intptr_t *) backup_handle, NULL ); -#endif + return( -1 ); } -/* Removes a certain handle from the pool +/* Removes a specific handle from the pool * Returns 1 if successful or -1 on error */ int libbfio_pool_remove_handle( @@ -1496,10 +1652,10 @@ libbfio_handle_t **handle, libcerror_error_t **error ) { - libbfio_handle_t *last_used_handle = NULL; - libbfio_internal_pool_t *internal_pool = NULL; - libcdata_list_element_t *last_used_list_element = NULL; - static char *function = "libbfio_pool_remove_handle"; + libbfio_handle_t *backup_handle = NULL; + libbfio_internal_pool_t *internal_pool = NULL; + static char *function = "libbfio_pool_remove_handle"; + int result = 1; if( pool == NULL ) { @@ -1525,6 +1681,19 @@ return( -1 ); } + if( handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } + *handle = NULL; + #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, @@ -1540,87 +1709,72 @@ return( -1 ); } #endif - if( libcdata_array_remove_entry( + if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, - (intptr_t **) handle, + (intptr_t **) &backup_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove handle: %d.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve handle: %d.", function, entry ); - goto on_error; - } - if( libcdata_list_get_first_element( - internal_pool->last_used_list, - &last_used_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve first list element from last used list.", - function ); - - return( -1 ); + result = -1; } - while( last_used_list_element != NULL ) + if( result == 1 ) { - if( libcdata_list_element_get_value( - last_used_list_element, - (intptr_t **) &last_used_handle, + if( libbfio_internal_pool_remove_handle_from_last_used_list( + internal_pool, + backup_handle, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve last used handle.", - function ); + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove handle: %d from last used list.", + function, + entry ); - return( -1 ); + result = -1; } - if( last_used_handle == *handle ) + } + if( result == 1 ) + { + if( entry == internal_pool->current_entry ) { - break; + internal_pool->current_entry = -1; + internal_pool->current_handle = NULL; } - if( libcdata_list_element_get_next_element( - last_used_list_element, - &last_used_list_element, + if( libcdata_array_set_entry_by_index( + internal_pool->handles_array, + entry, + NULL, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next last used list element.", - function ); + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set handle: %d.", + function, + entry ); - return( -1 ); + libbfio_internal_pool_append_handle_to_last_used_list( + internal_pool, + backup_handle, + NULL ); + + result = -1; } } - if( last_used_list_element != NULL ) + if( result == 1 ) { - if( libcdata_list_remove_element( - internal_pool->last_used_list, - last_used_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove last list element from last used list.", - function ); - - return( -1 ); - } + internal_pool->number_of_used_handles -= 1; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( @@ -1634,18 +1788,34 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + if( result == 1 ) + { + *handle = backup_handle; + } + return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + libcdata_array_set_entry_by_index( + internal_pool->handles_array, + entry, + (intptr_t *) backup_handle, + NULL ); + + libbfio_internal_pool_append_handle_to_last_used_list( + internal_pool, + backup_handle, + NULL ); + + internal_pool->number_of_used_handles += 1; + } return( -1 ); +#endif } /* Retrieves the maximum number of open handles in the pool @@ -1726,10 +1896,11 @@ int maximum_number_of_open_handles, libcerror_error_t **error ) { - libbfio_internal_handle_t *internal_handle = NULL; - libbfio_internal_pool_t *internal_pool = NULL; - libcdata_list_element_t *last_used_list_element = NULL; - static char *function = "libbfio_pool_set_maximum_number_of_open_handles"; + libbfio_internal_handle_t *internal_handle = NULL; + libbfio_internal_pool_t *internal_pool = NULL; + libcdata_list_element_t *last_used_list_element = NULL; + libcdata_list_element_t *safe_last_used_list_element = NULL; + static char *function = "libbfio_pool_set_maximum_number_of_open_handles"; if( pool == NULL ) { @@ -1828,6 +1999,10 @@ goto on_error; } + safe_last_used_list_element = last_used_list_element; + + internal_handle->pool_last_used_list_element = NULL; + if( libbfio_handle_close( (libbfio_handle_t *) internal_handle, error ) != 0 ) @@ -1843,14 +2018,12 @@ } internal_pool->number_of_open_handles--; - internal_handle->pool_last_used_list_element = NULL; - /* Make sure the truncate flag is removed from the handle */ internal_handle->access_flags &= ~( LIBBFIO_ACCESS_FLAG_TRUNCATE ); if( libcdata_list_element_free( - &last_used_list_element, + &safe_last_used_list_element, NULL, error ) != 1 ) { @@ -1882,10 +2055,10 @@ return( 1 ); on_error: - if( last_used_list_element != NULL ) + if( safe_last_used_list_element != NULL ) { libcdata_list_element_free( - &last_used_list_element, + &safe_last_used_list_element, NULL, NULL ); } @@ -1900,18 +2073,17 @@ /* Opens a handle in the pool * Returns 1 if successful or -1 on error */ -int libbfio_pool_open( - libbfio_pool_t *pool, +int libbfio_internal_pool_open( + libbfio_internal_pool_t *internal_pool, int entry, int access_flags, libcerror_error_t **error ) { - libbfio_handle_t *handle = NULL; - libbfio_internal_pool_t *internal_pool = NULL; - static char *function = "libbfio_pool_open"; - int is_open = 0; + libbfio_handle_t *handle = NULL; + static char *function = "libbfio_internal_pool_open"; + int is_open = 0; - if( pool == NULL ) + if( internal_pool == NULL ) { libcerror_error_set( error, @@ -1922,23 +2094,6 @@ return( -1 ); } - internal_pool = (libbfio_internal_pool_t *) pool; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - if( libcthreads_read_write_lock_grab_for_write( - internal_pool->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif if( libcdata_array_get_entry_by_index( internal_pool->handles_array, entry, @@ -1953,9 +2108,9 @@ function, entry ); - goto on_error; + return( -1 ); } - /* Make sure the handle is not open + /* Make sure the handle is not already open */ is_open = libbfio_handle_is_open( handle, @@ -1971,7 +2126,7 @@ function, entry ); - goto on_error; + return( -1 ); } else if( is_open == 1 ) { @@ -1983,7 +2138,7 @@ function, entry ); - goto on_error; + return( -1 ); } if( libbfio_internal_pool_open_handle( internal_pool, @@ -1999,10 +2154,42 @@ function, entry ); - goto on_error; + return( -1 ); } + internal_pool->current_entry = entry; + internal_pool->current_handle = handle; + + return( 1 ); +} + +/* Opens a handle in the pool + * Returns 1 if successful or -1 on error + */ +int libbfio_pool_open( + libbfio_pool_t *pool, + int entry, + int access_flags, + libcerror_error_t **error ) +{ + libbfio_internal_pool_t *internal_pool = NULL; + static char *function = "libbfio_pool_open"; + int result = 1; + + if( pool == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); + } + internal_pool = (libbfio_internal_pool_t *) pool; + #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - if( libcthreads_read_write_lock_release_for_write( + if( libcthreads_read_write_lock_grab_for_write( internal_pool->read_write_lock, error ) != 1 ) { @@ -2010,21 +2197,44 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", + "%s: unable to grab read/write lock for writing.", function ); return( -1 ); } #endif - return( 1 ); + if( libbfio_internal_pool_open( + internal_pool, + entry, + access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_OPEN_FAILED, + "%s: unable to open entry: %d.", + function, + entry ); -on_error: + result = -1; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); + if( libcthreads_read_write_lock_release_for_write( + internal_pool->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); + + return( -1 ); + } #endif - return( -1 ); + return( result ); } /* Reopens a handle in the pool @@ -2099,6 +2309,9 @@ goto on_error; } + internal_pool->current_entry = entry; + internal_pool->current_handle = handle; + #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, @@ -2133,10 +2346,11 @@ int entry, libcerror_error_t **error ) { - libbfio_handle_t *handle = NULL; - libbfio_internal_handle_t *internal_handle = NULL; - libcdata_list_element_t *last_used_list_element = NULL; - static char *function = "libbfio_internal_pool_close"; + libbfio_handle_t *handle = NULL; + libbfio_internal_handle_t *internal_handle = NULL; + libcdata_list_element_t *last_used_list_element = NULL; + libcdata_list_element_t *safe_last_used_list_element = NULL; + static char *function = "libbfio_internal_pool_close"; if( internal_pool == NULL ) { @@ -2223,10 +2437,12 @@ goto on_error; } + safe_last_used_list_element = last_used_list_element; + internal_handle->pool_last_used_list_element = NULL; if( libcdata_list_element_free( - &last_used_list_element, + &safe_last_used_list_element, NULL, error ) != 1 ) { @@ -2254,13 +2470,18 @@ goto on_error; } + if( entry == internal_pool->current_entry ) + { + internal_pool->current_entry = -1; + internal_pool->current_handle = NULL; + } return( 0 ); on_error: - if( last_used_list_element != NULL ) + if( safe_last_used_list_element != NULL ) { libcdata_list_element_free( - &last_used_list_element, + &safe_last_used_list_element, NULL, NULL ); } @@ -2484,7 +2705,137 @@ return( -1 ); } -/* Reads a buffer from a handle in the pool +/* Retrieves a specific handle from the pool and opens it if needed + * Returns 1 if successful or -1 on error + */ +int libbfio_internal_pool_get_open_handle( + libbfio_internal_pool_t *internal_pool, + int entry, + libbfio_handle_t **handle, + libcerror_error_t **error ) +{ + libbfio_handle_t *safe_handle = NULL; + static char *function = "libbfio_internal_pool_get_open_handle"; + int access_flags = 0; + int is_open = 0; + + if( internal_pool == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); + } + if( handle == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid handle.", + function ); + + return( -1 ); + } + if( entry != internal_pool->current_entry ) + { + if( libcdata_array_get_entry_by_index( + internal_pool->handles_array, + entry, + (intptr_t **) &safe_handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve handle: %d.", + function, + entry ); + + return( -1 ); + } + /* Make sure the handle is open + */ + is_open = libbfio_handle_is_open( + safe_handle, + error ); + + if( is_open == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine if entry: %d is open.", + function, + entry ); + + return( -1 ); + } + else if( is_open == 0 ) + { + if( libbfio_handle_get_access_flags( + safe_handle, + &access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve access flags.", + function ); + + return( -1 ); + } + if( libbfio_internal_pool_open_handle( + internal_pool, + safe_handle, + access_flags, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_OPEN_FAILED, + "%s: unable to open entry: %d.", + function, + entry ); + + return( -1 ); + } + } + if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) + { + if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( + internal_pool, + safe_handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to move handle to front of last used list.", + function ); + + return( -1 ); + } + } + internal_pool->current_entry = entry; + internal_pool->current_handle = safe_handle; + } + *handle = internal_pool->current_handle; + + return( 1 ); +} + +/* Reads data at the current offset into the buffer * Returns the number of bytes read or -1 on error */ ssize_t libbfio_pool_read_buffer( @@ -2498,8 +2849,6 @@ libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_read_buffer"; ssize_t read_count = 0; - int access_flags = 0; - int is_open = 0; if( pool == NULL ) { @@ -2529,10 +2878,10 @@ return( -1 ); } #endif - if( libcdata_array_get_entry_by_index( - internal_pool->handles_array, + if( libbfio_internal_pool_get_open_handle( + internal_pool, entry, - (intptr_t **) &handle, + &handle, error ) != 1 ) { libcerror_error_set( @@ -2543,93 +2892,130 @@ function, entry ); - goto on_error; - } - /* Make sure the handle is open - */ - is_open = libbfio_handle_is_open( - handle, - error ); - - if( is_open == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if entry: %d is open.", - function, - entry ); - - goto on_error; + read_count = -1; } - else if( is_open == 0 ) + else { - if( libbfio_handle_get_access_flags( - handle, - &access_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve access flags.", - function ); + read_count = libbfio_handle_read_buffer( + handle, + buffer, + size, + error ); - goto on_error; - } - if( libbfio_internal_pool_open_handle( - internal_pool, - handle, - access_flags, - error ) != 1 ) + if( read_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open entry: %d.", + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read from entry: %d.", function, entry ); - goto on_error; + read_count = -1; } } - if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_release_for_write( + internal_pool->read_write_lock, + error ) != 1 ) { - if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( - internal_pool, - handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to move handle to front of last used list.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); - goto on_error; - } + return( -1 ); + } +#endif + return( read_count ); +} + +/* Reads data at a specific offset into the buffer + * Returns the number of bytes read or -1 on error + */ +ssize_t libbfio_pool_read_buffer_at_offset( + libbfio_pool_t *pool, + int entry, + uint8_t *buffer, + size_t size, + off64_t offset, + libcerror_error_t **error ) +{ + libbfio_handle_t *handle = NULL; + libbfio_internal_pool_t *internal_pool = NULL; + static char *function = "libbfio_pool_read_buffer_at_offset"; + ssize_t read_count = 0; + + if( pool == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); } - read_count = libbfio_handle_read_buffer( - handle, - buffer, - size, - error ); + internal_pool = (libbfio_internal_pool_t *) pool; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_grab_for_write( + internal_pool->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); - if( read_count < 0 ) + return( -1 ); + } +#endif + if( libbfio_internal_pool_get_open_handle( + internal_pool, + entry, + &handle, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read from entry: %d.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve handle: %d.", function, entry ); - goto on_error; + read_count = -1; + } + else + { + read_count = libbfio_handle_read_buffer_at_offset( + handle, + buffer, + size, + offset, + error ); + + if( read_count < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read from entry: %d at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + entry, + offset, + offset ); + + read_count = -1; + } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( @@ -2647,17 +3033,9 @@ } #endif return( read_count ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif - return( -1 ); } -/* Writes a buffer to a handle in the pool +/* Writes data at the current offset from the buffer * Returns the number of bytes written or -1 on error */ ssize_t libbfio_pool_write_buffer( @@ -2671,8 +3049,6 @@ libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_write_buffer"; ssize_t write_count = 0; - int access_flags = 0; - int is_open = 0; if( pool == NULL ) { @@ -2702,10 +3078,10 @@ return( -1 ); } #endif - if( libcdata_array_get_entry_by_index( - internal_pool->handles_array, + if( libbfio_internal_pool_get_open_handle( + internal_pool, entry, - (intptr_t **) &handle, + &handle, error ) != 1 ) { libcerror_error_set( @@ -2716,93 +3092,130 @@ function, entry ); - goto on_error; + write_count = -1; } - /* Make sure the handle is open - */ - is_open = libbfio_handle_is_open( - handle, - error ); - - if( is_open == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if entry: %d is open.", - function, - entry ); - - goto on_error; - } - else if( is_open == 0 ) + else { - if( libbfio_handle_get_access_flags( - handle, - &access_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve access flags.", - function ); + write_count = libbfio_handle_write_buffer( + handle, + buffer, + size, + error ); - goto on_error; - } - if( libbfio_internal_pool_open_handle( - internal_pool, - handle, - access_flags, - error ) != 1 ) + if( write_count < 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open entry: %d.", + LIBCERROR_IO_ERROR_WRITE_FAILED, + "%s: unable to write to entry: %d.", function, entry ); - goto on_error; + write_count = -1; } } - if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_release_for_write( + internal_pool->read_write_lock, + error ) != 1 ) { - if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( - internal_pool, - handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to move handle to front of last used list.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); - goto on_error; - } + return( -1 ); } - write_count = libbfio_handle_write_buffer( - handle, - buffer, - size, - error ); +#endif + return( write_count ); +} - if( write_count < 0 ) +/* Writes data at a specific offset from the buffer + * Returns the number of bytes written or -1 on error + */ +ssize_t libbfio_pool_write_buffer_at_offset( + libbfio_pool_t *pool, + int entry, + const uint8_t *buffer, + size_t size, + off64_t offset, + libcerror_error_t **error ) +{ + libbfio_handle_t *handle = NULL; + libbfio_internal_pool_t *internal_pool = NULL; + static char *function = "libbfio_pool_write_buffer_at_offset"; + ssize_t write_count = 0; + + if( pool == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_WRITE_FAILED, - "%s: unable to write to entry: %d.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid pool.", + function ); + + return( -1 ); + } + internal_pool = (libbfio_internal_pool_t *) pool; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) + if( libcthreads_read_write_lock_grab_for_write( + internal_pool->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + + return( -1 ); + } +#endif + if( libbfio_internal_pool_get_open_handle( + internal_pool, + entry, + &handle, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve handle: %d.", function, entry ); - goto on_error; + write_count = -1; + } + else + { + write_count = libbfio_handle_write_buffer_at_offset( + handle, + buffer, + size, + offset, + error ); + + if( write_count < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_WRITE_FAILED, + "%s: unable to write to entry: %d at offset: %" PRIi64 " (0x%08" PRIx64 ").", + function, + entry, + offset, + offset ); + + write_count = -1; + } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( @@ -2820,14 +3233,6 @@ } #endif return( write_count ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif - return( -1 ); } /* Seeks an offset in a handle in the pool @@ -2843,9 +3248,6 @@ libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_seek_offset"; - off64_t seek_offset = 0; - int access_flags = 0; - int is_open = 0; if( pool == NULL ) { @@ -2875,10 +3277,10 @@ return( -1 ); } #endif - if( libcdata_array_get_entry_by_index( - internal_pool->handles_array, + if( libbfio_internal_pool_get_open_handle( + internal_pool, entry, - (intptr_t **) &handle, + &handle, error ) != 1 ) { libcerror_error_set( @@ -2889,95 +3291,29 @@ function, entry ); - goto on_error; + offset = -1; } - /* Make sure the handle is open - */ - is_open = libbfio_handle_is_open( - handle, - error ); - - if( is_open == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if entry: %d is open.", - function, - entry ); - - goto on_error; - } - else if( is_open == 0 ) + else { - if( libbfio_handle_get_access_flags( - handle, - &access_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve access flags.", - function ); + offset = libbfio_handle_seek_offset( + handle, + offset, + whence, + error ); - goto on_error; - } - if( libbfio_internal_pool_open_handle( - internal_pool, - handle, - access_flags, - error ) != 1 ) + if( offset == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open entry: %d.", + LIBCERROR_IO_ERROR_SEEK_FAILED, + "%s: unable to seek offset in entry: %d.", function, entry ); - goto on_error; + offset = -1; } } - if( internal_pool->maximum_number_of_open_handles != LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES ) - { - if( libbfio_internal_pool_move_handle_to_front_of_last_used_list( - internal_pool, - handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to move handle to front of last used list.", - function ); - - goto on_error; - } - } - seek_offset = libbfio_handle_seek_offset( - handle, - offset, - whence, - error ); - - if( seek_offset == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek offset: %" PRIi64 " in entry: %d.", - function, - offset, - entry ); - - goto on_error; - } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, @@ -2993,15 +3329,7 @@ return( -1 ); } #endif - return( seek_offset ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif - return( -1 ); + return( offset ); } /* Retrieves the current offset in a handle in the pool @@ -3016,8 +3344,7 @@ libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_offset"; - int access_flags = 0; - int is_open = 0; + int result = 1; if( pool == NULL ) { @@ -3047,10 +3374,10 @@ return( -1 ); } #endif - if( libcdata_array_get_entry_by_index( - internal_pool->handles_array, + if( libbfio_internal_pool_get_open_handle( + internal_pool, entry, - (intptr_t **) &handle, + &handle, error ) != 1 ) { libcerror_error_set( @@ -3061,73 +3388,25 @@ function, entry ); - goto on_error; - } - /* Make sure the handle is open - */ - is_open = libbfio_handle_is_open( - handle, - error ); - - if( is_open == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if entry: %d is open.", - function, - entry ); - - goto on_error; + result = -1; } - else if( is_open == 0 ) + else { - if( libbfio_handle_get_access_flags( + if( libbfio_handle_get_offset( handle, - &access_flags, + offset, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve access flags.", + "%s: unable to retrieve offset.", function ); - goto on_error; - } - if( libbfio_internal_pool_open_handle( - internal_pool, - handle, - access_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open entry: %d.", - function, - entry ); - - goto on_error; + result = -1; } } - if( libbfio_handle_get_offset( - handle, - offset, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve offset.", - function ); - - goto on_error; - } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, @@ -3143,15 +3422,7 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } /* Retrieves the size of a handle in the pool @@ -3166,8 +3437,7 @@ libbfio_handle_t *handle = NULL; libbfio_internal_pool_t *internal_pool = NULL; static char *function = "libbfio_pool_get_size"; - int access_flags = 0; - int is_open = 0; + int result = 1; if( pool == NULL ) { @@ -3197,10 +3467,10 @@ return( -1 ); } #endif - if( libcdata_array_get_entry_by_index( - internal_pool->handles_array, + if( libbfio_internal_pool_get_open_handle( + internal_pool, entry, - (intptr_t **) &handle, + &handle, error ) != 1 ) { libcerror_error_set( @@ -3211,74 +3481,26 @@ function, entry ); - goto on_error; - } - /* Make sure the handle is open - */ - is_open = libbfio_handle_is_open( - handle, - error ); - - if( is_open == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if entry: %d is open.", - function, - entry ); - - goto on_error; + result = -1; } - else if( is_open == 0 ) + else { - if( libbfio_handle_get_access_flags( + if( libbfio_handle_get_size( handle, - &access_flags, + size, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve access flags.", - function ); - - goto on_error; - } - if( libbfio_internal_pool_open_handle( - internal_pool, - handle, - access_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open entry: %d.", + "%s: unable to retrieve size of entry: %d.", function, entry ); - goto on_error; + result = -1; } } - if( libbfio_handle_get_size( - handle, - size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve size of entry: %d.", - function, - entry ); - - goto on_error; - } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) if( libcthreads_read_write_lock_release_for_write( internal_pool->read_write_lock, @@ -3294,14 +3516,6 @@ return( -1 ); } #endif - return( 1 ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBBFIO ) - libcthreads_read_write_lock_release_for_write( - internal_pool->read_write_lock, - NULL ); -#endif - return( -1 ); + return( result ); } diff -Nru libbde-20190102/libbfio/libbfio_pool.h libbde-20240223/libbfio/libbfio_pool.h --- libbde-20190102/libbfio/libbfio_pool.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_pool.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal pool functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_POOL_H ) @@ -55,6 +55,14 @@ */ libcdata_array_t *handles_array; + /* The current entry + */ + int current_entry; + + /* The current file IO handle + */ + libbfio_handle_t *current_handle; + /* A list containing the file IO handles in order of the last use * it starts with the last used at the beginning of the list * the value of the list element refers to the corresponding file IO handle @@ -100,7 +108,7 @@ int libbfio_internal_pool_append_handle_to_last_used_list( libbfio_internal_pool_t *internal_pool, - libbfio_handle_t *handle, + const libbfio_handle_t *handle, libcerror_error_t **error ); int libbfio_internal_pool_move_handle_to_front_of_last_used_list( @@ -108,6 +116,11 @@ libbfio_handle_t *handle, libcerror_error_t **error ); +int libbfio_internal_pool_remove_handle_from_last_used_list( + libbfio_internal_pool_t *internal_pool, + const libbfio_handle_t *handle, + libcerror_error_t **error ); + LIBBFIO_EXTERN \ int libbfio_pool_get_number_of_handles( libbfio_pool_t *pool, @@ -156,6 +169,12 @@ int maximum_number_of_open_handles, libcerror_error_t **error ); +int libbfio_internal_pool_open( + libbfio_internal_pool_t *internal_pool, + int entry, + int access_flags, + libcerror_error_t **error ); + LIBBFIO_EXTERN \ int libbfio_pool_open( libbfio_pool_t *pool, @@ -186,6 +205,12 @@ libbfio_pool_t *pool, libcerror_error_t **error ); +int libbfio_internal_pool_get_open_handle( + libbfio_internal_pool_t *internal_pool, + int entry, + libbfio_handle_t **handle, + libcerror_error_t **error ); + LIBBFIO_EXTERN \ ssize_t libbfio_pool_read_buffer( libbfio_pool_t *pool, @@ -195,6 +220,15 @@ libcerror_error_t **error ); LIBBFIO_EXTERN \ +ssize_t libbfio_pool_read_buffer_at_offset( + libbfio_pool_t *pool, + int entry, + uint8_t *buffer, + size_t size, + off64_t offset, + libcerror_error_t **error ); + +LIBBFIO_EXTERN \ ssize_t libbfio_pool_write_buffer( libbfio_pool_t *pool, int entry, @@ -203,6 +237,15 @@ libcerror_error_t **error ); LIBBFIO_EXTERN \ +ssize_t libbfio_pool_write_buffer_at_offset( + libbfio_pool_t *pool, + int entry, + const uint8_t *buffer, + size_t size, + off64_t offset, + libcerror_error_t **error ); + +LIBBFIO_EXTERN \ off64_t libbfio_pool_seek_offset( libbfio_pool_t *pool, int entry, diff -Nru libbde-20190102/libbfio/libbfio_support.c libbde-20240223/libbfio/libbfio_support.c --- libbde-20190102/libbfio/libbfio_support.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_support.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_support.h libbde-20240223/libbfio/libbfio_support.h --- libbde-20190102/libbfio/libbfio_support.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_support.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_SUPPORT_H ) diff -Nru libbde-20190102/libbfio/libbfio_system_string.c libbde-20240223/libbfio/libbfio_system_string.c --- libbde-20190102/libbfio/libbfio_system_string.c 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_system_string.c 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * System string functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libbfio/libbfio_system_string.h libbde-20240223/libbfio/libbfio_system_string.h --- libbde-20190102/libbfio/libbfio_system_string.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_system_string.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * System string functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_SYSTEM_STRING_H ) diff -Nru libbde-20190102/libbfio/libbfio_types.h libbde-20240223/libbfio/libbfio_types.h --- libbde-20190102/libbfio/libbfio_types.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_types.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBBFIO_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libbfio/libbfio_unused.h libbde-20240223/libbfio/libbfio_unused.h --- libbde-20190102/libbfio/libbfio_unused.h 2019-01-02 15:56:56.000000000 +0000 +++ libbde-20240223/libbfio/libbfio_unused.h 2024-02-23 03:03:22.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2022, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBBFIO_INTERNAL_UNUSED_H ) -#define _LIBBFIO_INTERNAL_UNUSED_H +#if !defined( _LIBBFIO_UNUSED_H ) +#define _LIBBFIO_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBBFIO_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBBFIO_UNUSED_H ) */ diff -Nru libbde-20190102/libcaes/Makefile.am libbde-20240223/libcaes/Makefile.am --- libbde-20190102/libcaes/Makefile.am 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/Makefile.am 2024-02-23 03:03:23.000000000 +0000 @@ -22,9 +22,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcaes ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcaes_la_SOURCES) diff -Nru libbde-20190102/libcaes/Makefile.in libbde-20240223/libcaes/Makefile.in --- libbde-20190102/libcaes/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcaes/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcaes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -178,6 +178,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -195,8 +196,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -213,6 +212,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -224,8 +229,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -243,7 +250,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -261,7 +267,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -315,8 +320,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -335,6 +338,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -345,8 +349,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -369,26 +373,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -397,7 +381,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -416,6 +399,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -458,9 +442,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -529,8 +510,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -553,11 +532,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -677,6 +653,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -729,7 +707,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -867,6 +844,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -883,15 +868,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcaes ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcaes_la_SOURCES) diff -Nru libbde-20190102/libcaes/libcaes_context.c libbde-20240223/libcaes/libcaes_context.c --- libbde-20190102/libcaes/libcaes_context.c 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_context.c 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * AES de/encryption context functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -32,6 +32,10 @@ #include #endif +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) +#include +#endif + #include "libcaes_context.h" #include "libcaes_definitions.h" #include "libcaes_libcerror.h" @@ -262,6 +266,12 @@ libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_context_initialize"; +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && ( defined( HAVE_EVP_CRYPTO_AES_CBC ) || defined( HAVE_EVP_CRYPTO_AES_ECB ) ) + char error_string[ 256 ]; + + unsigned long error_code = 0; +#endif + if( context == NULL ) { libcerror_error_set( @@ -326,41 +336,24 @@ if( internal_context->evp_cipher_context == NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP cipher context.", - function ); + error_code = ERR_get_error(); - goto on_error; - } -#endif /* defined( HAVE_EVP_CIPHER_CTX_INIT ) */ + ERR_error_string_n( + error_code, + error_string, + 256 ); - if( EVP_CIPHER_CTX_set_padding( - internal_context->evp_cipher_context, - 1 ) != 1 ) - { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set padding in context.", - function ); - -#if defined( HAVE_EVP_CIPHER_CTX_CLEANUP ) - EVP_CIPHER_CTX_cleanup( - &( internal_context->internal_evp_cipher_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_CIPHER_CTX_free( - internal_context->evp_cipher_context ); -#endif - internal_context->evp_cipher_context = NULL; + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP cipher context with error: %s.", + function, + error_string ); goto on_error; } +#endif /* defined( HAVE_EVP_CIPHER_CTX_INIT ) */ #else if( libcaes_tables_initialized == 0 ) { @@ -404,6 +397,12 @@ static char *function = "libcaes_context_free"; int result = 1; +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_EVP_CIPHER_CTX_CLEANUP ) + char error_string[ 256 ]; + + unsigned long error_code = 0; +#endif + if( context == NULL ) { libcerror_error_set( @@ -428,12 +427,20 @@ if( EVP_CIPHER_CTX_cleanup( &( internal_context->internal_evp_cipher_context ) ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP cipher context.", - function ); + "%s: unable to clean up EVP cipher context with error: %s.", + function, + error_string ); result = -1; } @@ -1247,20 +1254,10 @@ return( -1 ); } - if( input_data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", - function ); - - return( -1 ); - } /* Check if the input data size is a multitude of 16-byte */ - if( ( input_data_size & (size_t) 0x0f ) != 0 ) + if( ( ( input_data_size & (size_t) 0x0f ) != 0 ) + || ( input_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, @@ -1282,24 +1279,14 @@ return( -1 ); } - if( output_data_size > (size_t) SSIZE_MAX ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( output_data_size < input_data_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid ouput data size smaller than input data size.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); @@ -1371,10 +1358,21 @@ libcerror_error_t **error ) { uint8_t block_data[ EVP_MAX_BLOCK_LENGTH ]; + char error_string[ 256 ]; + +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + OSSL_PARAM parameters[2]; + EVP_CIPHER *cipher = NULL; + const char *cipher_string = NULL; + unsigned int padding = 0; +#else const EVP_CIPHER *cipher = NULL; +#endif + libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_crypt_cbc"; + unsigned long error_code = 0; int safe_output_data_size = 0; if( context == NULL ) @@ -1390,6 +1388,19 @@ } internal_context = (libcaes_internal_context_t *) context; + if( ( internal_context->key_bit_size != 128 ) + && ( internal_context->key_bit_size != 192 ) + && ( internal_context->key_bit_size != 256 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: invalid context - unsupported key bit size.", + function ); + + return( -1 ); + } if( ( mode != LIBCAES_CRYPT_MODE_DECRYPT ) && ( mode != LIBCAES_CRYPT_MODE_ENCRYPT ) ) { @@ -1435,20 +1446,10 @@ return( -1 ); } - if( input_data_size > (size_t) INT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", - function ); - - return( -1 ); - } /* Check if the input data size is a multitude of 16-byte */ - if( ( input_data_size & (size_t) 0x0f ) != 0 ) + if( ( ( input_data_size & (size_t) 0x0f ) != 0 ) + || ( input_data_size > (size_t) INT_MAX ) ) { libcerror_error_set( error, @@ -1470,24 +1471,14 @@ return( -1 ); } - if( output_data_size > (size_t) INT_MAX ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) INT_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( output_data_size < input_data_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid ouput data size smaller than input data size.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); @@ -1504,10 +1495,91 @@ "%s: unable to clear input block data.", function ); - return( -1 ); + goto on_error; + } +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( EVP_CIPHER_CTX_reset( + internal_context->evp_cipher_context ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to reset cipher context with error: %s.", + function, + error_string ); + + goto on_error; } if( internal_context->key_bit_size == 128 ) { + cipher_string = "AES-128-CBC"; + } + else if( internal_context->key_bit_size == 192 ) + { + cipher_string = "AES-192-CBC"; + } + else if( internal_context->key_bit_size == 256 ) + { + cipher_string = "AES-256-CBC"; + } + cipher = EVP_CIPHER_fetch( + NULL, + cipher_string, + NULL ); + + if( cipher == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing cipher.", + function ); + + goto on_error; + } + parameters[0] = OSSL_PARAM_construct_uint( + OSSL_CIPHER_PARAM_PADDING, + &padding ); + + parameters[1] = OSSL_PARAM_construct_end(); + + if( EVP_CipherInit_ex2( + internal_context->evp_cipher_context, + cipher, + (unsigned char *) internal_context->key, + (unsigned char *) initialization_vector, + mode, + parameters ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); + + goto on_error; + } +#else + if( internal_context->key_bit_size == 128 ) + { cipher = EVP_aes_128_cbc(); } else if( internal_context->key_bit_size == 192 ) @@ -1526,15 +1598,46 @@ (unsigned char *) initialization_vector, mode ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize cipher.", - function ); + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); - return( -1 ); + goto on_error; + } + if( EVP_CIPHER_CTX_set_padding( + internal_context->evp_cipher_context, + 1 ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set padding in context with error: %s.", + function, + error_string ); + + goto on_error; } +#endif /* defined( HAVE_EVP_CIPHERINIT_EX2 ) */ + if( EVP_CipherUpdate( internal_context->evp_cipher_context, (unsigned char *) output_data, @@ -1542,14 +1645,22 @@ (unsigned char *) input_data, input_data_size ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update cipher.", - function ); + "%s: unable to update cipher with error: %s.", + function, + error_string ); - return( -1 ); + goto on_error; } /* Just ignore the output of this function */ @@ -1558,7 +1669,21 @@ (unsigned char *) block_data, &safe_output_data_size ); +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + EVP_CIPHER_free( + cipher ); +#endif return( 1 ); + +on_error: +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( cipher != NULL ) + { + EVP_CIPHER_free( + cipher ); + } +#endif + return( -1 ); } #else @@ -1643,20 +1768,11 @@ return( -1 ); } - if( input_data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", - function ); - - return( -1 ); - } /* Check if the input data size is a multitude of 16-byte */ - if( ( input_data_size & (size_t) 0x0f ) != 0 ) + if( ( ( input_data_size & (size_t) 0x0f ) != 0 ) + || ( input_data_size < 16 ) + || ( input_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, @@ -1678,24 +1794,14 @@ return( -1 ); } - if( output_data_size > (size_t) SSIZE_MAX ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( output_data_size < input_data_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid ouput data size smaller than input data size.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value of bounds.", function ); return( -1 ); @@ -1714,7 +1820,8 @@ goto on_error; } - if( mode == LIBCAES_CRYPT_MODE_ENCRYPT ) + if( ( mode == LIBCAES_CRYPT_MODE_ENCRYPT ) + && ( output_data != input_data ) ) { if( memory_copy( output_data, @@ -1731,7 +1838,7 @@ goto on_error; } } - while( data_offset < input_data_size ) + while( data_offset <= ( input_data_size - 16 ) ) { if( mode == LIBCAES_CRYPT_MODE_ENCRYPT ) { @@ -1764,7 +1871,7 @@ if( libcaes_crypt_ecb( context, - mode, + LIBCAES_CRYPT_MODE_ENCRYPT, &( output_data[ data_offset ] ), 16, &( output_data[ data_offset ] ), @@ -1799,7 +1906,7 @@ { if( libcaes_crypt_ecb( context, - mode, + LIBCAES_CRYPT_MODE_DECRYPT, &( input_data[ data_offset ] ), 16, &( output_data[ data_offset ] ), @@ -1965,13 +2072,14 @@ return( -1 ); } - if( input_data_size > (size_t) SSIZE_MAX ) + if( ( input_data_size < 16 ) + || ( input_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid input data size value out of bounds.", function ); return( -1 ); @@ -1987,13 +2095,14 @@ return( -1 ); } - if( output_data_size > (size_t) SSIZE_MAX ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); @@ -2047,7 +2156,7 @@ goto on_error; } - while( ( data_offset + 16 ) < input_data_size ) + while( data_offset <= ( input_data_size - 16 ) ) { if( libcaes_crypt_ecb( context, @@ -2167,9 +2276,8 @@ return( -1 ); } -#ifdef TODO - /* De- or encrypts a block of data using AES-CFB (Cipher Feedback Mode) + * Note that the key must be set with mode LIBCAES_CRYPT_MODE_ENCRYPT * Returns 1 if successful or -1 on error */ int libcaes_crypt_cfb( @@ -2177,15 +2285,18 @@ int mode, const uint8_t *initialization_vector, size_t initialization_vector_size, - size_t *initialization_vector_index, const uint8_t *input_data, size_t input_data_size, uint8_t *output_data, size_t output_data_size, libcerror_error_t **error ) { - static char *function = "libcaes_crypt_cfb"; - size_t data_offset = 0; + uint8_t internal_initialization_vector[ 16 ]; + + static char *function = "libcaes_crypt_cfb"; + size_t data_offset = 0; + size_t initialization_vector_index = 0; + uint8_t byte_value = 0; if( ( mode != LIBCAES_CRYPT_MODE_DECRYPT ) && ( mode != LIBCAES_CRYPT_MODE_ENCRYPT ) ) @@ -2221,28 +2332,6 @@ return( -1 ); } - if( initialization_vector_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid initialization vector index.", - function ); - - return( -1 ); - } - if( *initialization_vector_index >= initialization_vector_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid initialization vector index value out of bounds.", - function ); - - return( -1 ); - } if( input_data == NULL ) { libcerror_error_set( @@ -2254,20 +2343,11 @@ return( -1 ); } - if( input_data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", - function ); - - return( -1 ); - } /* Check if the input data size is a multitude of 16-byte */ - if( ( input_data_size & (size_t) 0x0f ) != 0 ) + if( ( ( input_data_size & (size_t) 0x0f ) != 0 ) + || ( input_data_size < 16 ) + || ( input_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, @@ -2289,40 +2369,46 @@ return( -1 ); } - if( output_data_size > (size_t) SSIZE_MAX ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); } - if( output_data_size > input_data_size ) + if( memory_copy( + internal_initialization_vector, + initialization_vector, + 16 ) == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid ouput data size value exceeds input data size.", + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy initialization vector.", function ); - return( -1 ); + goto on_error; } + initialization_vector_index = 16; + for( data_offset = 0; data_offset < input_data_size; data_offset++ ) { - if( *initialization_vector_index == 0 ) + if( initialization_vector_index > 15 ) { if( libcaes_crypt_ecb( context, - mode, - initialization_vector, + LIBCAES_CRYPT_MODE_ENCRYPT, + internal_initialization_vector, initialization_vector_size, - initialization_vector, + internal_initialization_vector, initialization_vector_size, error ) != 1 ) { @@ -2333,26 +2419,46 @@ "%s: unable to de/encrypt initialization vector.", function ); - return( -1 ); + goto on_error; } + initialization_vector_index = 0; } - output_data[ data_offset ] = input_data[ data_offset ] - ^ initialization_vector[ *initialization_vector_index ]; + output_data[ data_offset ] = input_data[ data_offset ] ^ internal_initialization_vector[ initialization_vector_index ]; if( mode == LIBCAES_CRYPT_MODE_ENCRYPT ) { - initialization_vector[ *initialization_vector_index ] = output_data[ data_offset ]; + byte_value = output_data[ data_offset ]; } else { - initialization_vector[ *initialization_vector_index ] = input_data[ data_offset ]; + byte_value = input_data[ data_offset ]; } - *initialization_vector_index = ( *initialization_vector_index + 1 ) & 0x0f; + internal_initialization_vector[ initialization_vector_index++ ] = byte_value; + } + if( memory_set( + internal_initialization_vector, + 0, + 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear initialization vector.", + function ); + + goto on_error; } return( 1 ); -} -#endif /* TODO */ +on_error: + memory_set( + internal_initialization_vector, + 0, + 16 ); + + return( -1 ); +} #if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_AES_H ) && defined( HAVE_AES_ECB_ENCRYPT ) @@ -2410,24 +2516,14 @@ return( -1 ); } - if( input_data_size > (size_t) SSIZE_MAX ) + if( ( input_data_size < 16 ) + || ( input_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( input_data_size < 16 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid input data size value too small.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid input data size value out of bounds.", function ); return( -1 ); @@ -2443,24 +2539,14 @@ return( -1 ); } - if( output_data_size > (size_t) SSIZE_MAX ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( output_data_size < input_data_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid ouput data size smaller than input data size.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); @@ -2498,11 +2584,21 @@ libcerror_error_t **error ) { uint8_t block_data[ EVP_MAX_BLOCK_LENGTH ]; + char error_string[ 256 ]; +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + OSSL_PARAM parameters[2]; + + EVP_CIPHER *cipher = NULL; + const char *cipher_string = NULL; + unsigned int padding = 0; +#else const EVP_CIPHER *cipher = NULL; +#endif + libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_crypt_ecb"; - int result = 1; + unsigned long error_code = 0; int safe_output_data_size = 0; if( context == NULL ) @@ -2518,47 +2614,50 @@ } internal_context = (libcaes_internal_context_t *) context; - if( ( mode != LIBCAES_CRYPT_MODE_DECRYPT ) - && ( mode != LIBCAES_CRYPT_MODE_ENCRYPT ) ) + if( ( internal_context->key_bit_size != 128 ) + && ( internal_context->key_bit_size != 192 ) + && ( internal_context->key_bit_size != 256 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported mode.", + "%s: invalid context - unsupported key bit size.", function ); return( -1 ); } - if( input_data == NULL ) + if( ( mode != LIBCAES_CRYPT_MODE_DECRYPT ) + && ( mode != LIBCAES_CRYPT_MODE_ENCRYPT ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid input data.", + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported mode.", function ); return( -1 ); } - if( input_data_size > (size_t) INT_MAX ) + if( input_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid input data.", function ); return( -1 ); } - if( input_data_size < 16 ) + if( ( input_data_size < 16 ) + || ( input_data_size > (size_t) INT_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid input data size value too small.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid input data size value out of bounds.", function ); return( -1 ); @@ -2574,24 +2673,14 @@ return( -1 ); } - if( output_data_size > (size_t) INT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( output_data_size < input_data_size ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) INT_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid ouput data size smaller than input data size.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); @@ -2608,10 +2697,91 @@ "%s: unable to clear block data.", function ); - return( -1 ); + goto on_error; + } +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( EVP_CIPHER_CTX_reset( + internal_context->evp_cipher_context ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to reset cipher context with error: %s.", + function, + error_string ); + + goto on_error; } if( internal_context->key_bit_size == 128 ) { + cipher_string = "AES-128-ECB"; + } + else if( internal_context->key_bit_size == 192 ) + { + cipher_string = "AES-192-ECB"; + } + else if( internal_context->key_bit_size == 256 ) + { + cipher_string = "AES-256-ECB"; + } + cipher = EVP_CIPHER_fetch( + NULL, + cipher_string, + NULL ); + + if( cipher == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing cipher.", + function ); + + goto on_error; + } + parameters[0] = OSSL_PARAM_construct_uint( + OSSL_CIPHER_PARAM_PADDING, + &padding ); + + parameters[1] = OSSL_PARAM_construct_end(); + + if( EVP_CipherInit_ex2( + internal_context->evp_cipher_context, + cipher, + (unsigned char *) internal_context->key, + NULL, + mode, + parameters ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); + + goto on_error; + } +#else + if( internal_context->key_bit_size == 128 ) + { cipher = EVP_aes_128_ecb(); } else if( internal_context->key_bit_size == 192 ) @@ -2630,15 +2800,46 @@ NULL, mode ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize cipher.", - function ); + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); - return( -1 ); + goto on_error; } + if( EVP_CIPHER_CTX_set_padding( + internal_context->evp_cipher_context, + 1 ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set padding in context with error: %s.", + function, + error_string ); + + goto on_error; + } +#endif /* defined( HAVE_EVP_CIPHERINIT_EX2 ) */ + if( EVP_CipherUpdate( internal_context->evp_cipher_context, (unsigned char *) output_data, @@ -2646,14 +2847,22 @@ (unsigned char *) input_data, 16 ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update cipher.", - function ); + "%s: unable to update cipher with error: %s.", + function, + error_string ); - return( -1 ); + goto on_error; } /* Just ignore the output of this function */ @@ -2662,7 +2871,21 @@ (unsigned char *) block_data, &safe_output_data_size ); - return( result ); +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + EVP_CIPHER_free( + cipher ); +#endif + return( 1 ); + +on_error: +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( cipher != NULL ) + { + EVP_CIPHER_free( + cipher ); + } +#endif + return( -1 ); } #else @@ -2728,24 +2951,17 @@ return( -1 ); } - if( input_data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid input data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( input_data_size < 16 ) + /* Check if the input data size is a multitude of 16-byte + */ + if( ( ( input_data_size & (size_t) 0x0f ) != 0 ) + || ( input_data_size < 16 ) + || ( input_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid input data size value too small.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid input data size value out of bounds.", function ); return( -1 ); @@ -2761,24 +2977,14 @@ return( -1 ); } - if( output_data_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid output data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( output_data_size < input_data_size ) + if( ( output_data_size < input_data_size ) + || ( output_data_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid ouput data size smaller than input data size.", + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid output data size value out of bounds.", function ); return( -1 ); diff -Nru libbde-20190102/libcaes/libcaes_context.h libbde-20240223/libcaes/libcaes_context.h --- libbde-20190102/libcaes/libcaes_context.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_context.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * AES de/encryption context functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_CONTEXT_H ) @@ -143,19 +143,17 @@ size_t output_data_size, libcerror_error_t **error ); -#ifdef TODO +LIBCAES_EXTERN \ int libcaes_crypt_cfb( libcaes_context_t *context, int mode, const uint8_t *initialization_vector, size_t initialization_vector_size, - size_t *initialization_vector_index, const uint8_t *input_data, size_t input_data_size, uint8_t *output_data, size_t output_data_size, libcerror_error_t **error ); -#endif LIBCAES_EXTERN \ int libcaes_crypt_ecb( diff -Nru libbde-20190102/libcaes/libcaes_definitions.h libbde-20240223/libcaes/libcaes_definitions.h --- libbde-20190102/libcaes/libcaes_definitions.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_definitions.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCAES_INTERNAL_DEFINITIONS_H ) @@ -34,11 +34,11 @@ * for local use of libcaes */ #else -#define LIBCAES_VERSION 20190102 +#define LIBCAES_VERSION 20240114 /* The libcaes version string */ -#define LIBCAES_VERSION_STRING "20190102" +#define LIBCAES_VERSION_STRING "20240114" /* The crypt modes */ diff -Nru libbde-20190102/libcaes/libcaes_error.c libbde-20240223/libcaes/libcaes_error.c --- libbde-20190102/libcaes/libcaes_error.c 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_error.c 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcaes/libcaes_error.h libbde-20240223/libcaes/libcaes_error.h --- libbde-20190102/libcaes/libcaes_error.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_error.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcaes/libcaes_extern.h libbde-20240223/libcaes/libcaes_extern.h --- libbde-20190102/libcaes/libcaes_extern.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_extern.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCAES_EXTERN_VARIABLE extern +#else #define LIBCAES_EXTERN_VARIABLE LIBCAES_EXTERN +#endif #else #define LIBCAES_EXTERN /* extern */ diff -Nru libbde-20190102/libcaes/libcaes_libcerror.h libbde-20240223/libcaes/libcaes_libcerror.h --- libbde-20190102/libcaes/libcaes_libcerror.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_libcerror.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_LIBCERROR_H ) diff -Nru libbde-20190102/libcaes/libcaes_support.c libbde-20240223/libcaes/libcaes_support.c --- libbde-20190102/libcaes/libcaes_support.c 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_support.c 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcaes/libcaes_support.h libbde-20240223/libcaes/libcaes_support.h --- libbde-20190102/libcaes/libcaes_support.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_support.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_SUPPORT_H ) diff -Nru libbde-20190102/libcaes/libcaes_tweaked_context.c libbde-20240223/libcaes/libcaes_tweaked_context.c --- libbde-20190102/libcaes/libcaes_tweaked_context.c 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_tweaked_context.c 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * AES encryption functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -29,6 +29,10 @@ #include #endif +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) +#include +#endif + #include "libcaes_context.h" #include "libcaes_definitions.h" #include "libcaes_libcerror.h" @@ -46,6 +50,12 @@ libcaes_internal_tweaked_context_t *internal_tweaked_context = NULL; static char *function = "libcaes_tweaked_context_initialize"; +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_CRYPTO_AES_XTS ) + char error_string[ 256 ]; + + unsigned long error_code = 0; +#endif + if( tweaked_context == NULL ) { libcerror_error_set( @@ -110,41 +120,24 @@ if( internal_tweaked_context->evp_cipher_context == NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP cipher context.", - function ); + error_code = ERR_get_error(); - goto on_error; - } -#endif /* defined( HAVE_EVP_CIPHER_CTX_INIT ) */ + ERR_error_string_n( + error_code, + error_string, + 256 ); - if( EVP_CIPHER_CTX_set_padding( - internal_tweaked_context->evp_cipher_context, - 1 ) != 1 ) - { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set padding in context.", - function ); - -#if defined( HAVE_EVP_CIPHER_CTX_CLEANUP ) - EVP_CIPHER_CTX_cleanup( - &( internal_tweaked_context->internal_evp_cipher_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_CIPHER_CTX_free( - internal_tweaked_context->evp_cipher_context ); -#endif - internal_tweaked_context->evp_cipher_context = NULL; + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP cipher context with error: %s.", + function, + error_string ); goto on_error; } +#endif /* defined( HAVE_EVP_CIPHER_CTX_INIT ) */ #else if( libcaes_context_initialize( &( internal_tweaked_context->main_context ), @@ -210,6 +203,12 @@ static char *function = "libcaes_tweaked_context_free"; int result = 1; +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_EVP_CIPHER_CTX_CLEANUP ) + char error_string[ 256 ]; + + unsigned long error_code = 0; +#endif + if( tweaked_context == NULL ) { libcerror_error_set( @@ -231,12 +230,20 @@ if( EVP_CIPHER_CTX_cleanup( &( internal_tweaked_context->internal_evp_cipher_context ) ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP cipher context.", - function ); + "%s: unable to clean up EVP cipher context with error: %s.", + function, + error_string ); result = -1; } @@ -464,10 +471,21 @@ libcerror_error_t **error ) { uint8_t block_data[ EVP_MAX_BLOCK_LENGTH ]; + char error_string[ 256 ]; +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + OSSL_PARAM parameters[2]; + + EVP_CIPHER *cipher = NULL; + const char *cipher_string = NULL; + unsigned int padding = 0; +#else const EVP_CIPHER *cipher = NULL; +#endif + libcaes_internal_tweaked_context_t *internal_tweaked_context = NULL; static char *function = "libcaes_crypt_xts"; + unsigned long error_code = 0; int safe_output_data_size = 0; if( tweaked_context == NULL ) @@ -595,10 +613,87 @@ "%s: unable to clear input block data.", function ); - return( -1 ); + goto on_error; + } +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( EVP_CIPHER_CTX_reset( + internal_tweaked_context->evp_cipher_context ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to reset cipher context with error: %s.", + function, + error_string ); + + goto on_error; } if( internal_tweaked_context->key_bit_size == 128 ) { + cipher_string = "AES-128-XTS"; + } + else if( internal_tweaked_context->key_bit_size == 256 ) + { + cipher_string = "AES-256-XTS"; + } + cipher = EVP_CIPHER_fetch( + NULL, + cipher_string, + NULL ); + + if( cipher == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing cipher.", + function ); + + goto on_error; + } + parameters[0] = OSSL_PARAM_construct_uint( + OSSL_CIPHER_PARAM_PADDING, + &padding ); + + parameters[1] = OSSL_PARAM_construct_end(); + + if( EVP_CipherInit_ex2( + internal_tweaked_context->evp_cipher_context, + cipher, + (unsigned char *) internal_tweaked_context->key, + (unsigned char *) tweak_value, + mode, + parameters ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); + + goto on_error; + } +#else + if( internal_tweaked_context->key_bit_size == 128 ) + { cipher = EVP_aes_128_xts(); } else if( internal_tweaked_context->key_bit_size == 256 ) @@ -613,15 +708,46 @@ (unsigned char *) tweak_value, mode ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize cipher.", - function ); + "%s: unable to initialize cipher with error: %s.", + function, + error_string ); - return( -1 ); + goto on_error; + } + if( EVP_CIPHER_CTX_set_padding( + internal_tweaked_context->evp_cipher_context, + 1 ) != 1 ) + { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set padding in context with error: %s.", + function, + error_string ); + + goto on_error; } +#endif /* defined( HAVE_EVP_CIPHERINIT_EX2 ) */ + if( EVP_CipherUpdate( internal_tweaked_context->evp_cipher_context, (unsigned char *) output_data, @@ -629,14 +755,22 @@ (unsigned char *) input_data, input_data_size ) != 1 ) { + error_code = ERR_get_error(); + + ERR_error_string_n( + error_code, + error_string, + 256 ); + libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update cipher.", - function ); + "%s: unable to update cipher with error: %s.", + function, + error_string ); - return( -1 ); + goto on_error; } /* Just ignore the output of this function */ @@ -645,7 +779,21 @@ (unsigned char *) block_data, &safe_output_data_size ); +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + EVP_CIPHER_free( + cipher ); +#endif return( 1 ); + +on_error: +#if defined( HAVE_EVP_CIPHERINIT_EX2 ) + if( cipher != NULL ) + { + EVP_CIPHER_free( + cipher ); + } +#endif + return( -1 ); } #else @@ -823,7 +971,7 @@ } remaining_data_size = input_data_size; - while( ( data_offset + 16 ) <= input_data_size ) + while( data_offset <= ( input_data_size - 16 ) ) { if( ( remaining_data_size < 32 ) && ( remaining_data_size != 16 ) ) diff -Nru libbde-20190102/libcaes/libcaes_tweaked_context.h libbde-20240223/libcaes/libcaes_tweaked_context.h --- libbde-20190102/libcaes/libcaes_tweaked_context.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_tweaked_context.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * AES tweaked de/encryption context functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_TWEAKED_CONTEXT_H ) diff -Nru libbde-20190102/libcaes/libcaes_types.h libbde-20240223/libcaes/libcaes_types.h --- libbde-20190102/libcaes/libcaes_types.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_types.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libcaes/libcaes_unused.h libbde-20240223/libcaes/libcaes_unused.h --- libbde-20190102/libcaes/libcaes_unused.h 2019-01-02 15:56:59.000000000 +0000 +++ libbde-20240223/libcaes/libcaes_unused.h 2024-02-23 03:03:23.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCAES_UNUSED_H ) diff -Nru libbde-20190102/libcdata/Makefile.am libbde-20240223/libcdata/Makefile.am --- libbde-20190102/libcdata/Makefile.am 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/Makefile.am 2024-02-23 03:03:24.000000000 +0000 @@ -11,6 +11,8 @@ libcdata_la_SOURCES = \ libcdata_array.c libcdata_array.h \ libcdata_btree.c libcdata_btree.h \ + libcdata_btree_node.c libcdata_btree_node.h \ + libcdata_btree_values_list.c libcdata_btree_values_list.h \ libcdata_definitions.h \ libcdata_error.c libcdata_error.h \ libcdata_extern.h \ @@ -30,9 +32,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcdata_la_SOURCES) diff -Nru libbde-20190102/libcdata/Makefile.in libbde-20240223/libcdata/Makefile.in --- libbde-20190102/libcdata/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcdata/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcdata ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -121,7 +121,9 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libcdata_la_LIBADD = am__libcdata_la_SOURCES_DIST = libcdata_array.c libcdata_array.h \ - libcdata_btree.c libcdata_btree.h libcdata_definitions.h \ + libcdata_btree.c libcdata_btree.h libcdata_btree_node.c \ + libcdata_btree_node.h libcdata_btree_values_list.c \ + libcdata_btree_values_list.h libcdata_definitions.h \ libcdata_error.c libcdata_error.h libcdata_extern.h \ libcdata_libcerror.h libcdata_libcthreads.h libcdata_list.c \ libcdata_list.h libcdata_list_element.c \ @@ -131,8 +133,10 @@ libcdata_support.h libcdata_tree_node.c libcdata_tree_node.h \ libcdata_types.h libcdata_unused.h @HAVE_LOCAL_LIBCDATA_TRUE@am_libcdata_la_OBJECTS = libcdata_array.lo \ -@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree.lo libcdata_error.lo \ -@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_list.lo \ +@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree.lo \ +@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_node.lo \ +@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_values_list.lo \ +@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_error.lo libcdata_list.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_list_element.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_range_list.lo \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_range_list_value.lo \ @@ -160,8 +164,10 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcdata_array.Plo \ - ./$(DEPDIR)/libcdata_btree.Plo ./$(DEPDIR)/libcdata_error.Plo \ - ./$(DEPDIR)/libcdata_list.Plo \ + ./$(DEPDIR)/libcdata_btree.Plo \ + ./$(DEPDIR)/libcdata_btree_node.Plo \ + ./$(DEPDIR)/libcdata_btree_values_list.Plo \ + ./$(DEPDIR)/libcdata_error.Plo ./$(DEPDIR)/libcdata_list.Plo \ ./$(DEPDIR)/libcdata_list_element.Plo \ ./$(DEPDIR)/libcdata_range_list.Plo \ ./$(DEPDIR)/libcdata_range_list_value.Plo \ @@ -193,6 +199,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -210,8 +217,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -228,6 +233,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -239,8 +250,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -258,7 +271,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -276,7 +288,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -330,8 +341,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -350,6 +359,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -360,8 +370,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -384,26 +394,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -412,7 +402,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -431,6 +420,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -473,9 +463,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -544,8 +531,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -568,11 +553,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -592,6 +574,8 @@ @HAVE_LOCAL_LIBCDATA_TRUE@libcdata_la_SOURCES = \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_array.c libcdata_array.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree.c libcdata_btree.h \ +@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_node.c libcdata_btree_node.h \ +@HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_btree_values_list.c libcdata_btree_values_list.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_definitions.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_error.c libcdata_error.h \ @HAVE_LOCAL_LIBCDATA_TRUE@ libcdata_extern.h \ @@ -665,6 +649,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_array.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_btree.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_btree_node.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_btree_values_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcdata_list_element.Plo@am__quote@ # am--include-marker @@ -705,6 +691,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -757,7 +745,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -877,6 +864,8 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcdata_array.Plo -rm -f ./$(DEPDIR)/libcdata_btree.Plo + -rm -f ./$(DEPDIR)/libcdata_btree_node.Plo + -rm -f ./$(DEPDIR)/libcdata_btree_values_list.Plo -rm -f ./$(DEPDIR)/libcdata_error.Plo -rm -f ./$(DEPDIR)/libcdata_list.Plo -rm -f ./$(DEPDIR)/libcdata_list_element.Plo @@ -900,6 +889,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -916,15 +913,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcdata ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcdata_la_SOURCES) diff -Nru libbde-20190102/libcdata/libcdata_array.c libbde-20240223/libcdata/libcdata_array.c --- libbde-20190102/libcdata/libcdata_array.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_array.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Array functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -134,7 +134,7 @@ } entries_size = sizeof( intptr_t * ) * number_of_allocated_entries; - if( entries_size > (size_t) SSIZE_MAX ) + if( entries_size > (size_t) LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT ) { libcerror_error_set( error, @@ -146,7 +146,7 @@ goto on_error; } internal_array->entries = (intptr_t **) memory_allocate( - entries_size ); + entries_size ); if( internal_array->entries == NULL ) { @@ -185,7 +185,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -282,6 +282,8 @@ /* Empties an array and frees its entries * The entries are freed using the entry_free_function + * If the entry_free_function fails for a specific entry it is not freed and kept in the array + * * Returns 1 if successful or -1 on error */ int libcdata_array_empty( @@ -337,8 +339,10 @@ result = -1; } - internal_array->number_of_entries = 0; - + else + { + internal_array->number_of_entries = 0; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, @@ -359,6 +363,8 @@ /* Clears an array and frees its entries * The entries are freed using the entry_free_function + * If the entry_free_function fails for a specific entry it is not freed and kept in the array + * * This function is not multi-thread safe acquire write lock before call * Returns 1 if successful or -1 on error */ @@ -370,6 +376,7 @@ libcerror_error_t **error ) { static char *function = "libcdata_internal_array_clear"; + int entry_free_result = 0; int entry_iterator = 0; int result = 1; @@ -384,31 +391,47 @@ return( -1 ); } - if( internal_array->entries != NULL ) + if( internal_array->entries == NULL ) { - for( entry_iterator = 0; - entry_iterator < internal_array->number_of_entries; - entry_iterator++ ) + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } + for( entry_iterator = 0; + entry_iterator < internal_array->number_of_entries; + entry_iterator++ ) + { + if( internal_array->entries[ entry_iterator ] != NULL ) { - if( internal_array->entries[ entry_iterator ] != NULL ) + if( entry_free_function == NULL ) { - if( entry_free_function != NULL ) - { - if( entry_free_function( - &( internal_array->entries[ entry_iterator ] ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free array entry: %d.", - function, - entry_iterator ); + entry_free_result = 1; + } + else + { + entry_free_result = entry_free_function( + &( internal_array->entries[ entry_iterator ] ), + error ); + } + if( entry_free_result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free array entry: %d.", + function, + entry_iterator ); - result = -1; - } - } + result = -1; + } + else + { internal_array->entries[ entry_iterator ] = NULL; } } @@ -418,6 +441,8 @@ /* Clears an array and frees its entries * The entries are freed using the entry_free_function + * If the entry_free_function fails for a specific entry it is not freed and kept in the array + * * Returns 1 if successful or -1 on error */ int libcdata_array_clear( @@ -567,46 +592,46 @@ } internal_source_array = (libcdata_internal_array_t *) source_array; - if( libcdata_array_initialize( - (libcdata_array_t **) &internal_destination_array, - internal_source_array->number_of_entries, +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_source_array->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination array.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } - if( internal_destination_array == NULL ) +#endif + if( libcdata_array_initialize( + (libcdata_array_t **) &internal_destination_array, + internal_source_array->number_of_entries, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing destination array.", + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create destination array.", function ); - return( -1 ); + goto on_error; } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_read( - internal_source_array->read_write_lock, - error ) != 1 ) + if( internal_destination_array == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for reading.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing destination array.", function ); - return( -1 ); + goto on_error; } -#endif if( internal_source_array->entries != NULL ) { for( entry_iterator = 0; @@ -685,8 +710,8 @@ libcerror_error_t **error ), libcerror_error_t **error ) { - void *reallocation = NULL; static char *function = "libcdata_internal_array_resize"; + void *reallocation = NULL; size_t entries_size = 0; int entry_iterator = 0; int number_of_allocated_entries = 0; @@ -703,6 +728,17 @@ return( -1 ); } + if( internal_array->entries == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } if( number_of_entries < 0 ) { libcerror_error_set( @@ -743,7 +779,7 @@ } entries_size = sizeof( intptr_t * ) * number_of_allocated_entries; - if( entries_size > (size_t) SSIZE_MAX ) + if( entries_size > (size_t) LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT ) { libcerror_error_set( error, @@ -771,19 +807,15 @@ } internal_array->entries = (intptr_t **) reallocation; - if( memory_set( - &( internal_array->entries[ internal_array->number_of_allocated_entries ] ), - 0, - sizeof( intptr_t * ) * ( number_of_allocated_entries - internal_array->number_of_allocated_entries ) ) == NULL ) + /* Cannot use memset reliably here. The loop below will be removed + * when memset is used and the code is optimized. Therefore the loop + * is not executed when memset fails. + */ + for( entry_iterator = internal_array->number_of_allocated_entries; + entry_iterator < number_of_allocated_entries; + entry_iterator++ ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear array entries.", - function ); - - result = -1; + internal_array->entries[ entry_iterator ] = NULL; } internal_array->number_of_allocated_entries = number_of_allocated_entries; internal_array->number_of_entries = number_of_entries; @@ -1194,6 +1226,17 @@ } internal_array = (libcdata_internal_array_t *) array; + if( internal_array->entries == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } if( entry_compare_function == NULL ) { libcerror_error_set( @@ -1231,39 +1274,36 @@ return( -1 ); } #endif - if( internal_array->entries != NULL ) - { - for( entry_index = 0; - entry_index < internal_array->number_of_entries; - entry_index++ ) - { - compare_result = entry_compare_function( - entry, - internal_array->entries[ entry_index ], - error ); + for( entry_index = 0; + entry_index < internal_array->number_of_entries; + entry_index++ ) + { + compare_result = entry_compare_function( + entry, + internal_array->entries[ entry_index ], + error ); - if( compare_result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare entry: %d.", - function, - entry_index ); + if( compare_result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to compare entry: %d.", + function, + entry_index ); - result = -1; + result = -1; - break; - } - else if( compare_result == LIBCDATA_COMPARE_EQUAL ) - { - *existing_entry = internal_array->entries[ entry_index ]; + break; + } + else if( compare_result == LIBCDATA_COMPARE_EQUAL ) + { + *existing_entry = internal_array->entries[ entry_index ]; - result = 1; + result = 1; - break; - } + break; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) @@ -1296,6 +1336,10 @@ libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_set_entry_by_index"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + intptr_t *backup_entry = NULL; +#endif + if( array == NULL ) { libcerror_error_set( @@ -1346,6 +1390,7 @@ return( -1 ); } + backup_entry = internal_array->entries[ entry_index ]; #endif internal_array->entries[ entry_index ] = entry; @@ -1361,10 +1406,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_array->entries[ entry_index ] = backup_entry; + + return( -1 ); +#endif } /* Prepends an entry @@ -1378,6 +1430,7 @@ libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_prepend_entry"; int entry_iterator = 0; + int result = 0; if( array == NULL ) { @@ -1392,6 +1445,17 @@ } internal_array = (libcdata_internal_array_t *) array; + if( internal_array->entries == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, @@ -1407,11 +1471,13 @@ return( -1 ); } #endif - if( libcdata_internal_array_resize( - internal_array, - internal_array->number_of_entries + 1, - NULL, - error ) != 1 ) + result = libcdata_internal_array_resize( + internal_array, + internal_array->number_of_entries + 1, + NULL, + error ); + + if( result != 1 ) { libcerror_error_set( error, @@ -1420,19 +1486,18 @@ "%s: unable to resize array.", function ); - goto on_error; + result = -1; } - if( internal_array->number_of_entries > 1 ) + else { - for( entry_iterator = internal_array->number_of_entries - 2; - entry_iterator >= 0; + for( entry_iterator = internal_array->number_of_entries - 1; + entry_iterator > 0; entry_iterator-- ) { - internal_array->entries[ entry_iterator + 1 ] = internal_array->entries[ entry_iterator ]; + internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; } + internal_array->entries[ entry_iterator ] = entry; } - internal_array->entries[ 0 ] = entry; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, @@ -1445,18 +1510,27 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_array->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + for( entry_iterator = 0; + entry_iterator < ( internal_array->number_of_entries - 1 ); + entry_iterator++ ) + { + internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator + 1 ]; + } + internal_array->entries[ entry_iterator ] = NULL; + + internal_array->number_of_entries -= 1; + } return( -1 ); +#endif } /* Appends an entry @@ -1471,6 +1545,8 @@ { libcdata_internal_array_t *internal_array = NULL; static char *function = "libcdata_array_append_entry"; + int result = 0; + int safe_entry_index = 0; if( array == NULL ) { @@ -1485,6 +1561,17 @@ } internal_array = (libcdata_internal_array_t *) array; + if( internal_array->entries == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } if( entry_index == NULL ) { libcerror_error_set( @@ -1511,13 +1598,15 @@ return( -1 ); } #endif - *entry_index = internal_array->number_of_entries; + safe_entry_index = internal_array->number_of_entries; - if( libcdata_internal_array_resize( - internal_array, - internal_array->number_of_entries + 1, - NULL, - error ) != 1 ) + result = libcdata_internal_array_resize( + internal_array, + internal_array->number_of_entries + 1, + NULL, + error ); + + if( result != 1 ) { libcerror_error_set( error, @@ -1526,10 +1615,12 @@ "%s: unable to resize array.", function ); - goto on_error; + result = -1; + } + else + { + internal_array->entries[ safe_entry_index ] = entry; } - internal_array->entries[ *entry_index ] = entry; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, @@ -1542,18 +1633,25 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + if( result == 1 ) + { + *entry_index = safe_entry_index; + } + return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_array->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + internal_array->entries[ safe_entry_index ] = NULL; + + internal_array->number_of_entries -= 1; + } return( -1 ); +#endif } /* Inserts an entry in the array @@ -1565,6 +1663,10 @@ * Duplicate entries are allowed by default and inserted after the last duplicate entry. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * + * entry_index is set to the index of the entry when the entry was successfully inserted + * or to the index of the existing entry when the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES + * is set and an existing entry was found. + * * Returns 1 if successful, 0 if the entry already exists or -1 on error */ int libcdata_array_insert_entry( @@ -1579,10 +1681,11 @@ libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; - static char *function = "libcdata_tree_node_insert_node"; + static char *function = "libcdata_array_insert_entry"; int compare_result = 0; int entry_iterator = 0; - int result = 1; + int result = 0; + int safe_entry_index = 0; if( array == NULL ) { @@ -1597,6 +1700,17 @@ } internal_array = (libcdata_internal_array_t *) array; + if( internal_array->entries == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } if( entry_index == NULL ) { libcerror_error_set( @@ -1646,119 +1760,93 @@ return( -1 ); } #endif - if( internal_array->entries != NULL ) - { - for( entry_iterator = 0; - entry_iterator < internal_array->number_of_entries; - entry_iterator++ ) - { - compare_result = entry_compare_function( - entry, - internal_array->entries[ entry_iterator ], - error ); + compare_result = LIBCDATA_COMPARE_GREATER; + result = 1; - if( compare_result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare entry: %d.", - function, - entry_iterator ); + for( entry_iterator = 0; + entry_iterator < internal_array->number_of_entries; + entry_iterator++ ) + { + compare_result = entry_compare_function( + entry, + internal_array->entries[ entry_iterator ], + error ); - goto on_error; - } - else if( compare_result == LIBCDATA_COMPARE_EQUAL ) - { - if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) - { - result = 0; + if( compare_result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to compare entry: %d.", + function, + entry_iterator ); - break; - } - } - else if( compare_result == LIBCDATA_COMPARE_LESS ) + result = -1; + } + else if( compare_result == LIBCDATA_COMPARE_EQUAL ) + { + if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) { - result = 1; - - break; + result = 0; } - else if( compare_result != LIBCDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported entry compare function return value: %d.", - function, - compare_result ); + } + else if( compare_result == LIBCDATA_COMPARE_LESS ) + { + result = 1; - goto on_error; - } + break; + } + else if( compare_result != LIBCDATA_COMPARE_GREATER ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported entry compare function return value: %d.", + function, + compare_result ); + + result = -1; + } + if( result != 1 ) + { + break; } } - if( result != 0 ) + if( result == 1 ) { - if( ( internal_array->entries != NULL ) - && ( compare_result == LIBCDATA_COMPARE_LESS ) ) - { - *entry_index = entry_iterator; + result = libcdata_internal_array_resize( + internal_array, + internal_array->number_of_entries + 1, + NULL, + error ); - if( libcdata_internal_array_resize( - internal_array, - internal_array->number_of_entries + 1, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize array.", - function ); + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, + "%s: unable to resize array.", + function ); - goto on_error; - } - for( entry_iterator = internal_array->number_of_entries - 1; - entry_iterator > *entry_index; - entry_iterator-- ) - { - internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; - } - internal_array->entries[ *entry_index ] = entry; + result = -1; } else { - *entry_index = internal_array->number_of_entries; + safe_entry_index = entry_iterator; - if( libcdata_internal_array_resize( - internal_array, - internal_array->number_of_entries + 1, - NULL, - error ) != 1 ) + if( compare_result == LIBCDATA_COMPARE_LESS ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize array.", - function ); - - goto on_error; - } - if( internal_array->entries == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid array - missing entries.", - function ); - - goto on_error; + for( entry_iterator = internal_array->number_of_entries - 1; + entry_iterator > safe_entry_index; + entry_iterator-- ) + { + internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; + } } - internal_array->entries[ *entry_index ] = entry; + internal_array->entries[ safe_entry_index ] = entry; } } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) @@ -1773,18 +1861,31 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif + if( result != -1 ) + { + *entry_index = safe_entry_index; + } return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_array->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + for( entry_iterator = safe_entry_index; + entry_iterator < ( internal_array->number_of_entries - 1 ); + entry_iterator++ ) + { + internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator + 1 ]; + } + internal_array->entries[ entry_iterator ] = NULL; + + internal_array->number_of_entries -= 1; + } return( -1 ); +#endif } /* Removes an entry @@ -1797,6 +1898,7 @@ libcerror_error_t **error ) { libcdata_internal_array_t *internal_array = NULL; + intptr_t *safe_entry = NULL; static char *function = "libcdata_array_remove_entry"; int entry_iterator = 0; @@ -1813,6 +1915,17 @@ } internal_array = (libcdata_internal_array_t *) array; + if( internal_array->entries == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid array - missing entries.", + function ); + + return( -1 ); + } if( ( entry_index < 0 ) || ( entry_index >= internal_array->number_of_entries ) ) { @@ -1836,6 +1949,8 @@ return( -1 ); } + *entry = NULL; + #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_array->read_write_lock, @@ -1851,37 +1966,18 @@ return( -1 ); } #endif - *entry = internal_array->entries[ entry_index ]; + safe_entry = internal_array->entries[ entry_index ]; - if( entry_index == ( internal_array->number_of_entries - 1 ) ) + for( entry_iterator = entry_index; + entry_iterator < ( internal_array->number_of_entries - 1 ); + entry_iterator++ ) { - internal_array->entries[ entry_index ] = NULL; + internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator + 1 ]; } - else - { - for( entry_iterator = ( internal_array->number_of_entries - 1 ); - entry_iterator > entry_index; - entry_iterator-- ) - { - internal_array->entries[ entry_iterator - 1 ] = internal_array->entries[ entry_iterator ]; - internal_array->entries[ entry_iterator ] = NULL; - } - } - if( libcdata_internal_array_resize( - internal_array, - internal_array->number_of_entries - 1, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize array.", - function ); + internal_array->entries[ entry_iterator ] = NULL; + + internal_array->number_of_entries -= 1; - goto on_error; - } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_array->read_write_lock, @@ -1894,17 +1990,26 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif + *entry = safe_entry; + return( 1 ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_array->read_write_lock, - NULL ); -#endif +on_error: + internal_array->number_of_entries += 1; + + for( entry_iterator = ( internal_array->number_of_entries - 1 ); + entry_iterator > entry_index; + entry_iterator-- ) + { + internal_array->entries[ entry_iterator ] = internal_array->entries[ entry_iterator - 1 ]; + } + internal_array->entries[ entry_index ] = safe_entry; + return( -1 ); +#endif } diff -Nru libbde-20190102/libcdata/libcdata_array.h libbde-20240223/libcdata/libcdata_array.h --- libbde-20190102/libcdata/libcdata_array.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_array.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Array functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_ARRAY_H ) diff -Nru libbde-20190102/libcdata/libcdata_btree.c libbde-20240223/libcdata/libcdata_btree.c --- libbde-20190102/libcdata/libcdata_btree.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_btree.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Balanced tree type functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,6 +25,8 @@ #include "libcdata_array.h" #include "libcdata_btree.h" +#include "libcdata_btree_node.h" +#include "libcdata_btree_values_list.h" #include "libcdata_definitions.h" #include "libcdata_libcerror.h" #include "libcdata_libcthreads.h" @@ -147,7 +149,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -221,7 +223,7 @@ #endif if( libcdata_tree_node_free( &( internal_tree->root_node ), - (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_free_values_list, + (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_values_list_free, error ) != 1 ) { libcerror_error_set( @@ -253,1589 +255,8 @@ return( result ); } -/* Frees a values list - * Returns 1 if successful or -1 on error - */ -int libcdata_btree_free_values_list( - libcdata_list_t **values_list, - libcerror_error_t **error ) -{ - static char *function = "libcdata_btree_free_values_list"; - int result = 1; - - if( values_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid values list.", - function ); - - return( -1 ); - } - if( libcdata_list_free( - values_list, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free values list.", - function ); - - result = -1; - } - return( result ); -} - /* TODO add clone function ? */ -/* Retrieves the sub node for the specific value - * - * Uses the value_compare_function to determine the similarity of the entries - * The value_compare_function should return LIBCDATA_COMPARE_LESS, - * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error - * - * If value_compare_function is NULL the pointer of the value is used to check for a match - * - * Returns 1 if successful, 0 if the value does not exist or -1 on error - * If there was no possible sub match values_list_element is set to NULL - * it there is a possible sub match values_list_element is set but 0 is returned - * If the node is a leaf node sub_node is not set to NULL - */ -int libcdata_btree_node_get_sub_node_by_value( - libcdata_tree_node_t *node, - intptr_t *value, - int (*value_compare_function)( - intptr_t *first_value, - intptr_t *second_value, - libcerror_error_t **error ), - libcdata_tree_node_t **sub_node, - libcdata_list_element_t **values_list_element, - libcerror_error_t **error ) -{ - libcdata_list_t *values_list = NULL; - libcdata_list_element_t *safe_values_list_element = NULL; - libcdata_tree_node_t *safe_sub_node = NULL; - intptr_t *values_list_value = NULL; - static char *function = "libcdata_btree_node_get_sub_node_by_value"; - int number_of_sub_nodes = 0; - int number_of_values_list_elements = 0; - int result = 0; - int sub_node_index = 0; - int values_list_element_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value.", - function ); - - return( -1 ); - } - if( sub_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid sub node.", - function ); - - return( -1 ); - } - if( values_list_element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid values list element.", - function ); - - return( -1 ); - } - *sub_node = NULL; - *values_list_element = NULL; - - if( libcdata_tree_node_get_value( - node, - (intptr_t **) &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values list.", - function ); - - return( -1 ); - } - if( values_list != NULL ) - { - if( libcdata_list_get_number_of_elements( - values_list, - &number_of_values_list_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of values list elements.", - function ); - - return( -1 ); - } - } - if( libcdata_tree_node_get_number_of_sub_nodes( - node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - if( ( number_of_sub_nodes != 0 ) - && ( ( number_of_values_list_elements + 1 ) != number_of_sub_nodes ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of values list elements value out of bounds.", - function ); - - return( -1 ); - } - if( number_of_values_list_elements == 0 ) - { - return( 0 ); - } - if( libcdata_list_get_first_element( - values_list, - &safe_values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve first values list element.", - function ); - - return( -1 ); - } - if( number_of_sub_nodes != 0 ) - { - if( libcdata_tree_node_get_sub_node_by_index( - node, - 0, - &safe_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node: 0.", - function ); - - return( -1 ); - } - } - for( values_list_element_index = 0; - values_list_element_index < number_of_values_list_elements; - values_list_element_index++ ) - { - if( libcdata_list_element_get_value( - safe_values_list_element, - &values_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from values list element: %d.", - function, - values_list_element_index ); - - return( -1 ); - } - if( values_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid values list element: %d - missing value.", - function, - values_list_element_index ); - - return( -1 ); - } - if( value_compare_function != NULL ) - { - result = value_compare_function( - value, - values_list_value, - error ); - } - else if( value == values_list_value ) - { - result = LIBCDATA_COMPARE_EQUAL; - } - else - { - result = LIBCDATA_COMPARE_GREATER; - } - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare value with values list value: %d.", - function, - values_list_element_index ); - - return( -1 ); - } - else if( result == LIBCDATA_COMPARE_EQUAL ) - { - *sub_node = safe_sub_node; - *values_list_element = safe_values_list_element; - - return( 1 ); - } - else if( result == LIBCDATA_COMPARE_LESS ) - { - break; - } - else if( result != LIBCDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported value compare function return value: %d.", - function, - result ); - - return( -1 ); - } - if( libcdata_list_element_get_next_element( - safe_values_list_element, - &safe_values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next element from values list element: %d.", - function, - values_list_element_index ); - - return( -1 ); - } - if( number_of_sub_nodes != 0 ) - { - if( libcdata_tree_node_get_next_node( - safe_sub_node, - &safe_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next node from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - sub_node_index++; - } - } - *sub_node = safe_sub_node; - *values_list_element = safe_values_list_element; - - return( 0 ); -} - -/* Retrieves the upper node for the specific value - * - * Uses the value_compare_function to determine the similarity of the entries - * The value_compare_function should return LIBCDATA_COMPARE_LESS, - * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error - * - * Returns 1 if successful, 0 if the value does not exist or -1 on error - */ -int libcdata_btree_node_get_upper_node_by_value( - libcdata_tree_node_t *node, - intptr_t *value, - int (*value_compare_function)( - intptr_t *first_value, - intptr_t *second_value, - libcerror_error_t **error ), - libcdata_tree_node_t **upper_node, - libcdata_list_element_t **values_list_element, - libcerror_error_t **error ) -{ - libcdata_list_element_t *sub_values_list_element = NULL; - libcdata_tree_node_t *sub_node = NULL; - static char *function = "libcdata_btree_node_get_upper_node_by_value"; - int result = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value.", - function ); - - return( -1 ); - } - if( value_compare_function == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value compare function.", - function ); - - return( -1 ); - } - if( upper_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid upper node.", - function ); - - return( -1 ); - } - if( values_list_element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid values list element.", - function ); - - return( -1 ); - } - *upper_node = NULL; - *values_list_element = NULL; - - result = libcdata_btree_node_get_sub_node_by_value( - node, - value, - value_compare_function, - &sub_node, - &sub_values_list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node by value.", - function ); - - return( -1 ); - } - else if( sub_node != NULL ) - { - result = libcdata_btree_node_get_upper_node_by_value( - sub_node, - value, - value_compare_function, - upper_node, - values_list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve upper node in sub node.", - function ); - - return( -1 ); - } - } - else if( result != 0 ) - { - *values_list_element = sub_values_list_element; - } - if( *upper_node == NULL ) - { - *upper_node = node; - } - return( result ); -} - -/* Appends a value into a tree node - * Returns 1 if successful or -1 on error - */ -int libcdata_btree_node_append_value( - libcdata_tree_node_t *node, - intptr_t *value, - libcerror_error_t **error ) -{ - libcdata_list_t *values_list = NULL; - static char *function = "libcdata_btree_node_append_value"; - - if( libcdata_tree_node_get_value( - node, - (intptr_t **) &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values list.", - function ); - - return( -1 ); - } - if( values_list == NULL ) - { - if( libcdata_list_initialize( - &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create values list.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_set_value( - node, - (intptr_t *) values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set values list.", - function ); - - libcdata_list_free( - &values_list, - NULL, - NULL ); - - return( -1 ); - } - } - if( libcdata_list_append_value( - values_list, - value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append value to values list.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Inserts a value into a tree node - * The tree node must be the most upper node (leaf) - * - * Uses the value_compare_function to determine the order of the entries - * The value_compare_function should return LIBCDATA_COMPARE_LESS, - * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error - * - * Returns 1 if successful, 0 if the value already exists or -1 on error - */ -int libcdata_btree_node_insert_value( - libcdata_tree_node_t *node, - intptr_t *value, - int (*value_compare_function)( - intptr_t *first_value, - intptr_t *second_value, - libcerror_error_t **error ), - libcerror_error_t **error ) -{ - libcdata_list_t *values_list = NULL; - static char *function = "libcdata_btree_node_insert_value"; - int number_of_sub_nodes = 0; - int result = 0; - - if( libcdata_tree_node_get_number_of_sub_nodes( - node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - if( number_of_sub_nodes != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: cannot insert value in node with sub nodes.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_get_value( - node, - (intptr_t **) &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values list.", - function ); - - return( -1 ); - } - if( values_list == NULL ) - { - if( libcdata_list_initialize( - &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create values list.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_set_value( - node, - (intptr_t *) values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set values list.", - function ); - - libcdata_list_free( - &values_list, - NULL, - NULL ); - - return( -1 ); - } - } - result = libcdata_list_insert_value( - values_list, - value, - value_compare_function, - LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert value in values list.", - function ); - - return( -1 ); - } - return( result ); -} - -/* Replaces a value in the tree node - * The tree node must be the most upper node (leaf) in the first call - * Returns 1 if successful or -1 on error - */ -int libcdata_btree_node_replace_value( - libcdata_tree_node_t *node, - intptr_t *value, - intptr_t *replacement_value, - libcerror_error_t **error ) -{ - libcdata_list_element_t *values_list_element = NULL; - libcdata_tree_node_t *parent_node = NULL; - libcdata_tree_node_t *sub_node = NULL; - static char *function = "libcdata_btree_node_replace_value"; - int result = 0; - - if( value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value.", - function ); - - return( -1 ); - } - if( replacement_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid replacement value.", - function ); - - return( -1 ); - } - result = libcdata_btree_node_get_sub_node_by_value( - node, - value, - NULL, - &sub_node, - &values_list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node by value.", - function ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libcdata_list_element_set_value( - values_list_element, - replacement_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value in values list element.", - function ); - - return( -1 ); - } - } - if( libcdata_tree_node_get_parent_node( - node, - &parent_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve parent node.", - function ); - - return( -1 ); - } - if( parent_node != NULL ) - { - if( libcdata_btree_node_replace_value( - parent_node, - value, - replacement_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to replace value in parent node.", - function ); - - return( -1 ); - } - } - return( 1 ); -} - -/* Removes a value from the tree node - * The tree node must be the most upper node (leaf) in the first call - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libcdata_btree_node_remove_value( - libcdata_tree_node_t *node, - intptr_t *value, - intptr_t *replacement_value, - libcerror_error_t **error ) -{ - libcdata_list_t *sub_node_values_list = NULL; - libcdata_list_t *values_list = NULL; - libcdata_list_element_t *previous_values_list_element = NULL; - libcdata_list_element_t *values_list_element = NULL; - libcdata_tree_node_t *parent_node = NULL; - libcdata_tree_node_t *sub_node = NULL; - static char *function = "libcdata_btree_node_remove_value"; - int number_of_sub_nodes = 0; - int number_of_values_list_elements = 0; - int result = 0; - int sub_node_number_of_sub_nodes = 0; - int sub_node_number_of_values_list_elements = 0; - - if( value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value.", - function ); - - return( -1 ); - } - result = libcdata_btree_node_get_sub_node_by_value( - node, - value, - NULL, - &sub_node, - &values_list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node by value.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_get_value( - node, - (intptr_t **) &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values list.", - function ); - - return( -1 ); - } - if( libcdata_list_get_number_of_elements( - values_list, - &number_of_values_list_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of values list elements.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_get_number_of_sub_nodes( - node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - if( sub_node != NULL ) - { - if( libcdata_tree_node_get_value( - sub_node, - (intptr_t **) &sub_node_values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node values list.", - function ); - - return( -1 ); - } - if( libcdata_list_get_number_of_elements( - sub_node_values_list, - &sub_node_number_of_values_list_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node number of values list elements.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_get_number_of_sub_nodes( - sub_node, - &sub_node_number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - /* If the sub node is empty remove it - */ - if( ( sub_node_number_of_sub_nodes == 0 ) - && ( sub_node_number_of_values_list_elements == 0 ) ) - { - if( libcdata_tree_node_remove_node( - node, - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove remaining sub node from node.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_free( - &sub_node, - (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_free_values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free remaining sub node.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_get_number_of_sub_nodes( - node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - if( values_list_element == NULL ) - { - if( libcdata_list_get_last_element( - values_list, - &values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve last values list element.", - function ); - - return( -1 ); - } - if( libcdata_list_element_get_value( - values_list_element, - &replacement_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from last values list element.", - function ); - - return( -1 ); - } - } - if( values_list_element != NULL ) - { - if( libcdata_list_remove_element( - values_list, - values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove values list element from values list.", - function ); - - return( -1 ); - } - if( libcdata_list_element_free( - &values_list_element, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free values list element.", - function ); - - return( -1 ); - } - if( libcdata_list_get_number_of_elements( - values_list, - &number_of_values_list_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of values list elements.", - function ); - - return( -1 ); - } - } - } - } - if( number_of_sub_nodes != 0 ) - { - if( ( number_of_values_list_elements + 1 ) != number_of_sub_nodes ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of values list elements value out of bounds.", - function ); - - return( -1 ); - } - /* If one sub node remains flatten the tree - */ - if( number_of_sub_nodes == 1 ) - { - if( libcdata_tree_node_get_sub_node_by_index( - node, - 0, - &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve remaining sub node.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_remove_node( - node, - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove remaining sub node from node.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_replace_node( - node, - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to replace node with remaining sub node.", - function ); - - libcdata_tree_node_append_node( - node, - sub_node, - NULL ); - - return( -1 ); - } - if( libcdata_tree_node_get_value( - node, - (intptr_t **) &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values list.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_free( - &sub_node, - (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_free_values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free remaining sub node.", - function ); - - return( -1 ); - } - } - /* If the sub node contains more than one values list elements - * use the replacement value determined in the sub node - */ - else if( values_list_element != NULL ) - { - if( replacement_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid replacement value.", - function ); - - return( -1 ); - } - if( libcdata_list_element_set_value( - values_list_element, - replacement_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value in values list element.", - function ); - - return( -1 ); - } - } - } - /* In a leaf node remove the values list element from the list - */ - else if( values_list_element != NULL ) - { - if( libcdata_list_element_get_previous_element( - values_list_element, - &previous_values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous element from values list element.", - function ); - - return( -1 ); - } - if( previous_values_list_element != NULL ) - { - if( libcdata_list_element_get_value( - previous_values_list_element, - &replacement_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from previous values list element.", - function ); - - return( -1 ); - } - } - if( libcdata_list_remove_element( - values_list, - values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove values list element from values list.", - function ); - - return( -1 ); - } - if( libcdata_list_element_free( - &values_list_element, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free values list element.", - function ); - - return( -1 ); - } - } - if( libcdata_tree_node_get_parent_node( - node, - &parent_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve parent node.", - function ); - - return( -1 ); - } - if( parent_node != NULL ) - { - if( libcdata_btree_node_remove_value( - parent_node, - value, - replacement_value, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove value from parent node.", - function ); - - return( -1 ); - } - } - return( result ); -} - -/* Splits the node - * Returns 1 if successful or -1 on error - */ -int libcdata_btree_node_split( - libcdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libcdata_list_t *split_values_list = NULL; - libcdata_list_t *values_list = NULL; - libcdata_list_element_t *values_list_element = NULL; - libcdata_tree_node_t *sub_node = NULL; - intptr_t *values_list_value = NULL; - static char *function = "libcdata_btree_node_split"; - int number_of_split_values_list_elements = 0; - int number_of_sub_nodes = 0; - int number_of_values_list_elements = 0; - int split_values_list_element_index = 0; - int sub_node_index = 0; - int values_list_element_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( libcdata_tree_node_get_number_of_sub_nodes( - node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - goto on_error; - } - if( number_of_sub_nodes != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: cannot split node with sub nodes.", - function ); - - goto on_error; - } - if( libcdata_tree_node_get_value( - node, - (intptr_t **) &values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values list.", - function ); - - goto on_error; - } - /* Split to have about 25 values per sub node - */ - number_of_split_values_list_elements = 25; - - if( libcdata_list_initialize( - &split_values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create split values list.", - function ); - - goto on_error; - } - if( libcdata_tree_node_set_value( - node, - (intptr_t *) split_values_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set split values list.", - function ); - - goto on_error; - } - if( libcdata_list_get_number_of_elements( - values_list, - &number_of_values_list_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of values list elements.", - function ); - - goto on_error; - } - if( libcdata_list_get_first_element( - values_list, - &values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve first values list element.", - function ); - - goto on_error; - } - for( values_list_element_index = 0; - values_list_element_index < number_of_values_list_elements; - values_list_element_index++ ) - { - if( libcdata_list_element_get_value( - values_list_element, - &values_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from values list element: %d.", - function, - values_list_element_index ); - - goto on_error; - } - if( values_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid values list element: %d - missing value.", - function, - values_list_element_index ); - - goto on_error; - } - if( sub_node == NULL ) - { - if( libcdata_tree_node_initialize( - &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sub node: %d.", - function, - sub_node_index ); - - goto on_error; - } - } - if( libcdata_btree_node_append_value( - sub_node, - values_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append value: %d to sub node: %d.", - function, - values_list_element_index, - sub_node_index ); - - goto on_error; - } - if( values_list_element_index >= split_values_list_element_index ) - { - if( ( values_list_element_index + 1 ) < number_of_values_list_elements ) - { - if( libcdata_list_append_value( - split_values_list, - values_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append value: %d to sub nodes values list.", - function, - values_list_element_index ); - - goto on_error; - } - } - split_values_list_element_index += number_of_split_values_list_elements; - - if( libcdata_tree_node_append_node( - node, - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append sub node: %d to node.", - function, - sub_node_index ); - - goto on_error; - } - sub_node = NULL; - - sub_node_index++; - } - if( libcdata_list_element_get_next_element( - values_list_element, - &values_list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next element from values list element: %d.", - function, - values_list_element_index ); - - goto on_error; - } - } - if( sub_node != NULL ) - { - if( libcdata_tree_node_append_node( - node, - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append sub node: %d to node.", - function, - sub_node_index ); - - goto on_error; - } - sub_node = NULL; - - sub_node_index++; - } - split_values_list = NULL; - - if( libcdata_list_free( - &values_list, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free values list.", - function ); - - goto on_error; - } - return( 1 ); - -on_error: - if( sub_node != NULL ) - { - libcdata_tree_node_remove_node( - node, - sub_node, - NULL ); - libcdata_tree_node_free( - &sub_node, - NULL, - NULL ); - } - if( split_values_list != NULL ) - { - libcdata_tree_node_empty( - node, - NULL, - NULL ); - libcdata_tree_node_set_value( - node, - (intptr_t *) values_list, - NULL ); - libcdata_list_free( - &split_values_list, - NULL, - NULL ); - } - return( -1 ); -} - /* Retrieves the number of values in the tree * Returns 1 if successful or -1 on error */ @@ -1959,12 +380,12 @@ internal_tree = (libcdata_internal_btree_t *) tree; result = libcdata_btree_node_get_upper_node_by_value( - internal_tree->root_node, - value, - value_compare_function, - upper_node, - &existing_list_element, - error ); + internal_tree->root_node, + value, + value_compare_function, + upper_node, + &existing_list_element, + error ); if( result == -1 ) { @@ -2188,12 +609,12 @@ /* Make sure existing list element updated after the split */ result = libcdata_btree_node_get_sub_node_by_value( - *upper_node, - value, - value_compare_function, - upper_node, - &existing_list_element, - error ); + *upper_node, + value, + value_compare_function, + upper_node, + &existing_list_element, + error ); if( result == -1 ) { @@ -2207,12 +628,12 @@ return( -1 ); } result = libcdata_btree_node_get_sub_node_by_value( - *upper_node, - value, - value_compare_function, - upper_node, - &existing_list_element, - error ); + *upper_node, + value, + value_compare_function, + upper_node, + &existing_list_element, + error ); if( result != 1 ) { diff -Nru libbde-20190102/libcdata/libcdata_btree.h libbde-20240223/libcdata/libcdata_btree.h --- libbde-20190102/libcdata/libcdata_btree.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_btree.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Balanced tree type functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_BTREE_H ) @@ -75,64 +75,8 @@ libcerror_error_t **error ), libcerror_error_t **error ); -int libcdata_btree_free_values_list( - libcdata_list_t **values_list, - libcerror_error_t **error ); - /* TODO clone function */ -int libcdata_btree_node_get_sub_node_by_value( - libcdata_tree_node_t *node, - intptr_t *value, - int (*value_compare_function)( - intptr_t *first_value, - intptr_t *second_value, - libcerror_error_t **error ), - libcdata_tree_node_t **sub_node, - libcdata_list_element_t **values_list_element, - libcerror_error_t **error ); - -int libcdata_btree_node_get_upper_node_by_value( - libcdata_tree_node_t *node, - intptr_t *value, - int (*value_compare_function)( - intptr_t *first_value, - intptr_t *second_value, - libcerror_error_t **error ), - libcdata_tree_node_t **upper_node, - libcdata_list_element_t **values_list_element, - libcerror_error_t **error ); - -int libcdata_btree_node_append_value( - libcdata_tree_node_t *node, - intptr_t *value, - libcerror_error_t **error ); - -int libcdata_btree_node_insert_value( - libcdata_tree_node_t *node, - intptr_t *value, - int (*value_compare_function)( - intptr_t *first_value, - intptr_t *second_value, - libcerror_error_t **error ), - libcerror_error_t **error ); - -int libcdata_btree_node_replace_value( - libcdata_tree_node_t *node, - intptr_t *value, - intptr_t *replacement_value, - libcerror_error_t **error ); - -int libcdata_btree_node_remove_value( - libcdata_tree_node_t *node, - intptr_t *value, - intptr_t *replacement_value, - libcerror_error_t **error ); - -int libcdata_btree_node_split( - libcdata_tree_node_t *node, - libcerror_error_t **error ); - LIBCDATA_EXTERN \ int libcdata_btree_get_number_of_values( libcdata_btree_t *tree, diff -Nru libbde-20190102/libcdata/libcdata_btree_node.c libbde-20240223/libcdata/libcdata_btree_node.c --- libbde-20190102/libcdata/libcdata_btree_node.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_btree_node.c 2024-02-23 03:03:24.000000000 +0000 @@ -0,0 +1,1607 @@ +/* + * Balanced tree node functions + * + * Copyright (C) 2006-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include "libcdata_array.h" +#include "libcdata_btree_node.h" +#include "libcdata_btree_values_list.h" +#include "libcdata_definitions.h" +#include "libcdata_libcerror.h" +#include "libcdata_list.h" +#include "libcdata_list_element.h" +#include "libcdata_tree_node.h" +#include "libcdata_types.h" + +/* Retrieves the sub node for the specific value + * + * Uses the value_compare_function to determine the similarity of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, + * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error + * + * If value_compare_function is NULL the pointer of the value is used to check for a match + * + * Returns 1 if successful, 0 if the value does not exist or -1 on error + * If there was no possible sub match values_list_element is set to NULL + * it there is a possible sub match values_list_element is set but 0 is returned + * If the node is a leaf node sub_node is not set to NULL + */ +int libcdata_btree_node_get_sub_node_by_value( + libcdata_tree_node_t *node, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + libcdata_tree_node_t **sub_node, + libcdata_list_element_t **values_list_element, + libcerror_error_t **error ) +{ + libcdata_list_t *values_list = NULL; + libcdata_list_element_t *safe_values_list_element = NULL; + libcdata_tree_node_t *safe_sub_node = NULL; + intptr_t *values_list_value = NULL; + static char *function = "libcdata_btree_node_get_sub_node_by_value"; + int number_of_sub_nodes = 0; + int number_of_values_list_elements = 0; + int result = 0; + int sub_node_index = 0; + int values_list_element_index = 0; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value.", + function ); + + return( -1 ); + } + if( sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid sub node.", + function ); + + return( -1 ); + } + if( values_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list element.", + function ); + + return( -1 ); + } + *sub_node = NULL; + *values_list_element = NULL; + + if( libcdata_tree_node_get_value( + node, + (intptr_t **) &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve values list.", + function ); + + return( -1 ); + } + if( values_list != NULL ) + { + if( libcdata_list_get_number_of_elements( + values_list, + &number_of_values_list_elements, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of values list elements.", + function ); + + return( -1 ); + } + } + if( libcdata_tree_node_get_number_of_sub_nodes( + node, + &number_of_sub_nodes, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of sub nodes.", + function ); + + return( -1 ); + } + if( ( number_of_sub_nodes != 0 ) + && ( ( number_of_values_list_elements + 1 ) != number_of_sub_nodes ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid number of values list elements value out of bounds.", + function ); + + return( -1 ); + } + if( number_of_values_list_elements == 0 ) + { + return( 0 ); + } + if( libcdata_list_get_first_element( + values_list, + &safe_values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve first values list element.", + function ); + + return( -1 ); + } + if( number_of_sub_nodes != 0 ) + { + if( libcdata_tree_node_get_sub_node_by_index( + node, + 0, + &safe_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub node: 0.", + function ); + + return( -1 ); + } + } + for( values_list_element_index = 0; + values_list_element_index < number_of_values_list_elements; + values_list_element_index++ ) + { + if( libcdata_list_element_get_value( + safe_values_list_element, + &values_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from values list element: %d.", + function, + values_list_element_index ); + + return( -1 ); + } + if( values_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid values list element: %d - missing value.", + function, + values_list_element_index ); + + return( -1 ); + } + if( value_compare_function != NULL ) + { + result = value_compare_function( + value, + values_list_value, + error ); + } + else if( value == values_list_value ) + { + result = LIBCDATA_COMPARE_EQUAL; + } + else + { + result = LIBCDATA_COMPARE_GREATER; + } + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to compare value with values list value: %d.", + function, + values_list_element_index ); + + return( -1 ); + } + else if( result == LIBCDATA_COMPARE_EQUAL ) + { + *sub_node = safe_sub_node; + *values_list_element = safe_values_list_element; + + return( 1 ); + } + else if( result == LIBCDATA_COMPARE_LESS ) + { + break; + } + else if( result != LIBCDATA_COMPARE_GREATER ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported value compare function return value: %d.", + function, + result ); + + return( -1 ); + } + if( libcdata_list_element_get_next_element( + safe_values_list_element, + &safe_values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from values list element: %d.", + function, + values_list_element_index ); + + return( -1 ); + } + if( number_of_sub_nodes != 0 ) + { + if( libcdata_tree_node_get_next_node( + safe_sub_node, + &safe_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next node from sub node: %d.", + function, + sub_node_index ); + + return( -1 ); + } + sub_node_index++; + } + } + *sub_node = safe_sub_node; + *values_list_element = safe_values_list_element; + + return( 0 ); +} + +/* Retrieves the upper node for the specific value + * + * Uses the value_compare_function to determine the similarity of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, + * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error + * + * Returns 1 if successful, 0 if the value does not exist or -1 on error + */ +int libcdata_btree_node_get_upper_node_by_value( + libcdata_tree_node_t *node, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + libcdata_tree_node_t **upper_node, + libcdata_list_element_t **values_list_element, + libcerror_error_t **error ) +{ + libcdata_list_element_t *sub_values_list_element = NULL; + libcdata_tree_node_t *sub_node = NULL; + static char *function = "libcdata_btree_node_get_upper_node_by_value"; + int result = 0; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value.", + function ); + + return( -1 ); + } + if( value_compare_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value compare function.", + function ); + + return( -1 ); + } + if( upper_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid upper node.", + function ); + + return( -1 ); + } + if( values_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list element.", + function ); + + return( -1 ); + } + *upper_node = NULL; + *values_list_element = NULL; + + result = libcdata_btree_node_get_sub_node_by_value( + node, + value, + value_compare_function, + &sub_node, + &sub_values_list_element, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub node by value.", + function ); + + return( -1 ); + } + else if( sub_node != NULL ) + { + result = libcdata_btree_node_get_upper_node_by_value( + sub_node, + value, + value_compare_function, + upper_node, + values_list_element, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve upper node in sub node.", + function ); + + return( -1 ); + } + } + else if( result != 0 ) + { + *values_list_element = sub_values_list_element; + } + if( *upper_node == NULL ) + { + *upper_node = node; + } + return( result ); +} + +/* Appends a value into a tree node + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_node_append_value( + libcdata_tree_node_t *node, + intptr_t *value, + libcerror_error_t **error ) +{ + libcdata_list_t *values_list = NULL; + static char *function = "libcdata_btree_node_append_value"; + + if( libcdata_tree_node_get_value( + node, + (intptr_t **) &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve values list.", + function ); + + return( -1 ); + } + if( values_list == NULL ) + { + if( libcdata_list_initialize( + &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create values list.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_set_value( + node, + (intptr_t *) values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set values list.", + function ); + + libcdata_list_free( + &values_list, + NULL, + NULL ); + + return( -1 ); + } + } + if( libcdata_list_append_value( + values_list, + value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append value to values list.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Inserts a value into a tree node + * The tree node must be the most upper node (leaf) + * + * Uses the value_compare_function to determine the order of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, + * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error + * + * Returns 1 if successful, 0 if the value already exists or -1 on error + */ +int libcdata_btree_node_insert_value( + libcdata_tree_node_t *node, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + libcerror_error_t **error ) +{ + libcdata_list_t *values_list = NULL; + static char *function = "libcdata_btree_node_insert_value"; + int number_of_sub_nodes = 0; + int result = 0; + + if( libcdata_tree_node_get_number_of_sub_nodes( + node, + &number_of_sub_nodes, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of sub nodes.", + function ); + + return( -1 ); + } + if( number_of_sub_nodes != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: cannot insert value in node with sub nodes.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_value( + node, + (intptr_t **) &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve values list.", + function ); + + return( -1 ); + } + if( values_list == NULL ) + { + if( libcdata_list_initialize( + &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create values list.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_set_value( + node, + (intptr_t *) values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set values list.", + function ); + + libcdata_list_free( + &values_list, + NULL, + NULL ); + + return( -1 ); + } + } + result = libcdata_list_insert_value( + values_list, + value, + value_compare_function, + LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert value in values list.", + function ); + + return( -1 ); + } + return( result ); +} + +/* Replaces a value in the tree node + * The tree node must be the most upper node (leaf) in the first call + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_node_replace_value( + libcdata_tree_node_t *node, + intptr_t *value, + intptr_t *replacement_value, + libcerror_error_t **error ) +{ + libcdata_list_element_t *values_list_element = NULL; + libcdata_tree_node_t *parent_node = NULL; + libcdata_tree_node_t *sub_node = NULL; + static char *function = "libcdata_btree_node_replace_value"; + int result = 0; + + if( value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value.", + function ); + + return( -1 ); + } + if( replacement_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid replacement value.", + function ); + + return( -1 ); + } + result = libcdata_btree_node_get_sub_node_by_value( + node, + value, + NULL, + &sub_node, + &values_list_element, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub node by value.", + function ); + + return( -1 ); + } + else if( result != 0 ) + { + if( libcdata_list_element_set_value( + values_list_element, + replacement_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set value in values list element.", + function ); + + return( -1 ); + } + } + if( libcdata_tree_node_get_parent_node( + node, + &parent_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve parent node.", + function ); + + return( -1 ); + } + if( parent_node != NULL ) + { + if( libcdata_btree_node_replace_value( + parent_node, + value, + replacement_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to replace value in parent node.", + function ); + + return( -1 ); + } + } + return( 1 ); +} + +/* Flattens a tree node and its sub node + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_node_flatten_node( + libcdata_tree_node_t **node, + libcerror_error_t **error ) +{ + libcdata_tree_node_t *sub_node = NULL; + static char *function = "libcdata_btree_node_flatten_node"; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_first_sub_node( + *node, + &sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve first sub node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_remove_node( + *node, + sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove sub node from node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_replace_node( + *node, + sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to replace node with sub node.", + function ); + + libcdata_tree_node_append_node( + *node, + sub_node, + NULL ); + + return( -1 ); + } + if( libcdata_tree_node_free( + node, + (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_values_list_free, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free node.", + function ); + + return( -1 ); + } + *node = sub_node; + + return( 1 ); +} + +/* Removes a sub node from the B-tree node + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_node_remove_sub_node( + libcdata_tree_node_t *node, + libcdata_tree_node_t **sub_node, + libcerror_error_t **error ) +{ + static char *function = "libcdata_btree_node_remove_sub_node"; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid sub node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_remove_node( + node, + *sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove sub node from node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_free( + sub_node, + (int (*)(intptr_t **, libcerror_error_t **)) &libcdata_btree_values_list_free, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free sub node.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Removes a value from the tree node + * The tree node must be the most upper node (leaf) in the first call + * Returns 1 if successful, 0 if no such value or -1 on error + */ +int libcdata_btree_node_remove_value( + libcdata_tree_node_t *node, + intptr_t *value, + intptr_t *replacement_value, + libcerror_error_t **error ) +{ + libcdata_list_t *sub_node_values_list = NULL; + libcdata_list_t *values_list = NULL; + libcdata_list_element_t *values_list_element = NULL; + libcdata_tree_node_t *parent_node = NULL; + libcdata_tree_node_t *sub_node = NULL; + static char *function = "libcdata_btree_node_remove_value"; + int number_of_sub_nodes = 0; + int number_of_values_list_elements = 0; + int result = 0; + int sub_node_number_of_sub_nodes = 0; + int sub_node_number_of_values_list_elements = 0; + + if( value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value.", + function ); + + return( -1 ); + } + result = libcdata_btree_node_get_sub_node_by_value( + node, + value, + NULL, + &sub_node, + &values_list_element, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub node by value.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_value( + node, + (intptr_t **) &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve values list.", + function ); + + return( -1 ); + } + if( libcdata_list_get_number_of_elements( + values_list, + &number_of_values_list_elements, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of values list elements.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_number_of_sub_nodes( + node, + &number_of_sub_nodes, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of sub nodes.", + function ); + + return( -1 ); + } + if( sub_node != NULL ) + { + if( libcdata_tree_node_get_value( + sub_node, + (intptr_t **) &sub_node_values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub node values list.", + function ); + + return( -1 ); + } + if( libcdata_list_get_number_of_elements( + sub_node_values_list, + &sub_node_number_of_values_list_elements, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub node number of values list elements.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_number_of_sub_nodes( + sub_node, + &sub_node_number_of_sub_nodes, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of sub nodes.", + function ); + + return( -1 ); + } + /* If the sub node is empty remove it + */ + if( ( sub_node_number_of_sub_nodes == 0 ) + && ( sub_node_number_of_values_list_elements == 0 ) ) + { + if( libcdata_btree_node_remove_sub_node( + node, + &sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove remaining sub node from node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_number_of_sub_nodes( + node, + &number_of_sub_nodes, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of sub nodes.", + function ); + + return( -1 ); + } + if( values_list_element == NULL ) + { + if( libcdata_list_get_last_element( + values_list, + &values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve last values list element.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_value( + values_list_element, + &replacement_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from last values list element.", + function ); + + return( -1 ); + } + } + if( values_list_element != NULL ) + { + if( libcdata_btree_values_list_remove_element( + values_list, + &values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove element from values list.", + function ); + + return( -1 ); + } + if( libcdata_list_get_number_of_elements( + values_list, + &number_of_values_list_elements, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of values list elements.", + function ); + + return( -1 ); + } + } + } + } + if( number_of_sub_nodes != 0 ) + { + if( ( number_of_values_list_elements + 1 ) != number_of_sub_nodes ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid number of values list elements value out of bounds.", + function ); + + return( -1 ); + } + /* If one sub node remains flatten the node + */ + if( number_of_sub_nodes == 1 ) + { + if( libcdata_btree_node_flatten_node( + &node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to flatten node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_value( + node, + (intptr_t **) &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve values list.", + function ); + + return( -1 ); + } + } + /* If the sub node contains more than one values list elements + * use the replacement value determined in the sub node + */ + else if( values_list_element != NULL ) + { + if( replacement_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid replacement value.", + function ); + + return( -1 ); + } + if( libcdata_list_element_set_value( + values_list_element, + replacement_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set value in values list element.", + function ); + + return( -1 ); + } + } + } + /* In a leaf node remove the values list element from the list + */ + else if( values_list_element != NULL ) + { + if( libcdata_btree_values_list_replace_element_with_previous( + values_list, + &values_list_element, + &replacement_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to replace values list element with previous.", + function ); + + return( -1 ); + } + } + if( libcdata_tree_node_get_parent_node( + node, + &parent_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve parent node.", + function ); + + return( -1 ); + } + if( parent_node != NULL ) + { + if( libcdata_btree_node_remove_value( + parent_node, + value, + replacement_value, + error ) == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove value from parent node.", + function ); + + return( -1 ); + } + } + return( result ); +} + +/* Splits the node + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_node_split( + libcdata_tree_node_t *node, + libcerror_error_t **error ) +{ + libcdata_list_t *split_values_list = NULL; + libcdata_list_t *values_list = NULL; + libcdata_list_element_t *values_list_element = NULL; + libcdata_tree_node_t *sub_node = NULL; + intptr_t *values_list_value = NULL; + static char *function = "libcdata_btree_node_split"; + int number_of_split_values_list_elements = 0; + int number_of_sub_nodes = 0; + int number_of_values_list_elements = 0; + int split_values_list_element_index = 0; + int sub_node_index = 0; + int values_list_element_index = 0; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_number_of_sub_nodes( + node, + &number_of_sub_nodes, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of sub nodes.", + function ); + + goto on_error; + } + if( number_of_sub_nodes != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: cannot split node with sub nodes.", + function ); + + goto on_error; + } + if( libcdata_tree_node_get_value( + node, + (intptr_t **) &values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve values list.", + function ); + + goto on_error; + } + /* Split to have about 25 values per sub node + */ + number_of_split_values_list_elements = 25; + + if( libcdata_list_initialize( + &split_values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create split values list.", + function ); + + goto on_error; + } + if( libcdata_tree_node_set_value( + node, + (intptr_t *) split_values_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set split values list.", + function ); + + goto on_error; + } + if( libcdata_list_get_number_of_elements( + values_list, + &number_of_values_list_elements, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of values list elements.", + function ); + + goto on_error; + } + if( libcdata_list_get_first_element( + values_list, + &values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve first values list element.", + function ); + + goto on_error; + } + for( values_list_element_index = 0; + values_list_element_index < number_of_values_list_elements; + values_list_element_index++ ) + { + if( libcdata_list_element_get_value( + values_list_element, + &values_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from values list element: %d.", + function, + values_list_element_index ); + + goto on_error; + } + if( values_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid values list element: %d - missing value.", + function, + values_list_element_index ); + + goto on_error; + } + if( sub_node == NULL ) + { + if( libcdata_tree_node_initialize( + &sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create sub node: %d.", + function, + sub_node_index ); + + goto on_error; + } + } + if( libcdata_btree_node_append_value( + sub_node, + values_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append value: %d to sub node: %d.", + function, + values_list_element_index, + sub_node_index ); + + goto on_error; + } + if( values_list_element_index >= split_values_list_element_index ) + { + if( ( values_list_element_index + 1 ) < number_of_values_list_elements ) + { + if( libcdata_list_append_value( + split_values_list, + values_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append value: %d to sub nodes values list.", + function, + values_list_element_index ); + + goto on_error; + } + } + split_values_list_element_index += number_of_split_values_list_elements; + + if( libcdata_tree_node_append_node( + node, + sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append sub node: %d to node.", + function, + sub_node_index ); + + goto on_error; + } + sub_node = NULL; + + sub_node_index++; + } + if( libcdata_list_element_get_next_element( + values_list_element, + &values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from values list element: %d.", + function, + values_list_element_index ); + + goto on_error; + } + } + if( sub_node != NULL ) + { + if( libcdata_tree_node_append_node( + node, + sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append sub node: %d to node.", + function, + sub_node_index ); + + goto on_error; + } + sub_node = NULL; + + sub_node_index++; + } + split_values_list = NULL; + + if( libcdata_list_free( + &values_list, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free values list.", + function ); + + goto on_error; + } + return( 1 ); + +on_error: + if( sub_node != NULL ) + { + libcdata_tree_node_remove_node( + node, + sub_node, + NULL ); + libcdata_tree_node_free( + &sub_node, + NULL, + NULL ); + } + if( split_values_list != NULL ) + { + libcdata_tree_node_empty( + node, + NULL, + NULL ); + libcdata_tree_node_set_value( + node, + (intptr_t *) values_list, + NULL ); + libcdata_list_free( + &split_values_list, + NULL, + NULL ); + } + return( -1 ); +} + + diff -Nru libbde-20190102/libcdata/libcdata_btree_node.h libbde-20240223/libcdata/libcdata_btree_node.h --- libbde-20190102/libcdata/libcdata_btree_node.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_btree_node.h 2024-02-23 03:03:24.000000000 +0000 @@ -0,0 +1,101 @@ +/* + * Balanced tree node functions + * + * Copyright (C) 2006-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBCDATA_BTREE_NODE_H ) +#define _LIBCDATA_BTREE_NODE_H + +#include +#include + +#include "libcdata_libcerror.h" +#include "libcdata_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libcdata_btree_node_get_sub_node_by_value( + libcdata_tree_node_t *node, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + libcdata_tree_node_t **sub_node, + libcdata_list_element_t **values_list_element, + libcerror_error_t **error ); + +int libcdata_btree_node_get_upper_node_by_value( + libcdata_tree_node_t *node, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + libcdata_tree_node_t **upper_node, + libcdata_list_element_t **values_list_element, + libcerror_error_t **error ); + +int libcdata_btree_node_append_value( + libcdata_tree_node_t *node, + intptr_t *value, + libcerror_error_t **error ); + +int libcdata_btree_node_insert_value( + libcdata_tree_node_t *node, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + libcerror_error_t **error ); + +int libcdata_btree_node_replace_value( + libcdata_tree_node_t *node, + intptr_t *value, + intptr_t *replacement_value, + libcerror_error_t **error ); + +int libcdata_btree_node_flatten_node( + libcdata_tree_node_t **node, + libcerror_error_t **error ); + +int libcdata_btree_node_remove_sub_node( + libcdata_tree_node_t *node, + libcdata_tree_node_t **sub_node, + libcerror_error_t **error ); + +int libcdata_btree_node_remove_value( + libcdata_tree_node_t *node, + intptr_t *value, + intptr_t *replacement_value, + libcerror_error_t **error ); + +int libcdata_btree_node_split( + libcdata_tree_node_t *node, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBCDATA_BTREE_NODE_H ) */ + diff -Nru libbde-20190102/libcdata/libcdata_btree_values_list.c libbde-20240223/libcdata/libcdata_btree_values_list.c --- libbde-20190102/libcdata/libcdata_btree_values_list.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_btree_values_list.c 2024-02-23 03:03:24.000000000 +0000 @@ -0,0 +1,217 @@ +/* + * Balanced tree values list functions + * + * Copyright (C) 2006-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include "libcdata_btree_values_list.h" +#include "libcdata_libcerror.h" +#include "libcdata_list.h" +#include "libcdata_list_element.h" +#include "libcdata_types.h" + +/* Frees a B-tree values list + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_values_list_free( + libcdata_list_t **values_list, + libcerror_error_t **error ) +{ + static char *function = "libcdata_btree_values_list_free"; + int result = 1; + + if( values_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list.", + function ); + + return( -1 ); + } + if( libcdata_list_free( + values_list, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free values list.", + function ); + + result = -1; + } + return( result ); +} + +/* Removes an element from the values list + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_values_list_remove_element( + libcdata_list_t *values_list, + libcdata_list_element_t **values_list_element, + libcerror_error_t **error ) +{ + static char *function = "libcdata_btree_values_list_remove_element"; + + if( values_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list.", + function ); + + return( -1 ); + } + if( values_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list element.", + function ); + + return( -1 ); + } + if( libcdata_list_remove_element( + values_list, + *values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove element from values list.", + function ); + + return( -1 ); + } + if( libcdata_list_element_free( + values_list_element, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free element.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Replaces the values list element with the previous element + * If available replacement_value is set to the value of the previous element + * Returns 1 if successful or -1 on error + */ +int libcdata_btree_values_list_replace_element_with_previous( + libcdata_list_t *values_list, + libcdata_list_element_t **values_list_element, + intptr_t **replacement_value, + libcerror_error_t **error ) +{ + libcdata_list_element_t *previous_element = NULL; + static char *function = "libcdata_btree_values_list_replace_element_with_previous"; + + if( values_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list.", + function ); + + return( -1 ); + } + if( values_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid values list element.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_previous_element( + *values_list_element, + &previous_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous element from values list element.", + function ); + + return( -1 ); + } + if( previous_element != NULL ) + { + if( libcdata_list_element_get_value( + previous_element, + replacement_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from previous element.", + function ); + + return( -1 ); + } + } + if( libcdata_btree_values_list_remove_element( + values_list, + values_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove element from values list.", + function ); + + return( -1 ); + } + *values_list_element = previous_element; + + return( 1 ); +} + diff -Nru libbde-20190102/libcdata/libcdata_btree_values_list.h libbde-20240223/libcdata/libcdata_btree_values_list.h --- libbde-20190102/libcdata/libcdata_btree_values_list.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_btree_values_list.h 2024-02-23 03:03:24.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Balanced tree values list functions + * + * Copyright (C) 2006-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBCDATA_BTREE_VALUES_LIST_H ) +#define _LIBCDATA_BTREE_VALUES_LIST_H + +#include +#include + +#include "libcdata_libcerror.h" +#include "libcdata_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libcdata_btree_values_list_free( + libcdata_list_t **values_list, + libcerror_error_t **error ); + +int libcdata_btree_values_list_remove_element( + libcdata_list_t *values_list, + libcdata_list_element_t **values_list_element, + libcerror_error_t **error ); + +int libcdata_btree_values_list_replace_element_with_previous( + libcdata_list_t *values_list, + libcdata_list_element_t **values_list_element, + intptr_t **replacement_value, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBCDATA_BTREE_VALUES_LIST_H ) */ + diff -Nru libbde-20190102/libcdata/libcdata_definitions.h libbde-20240223/libcdata/libcdata_definitions.h --- libbde-20190102/libcdata/libcdata_definitions.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_definitions.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCDATA_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCDATA_VERSION 20181216 +#define LIBCDATA_VERSION 20240103 /* The libcdata version string */ -#define LIBCDATA_VERSION_STRING "20181216" +#define LIBCDATA_VERSION_STRING "20240103" /* The comparison function definitions */ @@ -73,5 +73,9 @@ #endif /* !defined( HAVE_LOCAL_LIBCDATA ) */ +/* Limiting the maximum size of the array entries to 128 MiB + */ +#define LIBCDATA_ARRAY_ENTRIES_MEMORY_LIMIT 128 * 1024 * 1024 + #endif /* !defined( LIBCDATA_INTERNAL_DEFINITIONS_H ) */ diff -Nru libbde-20190102/libcdata/libcdata_error.c libbde-20240223/libcdata/libcdata_error.c --- libbde-20190102/libcdata/libcdata_error.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_error.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcdata/libcdata_error.h libbde-20240223/libcdata/libcdata_error.h --- libbde-20190102/libcdata/libcdata_error.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_error.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcdata/libcdata_extern.h libbde-20240223/libcdata/libcdata_extern.h --- libbde-20190102/libcdata/libcdata_extern.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_extern.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCDATA_EXTERN_VARIABLE extern +#else #define LIBCDATA_EXTERN_VARIABLE LIBCDATA_EXTERN +#endif #else #define LIBCDATA_EXTERN /* extern */ diff -Nru libbde-20190102/libcdata/libcdata_libcerror.h libbde-20240223/libcdata/libcdata_libcerror.h --- libbde-20190102/libcdata/libcdata_libcerror.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_libcerror.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_LIBCERROR_H ) diff -Nru libbde-20190102/libcdata/libcdata_libcthreads.h libbde-20240223/libcdata/libcdata_libcthreads.h --- libbde-20190102/libcdata/libcdata_libcthreads.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_libcthreads.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcthreads header wrapper * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_LIBCTHREADS_H ) diff -Nru libbde-20190102/libcdata/libcdata_list.c libbde-20240223/libcdata/libcdata_list.c --- libbde-20190102/libcdata/libcdata_list.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_list.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * List functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -103,7 +103,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -258,7 +258,9 @@ function, element_index ); - goto on_error; + result = -1; + + break; } internal_list->first_element = next_element; @@ -266,7 +268,7 @@ { internal_list->last_element = next_element; } - internal_list->number_of_elements--; + internal_list->number_of_elements -= 1; if( next_element != NULL ) { @@ -283,7 +285,7 @@ function, element_index + 1 ); - goto on_error; + result = -1; } } if( libcdata_list_element_set_next_element( @@ -299,7 +301,7 @@ function, element_index ); - goto on_error; + result = -1; } if( libcdata_list_element_free( &list_element, @@ -331,18 +333,10 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + result = -1; } #endif return( result ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - NULL ); -#endif - return( -1 ); } /* Clones the list and its elements @@ -423,45 +417,45 @@ } internal_source_list = (libcdata_internal_list_t *) source_list; - if( libcdata_list_initialize( - (libcdata_list_t **) &internal_destination_list, +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_source_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination list.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } - if( internal_destination_list == NULL ) +#endif + if( libcdata_list_initialize( + (libcdata_list_t **) &internal_destination_list, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing destination list.", + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create destination list.", function ); - return( -1 ); + goto on_error; } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_read( - internal_source_list->read_write_lock, - error ) != 1 ) + if( internal_destination_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for reading.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing destination list.", function ); - return( -1 ); + goto on_error; } -#endif if( internal_source_list->first_element != NULL ) { internal_source_list_element = (libcdata_internal_list_element_t *) internal_source_list->first_element; @@ -704,7 +698,6 @@ } /* Sets the first element in the list - * This function is not multi-thread safe acquire write lock before call * Returns 1 if successful or -1 on error */ int libcdata_internal_list_set_first_element( @@ -712,7 +705,8 @@ libcdata_list_element_t *element, libcerror_error_t **error ) { - static char *function = "libcdata_internal_list_set_first_element"; + libcdata_list_element_t *backup_first_element = NULL; + static char *function = "libcdata_internal_list_set_first_element"; if( internal_list == NULL ) { @@ -725,6 +719,8 @@ return( -1 ); } + backup_first_element = internal_list->first_element; + if( element != NULL ) { if( libcdata_list_element_set_next_element( @@ -736,10 +732,10 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next element of list element.", + "%s: unable to set next element of element.", function ); - return( -1 ); + goto on_error; } } if( internal_list->first_element != NULL ) @@ -756,84 +752,31 @@ "%s: unable to set previous element of first element.", function ); - return( -1 ); + goto on_error; } } internal_list->first_element = element; return( 1 ); -} -/* Sets the first element in the list - * Returns 1 if successful or -1 on error - */ -int libcdata_list_set_first_element( - libcdata_list_t *list, - libcdata_list_element_t *element, - libcerror_error_t **error ) -{ - libcdata_internal_list_t *internal_list = NULL; - static char *function = "libcdata_list_set_first_element"; - int result = 1; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libcdata_internal_list_t *) list; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_list->read_write_lock, - error ) != 1 ) +on_error: + if( element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); + libcdata_list_element_set_next_element( + element, + NULL, + NULL ); } -#endif - if( libcdata_internal_list_set_first_element( - internal_list, - element, - error ) != 1 ) + if( backup_first_element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set first element.", - function ); - - result = -1; + libcdata_list_element_set_next_element( + backup_first_element, + NULL, + NULL ); } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + internal_list->first_element = backup_first_element; - return( -1 ); - } -#endif - return( result ); + return( -1 ); } /* Retrieves the last elements in the list @@ -907,7 +850,6 @@ } /* Sets the last element in the list - * This function is not multi-thread safe acquire write lock before call * Returns 1 if successful or -1 on error */ int libcdata_internal_list_set_last_element( @@ -915,7 +857,8 @@ libcdata_list_element_t *element, libcerror_error_t **error ) { - static char *function = "libcdata_internal_list_set_last_element"; + libcdata_list_element_t *backup_last_element = NULL; + static char *function = "libcdata_internal_list_set_last_element"; if( internal_list == NULL ) { @@ -928,6 +871,8 @@ return( -1 ); } + backup_last_element = internal_list->last_element; + if( element != NULL ) { if( libcdata_list_element_set_previous_element( @@ -939,10 +884,10 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous element of list element.", + "%s: unable to set previous element of element.", function ); - return( -1 ); + goto on_error; } } if( internal_list->last_element != NULL ) @@ -959,84 +904,31 @@ "%s: unable to set next element of last element.", function ); - return( -1 ); + goto on_error; } } internal_list->last_element = element; return( 1 ); -} - -/* Sets the last element in the list - * Returns 1 if successful or -1 on error - */ -int libcdata_list_set_last_element( - libcdata_list_t *list, - libcdata_list_element_t *element, - libcerror_error_t **error ) -{ - libcdata_internal_list_t *internal_list = NULL; - static char *function = "libcdata_list_set_last_element"; - int result = 1; - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libcdata_internal_list_t *) list; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_list->read_write_lock, - error ) != 1 ) +on_error: + if( element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); + libcdata_list_element_set_previous_element( + element, + NULL, + NULL ); } -#endif - if( libcdata_internal_list_set_last_element( - internal_list, - element, - error ) != 1 ) + if( backup_last_element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set last element.", - function ); - - result = -1; + libcdata_list_element_set_next_element( + backup_last_element, + NULL, + NULL ); } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + internal_list->last_element = backup_last_element; - return( -1 ); - } -#endif - return( result ); + return( -1 ); } /* Retrieves a specific element from the list @@ -1271,8 +1163,16 @@ libcdata_list_element_t *element, libcerror_error_t **error ) { - libcdata_internal_list_t *internal_list = NULL; - static char *function = "libcdata_list_prepend_element"; + libcdata_internal_list_t *internal_list = NULL; + libcdata_list_element_t *next_element = NULL; + libcdata_list_element_t *previous_element = NULL; + static char *function = "libcdata_list_prepend_element"; + int result = 1; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_last_element = NULL; +#endif if( list == NULL ) { @@ -1287,6 +1187,56 @@ } internal_list = (libcdata_internal_list_t *) list; + if( internal_list->number_of_elements == 0 ) + { + if( internal_list->first_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first element already set.", + function ); + + return( -1 ); + } + if( internal_list->last_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last element already set.", + function ); + + return( -1 ); + } + } + else + { + if( internal_list->first_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first element.", + function ); + + return( -1 ); + } + if( internal_list->last_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last element.", + function ); + + return( -1 ); + } + } if( element == NULL ) { libcerror_error_set( @@ -1298,6 +1248,33 @@ return( -1 ); } + if( libcdata_list_element_get_elements( + element, + &previous_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous and next element from list element.", + function ); + + return( -1 ); + } + if( ( previous_element != NULL ) + || ( next_element != NULL ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: list element already part of a list.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, @@ -1312,27 +1289,63 @@ return( -1 ); } + backup_first_element = internal_list->first_element; + backup_last_element = internal_list->last_element; + #endif - if( internal_list->last_element == NULL ) - { - internal_list->last_element = element; - } - if( libcdata_internal_list_set_first_element( - internal_list, - element, - error ) != 1 ) + result = libcdata_list_element_set_next_element( + element, + internal_list->first_element, + error ); + + if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set first element.", + "%s: unable to set next element of list element.", function ); - goto on_error; + result = -1; + } + if( result == 1 ) + { + if( internal_list->first_element != NULL ) + { + result = libcdata_list_element_set_previous_element( + internal_list->first_element, + element, + error ); + + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous element of first element.", + function ); + + libcdata_list_element_set_next_element( + element, + NULL, + NULL ); + + result = -1; + } + } } - internal_list->number_of_elements++; + if( result == 1 ) + { + internal_list->first_element = element; + if( internal_list->last_element == NULL ) + { + internal_list->last_element = element; + } + internal_list->number_of_elements += 1; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, @@ -1345,18 +1358,32 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + libcdata_list_element_set_next_element( + element, + NULL, + NULL ); + + libcdata_list_element_set_previous_element( + backup_first_element, + NULL, + NULL ); + + internal_list->first_element = backup_first_element; + internal_list->last_element = backup_last_element; + + internal_list->number_of_elements -= 1; + } return( -1 ); +#endif } /* Prepends a value to the list @@ -1428,14 +1455,23 @@ /* Appends a list element to the list * Returns 1 if successful or -1 on error */ -int libcdata_internal_list_append_element( - libcdata_internal_list_t *internal_list, +int libcdata_list_append_element( + libcdata_list_t *list, libcdata_list_element_t *element, libcerror_error_t **error ) { - static char *function = "libcdata_internal_list_append_element"; + libcdata_internal_list_t *internal_list = NULL; + libcdata_list_element_t *next_element = NULL; + libcdata_list_element_t *previous_element = NULL; + static char *function = "libcdata_list_append_element"; + int result = 1; - if( internal_list == NULL ) +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_last_element = NULL; +#endif + + if( list == NULL ) { libcerror_error_set( error, @@ -1446,65 +1482,85 @@ return( -1 ); } - if( element == NULL ) + internal_list = (libcdata_internal_list_t *) list; + + if( internal_list->number_of_elements == 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list element.", - function ); + if( internal_list->first_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first element already set.", + function ); - return( -1 ); + return( -1 ); + } + if( internal_list->last_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last element already set.", + function ); + + return( -1 ); + } } - if( internal_list->first_element == NULL ) + else { - internal_list->first_element = element; + if( internal_list->first_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first element.", + function ); + + return( -1 ); + } + if( internal_list->last_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last element.", + function ); + + return( -1 ); + } } - if( libcdata_internal_list_set_last_element( - internal_list, + if( libcdata_list_element_get_elements( element, + &previous_element, + &next_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set last element.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous and next element from list element.", function ); return( -1 ); } - internal_list->number_of_elements++; - - return( 1 ); -} - -/* Appends a list element to the list - * Returns 1 if successful or -1 on error - */ -int libcdata_list_append_element( - libcdata_list_t *list, - libcdata_list_element_t *element, - libcerror_error_t **error ) -{ - libcdata_internal_list_t *internal_list = NULL; - static char *function = "libcdata_list_append_element"; - int result = 1; - - if( list == NULL ) + if( ( previous_element != NULL ) + || ( next_element != NULL ) ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: list element already part of a list.", function ); return( -1 ); } - internal_list = (libcdata_internal_list_t *) list; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, @@ -1519,21 +1575,63 @@ return( -1 ); } + backup_first_element = internal_list->first_element; + backup_last_element = internal_list->last_element; + #endif - if( libcdata_internal_list_append_element( - internal_list, - element, - error ) != 1 ) + result = libcdata_list_element_set_previous_element( + element, + internal_list->last_element, + error ); + + if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append element to list.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous element of list element.", function ); result = -1; } + if( result == 1 ) + { + if( internal_list->last_element != NULL ) + { + result = libcdata_list_element_set_next_element( + internal_list->last_element, + element, + error ); + + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next element of last element.", + function ); + + libcdata_list_element_set_previous_element( + element, + NULL, + NULL ); + + result = -1; + } + } + } + if( result == 1 ) + { + if( internal_list->first_element == NULL ) + { + internal_list->first_element = element; + } + internal_list->last_element = element; + + internal_list->number_of_elements += 1; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, @@ -1546,10 +1644,32 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( result ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + if( result == 1 ) + { + libcdata_list_element_set_previous_element( + element, + NULL, + NULL ); + + libcdata_list_element_set_next_element( + backup_last_element, + NULL, + NULL ); + + internal_list->first_element = backup_first_element; + internal_list->last_element = backup_last_element; + + internal_list->number_of_elements -= 1; + } + return( -1 ); +#endif } /* Appends a value to the list @@ -1561,38 +1681,9 @@ intptr_t *value, libcerror_error_t **error ) { - libcdata_internal_list_t *internal_list = NULL; - libcdata_list_element_t *element = NULL; - static char *function = "libcdata_list_append_value"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); + libcdata_list_element_t *element = NULL; + static char *function = "libcdata_list_append_value"; - return( -1 ); - } - internal_list = (libcdata_internal_list_t *) list; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_list->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif if( libcdata_list_element_initialize( &element, error ) != 1 ) @@ -1620,8 +1711,8 @@ goto on_error; } - if( libcdata_internal_list_append_element( - internal_list, + if( libcdata_list_append_element( + list, element, error ) != 1 ) { @@ -1634,29 +1725,9 @@ goto on_error; } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); - - return( -1 ); - } -#endif return( 1 ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - NULL ); -#endif if( element != NULL ) { libcdata_list_element_free( @@ -1667,7 +1738,7 @@ return( -1 ); } -/* Inserts a list element into the list +/* Retrieves the element which the element should be inserted before * * Uses the value_compare_function to determine the order of the entries * The value_compare_function should return LIBCDATA_COMPARE_LESS, @@ -1676,27 +1747,28 @@ * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * - * Returns 1 if successful, 0 if the list element already exists or -1 on error + * On return element will be set to NULL if the element should be inserted at the end of the list. + * + * Returns 1 if successful, 0 if a list element containing the value already exists or -1 on error */ -int libcdata_internal_list_insert_element( +int libcdata_internal_list_insert_element_find_element( libcdata_internal_list_t *internal_list, - libcdata_list_element_t *element, + intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, + int *element_index, + libcdata_list_element_t **element, libcerror_error_t **error ) { - libcdata_list_element_t *list_element = NULL; - libcdata_list_element_t *next_element = NULL; - libcdata_list_element_t *previous_element = NULL; - intptr_t *element_value = NULL; - intptr_t *list_element_value = NULL; - static char *function = "libcdata_internal_list_insert_element"; - int compare_result = 0; - int element_index = 0; - int result = 1; + libcdata_list_element_t *list_element = NULL; + intptr_t *list_element_value = NULL; + static char *function = "libcdata_internal_list_insert_element_find_element"; + int compare_result = 0; + int result = 1; + int safe_element_index = 0; if( internal_list == NULL ) { @@ -1709,17 +1781,6 @@ return( -1 ); } - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list element.", - function ); - - return( -1 ); - } if( value_compare_function == NULL ) { libcerror_error_set( @@ -1743,272 +1804,330 @@ return( -1 ); } - if( libcdata_list_element_get_elements( - element, - &previous_element, - &next_element, - error ) != 1 ) + if( element_index == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous and next element from list element.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid element index.", function ); return( -1 ); } - if( ( previous_element != NULL ) - || ( next_element != NULL ) ) + if( element == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: list element already part of a list.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid element.", function ); return( -1 ); } - if( libcdata_list_element_get_value( - element, - &element_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element.", - function ); + list_element = internal_list->first_element; + compare_result = LIBCDATA_COMPARE_GREATER; - return( -1 ); - } - if( internal_list->number_of_elements == 0 ) - { - if( internal_list->first_element != NULL ) + for( safe_element_index = 0; + safe_element_index < internal_list->number_of_elements; + safe_element_index++ ) + { + if( libcdata_list_element_get_value( + list_element, + &list_element_value, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - first element already set.", - function ); + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from list element: %d.", + function, + safe_element_index ); return( -1 ); } - if( internal_list->last_element != NULL ) + compare_result = value_compare_function( + value_to_insert, + list_element_value, + error ); + + if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - last element already set.", - function ); + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to compare list element: %d.", + function, + safe_element_index ); return( -1 ); } - internal_list->first_element = element; - internal_list->last_element = element; + else if( compare_result == LIBCDATA_COMPARE_EQUAL ) + { + if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) + { + result = 0; - internal_list->number_of_elements++; - } - else - { - if( internal_list->first_element == NULL ) + break; + } + } + else if( compare_result == LIBCDATA_COMPARE_LESS ) + { + break; + } + else if( compare_result != LIBCDATA_COMPARE_GREATER ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - missing first.", - function ); + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported value compare function return value: %d.", + function, + compare_result ); return( -1 ); } - if( internal_list->last_element == NULL ) + if( libcdata_list_element_get_next_element( + list_element, + &list_element, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - missing last.", - function ); + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from list element: %d.", + function, + safe_element_index ); return( -1 ); } - list_element = internal_list->first_element; + } + if( ( compare_result == LIBCDATA_COMPARE_EQUAL ) + || ( compare_result == LIBCDATA_COMPARE_LESS ) ) + { + *element_index = safe_element_index; + *element = list_element; + } + else + { + *element_index = internal_list->number_of_elements; + *element = NULL; + } + return( result ); +} - for( element_index = 0; - element_index < internal_list->number_of_elements; - element_index++ ) - { - if( libcdata_list_element_get_value( - list_element, - &list_element_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element: %d.", - function, - element_index ); +/* Inserts the element before the list element + * If list_element is NULL the element is inserted before or as the first element in the list + * Returns 1 if successful, or -1 on error + */ +int libcdata_internal_list_insert_element_before_element( + libcdata_internal_list_t *internal_list, + libcdata_list_element_t *list_element, + libcdata_list_element_t *element_to_insert, + libcerror_error_t **error ) +{ + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_last_element = NULL; + libcdata_list_element_t *previous_element = NULL; + static char *function = "libcdata_internal_list_insert_element_before_element"; - return( -1 ); - } - compare_result = value_compare_function( - element_value, - list_element_value, - error ); + if( internal_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid list.", + function ); - if( compare_result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare list element: %d.", - function, - element_index ); + return( -1 ); + } + if( element_to_insert == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid element to insert.", + function ); - return( -1 ); - } - else if( compare_result == LIBCDATA_COMPARE_EQUAL ) - { - if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) - { - result = 0; + return( -1 ); + } + backup_first_element = internal_list->first_element; + backup_last_element = internal_list->last_element; - break; - } - } - else if( compare_result == LIBCDATA_COMPARE_LESS ) - { - result = 1; + if( list_element != NULL ) + { + if( libcdata_list_element_get_previous_element( + list_element, + &previous_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous element from list element.", + function ); - break; - } - else if( compare_result != LIBCDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported value compare function return value: %d.", - function, - compare_result ); + return( -1 ); + } + } + if( internal_list->number_of_elements == 0 ) + { + internal_list->first_element = element_to_insert; + internal_list->last_element = element_to_insert; + } + else if( list_element == NULL ) + { + if( libcdata_internal_list_set_last_element( + internal_list, + element_to_insert, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set last list element.", + function ); - return( -1 ); - } - if( libcdata_list_element_get_next_element( - list_element, - &list_element, + goto on_error; + } + } + else + { + if( libcdata_list_element_set_elements( + element_to_insert, + previous_element, + list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous and next element of element to insert.", + function ); + + goto on_error; + } + if( internal_list->first_element == list_element ) + { + internal_list->first_element = element_to_insert; + } + else + { + if( libcdata_list_element_set_next_element( + previous_element, + element_to_insert, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next element from list element: %d.", - function, - element_index ); + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next element of previous list element.", + function ); - return( -1 ); + goto on_error; } } - if( result != 0 ) + if( libcdata_list_element_set_previous_element( + list_element, + element_to_insert, + error ) != 1 ) { - if( compare_result == LIBCDATA_COMPARE_LESS ) - { - if( libcdata_list_element_get_previous_element( - list_element, - &previous_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous element from list element: %d.", - function, - element_index ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous element of list element.", + function ); - return( -1 ); - } - if( libcdata_list_element_set_elements( - element, - previous_element, - list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous and next element of list element.", - function ); + goto on_error; + } + } + internal_list->number_of_elements += 1; - return( -1 ); - } - if( list_element == internal_list->first_element ) - { - internal_list->first_element = element; - } - else - { - if( libcdata_list_element_set_next_element( - previous_element, - element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next element of list element: %d.", - function, - element_index - 1 ); + return( 1 ); - return( -1 ); - } - } - if( libcdata_list_element_set_previous_element( - list_element, - element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous element of list element: %d.", - function, - element_index ); +on_error: + if( element_to_insert != NULL ) + { + libcdata_list_element_set_elements( + element_to_insert, + NULL, + NULL, + NULL ); + } + if( previous_element != NULL ) + { + libcdata_list_element_set_next_element( + previous_element, + list_element, + NULL ); + } + if( list_element != NULL ) + { + libcdata_list_element_set_previous_element( + list_element, + previous_element, + NULL ); + } + internal_list->first_element = backup_first_element; + internal_list->last_element = backup_last_element; - return( -1 ); - } - } - else - { - if( libcdata_internal_list_set_last_element( - internal_list, - element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set last element.", - function ); + return( -1 ); +} - return( -1 ); - } - } - internal_list->number_of_elements++; - } +/* Inserts a list element into the list + * + * Uses the value_compare_function to determine the order of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, + * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error + * + * Duplicate entries are allowed by default and inserted after the last duplicate value. + * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES + * + * Returns 1 if successful, 0 if the list element already exists or -1 on error + */ +int libcdata_list_insert_element( + libcdata_list_t *list, + libcdata_list_element_t *element_to_insert, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + uint8_t insert_flags, + libcerror_error_t **error ) +{ + libcdata_list_element_t *existing_element = NULL; + static char *function = "libcdata_list_insert_element"; + int result = 0; + + result = libcdata_list_insert_element_with_existing( + list, + element_to_insert, + value_compare_function, + insert_flags, + &existing_element, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert element into list.", + function ); + + return( -1 ); } return( result ); } @@ -2024,19 +2143,30 @@ * * Returns 1 if successful, 0 if the list element already exists or -1 on error */ -int libcdata_list_insert_element( +int libcdata_list_insert_element_with_existing( libcdata_list_t *list, - libcdata_list_element_t *element, + libcdata_list_element_t *element_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, + libcdata_list_element_t **existing_element, libcerror_error_t **error ) { - libcdata_internal_list_t *internal_list = NULL; - static char *function = "libcdata_list_insert_element"; - int result = 1; + libcdata_internal_list_t *internal_list = NULL; + libcdata_list_element_t *next_element = NULL; + libcdata_list_element_t *previous_element = NULL; + libcdata_list_element_t *safe_existing_element = NULL; + intptr_t *value_to_insert = NULL; + static char *function = "libcdata_list_insert_element_with_existing"; + int element_index = 0; + int result = 1; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_last_element = NULL; +#endif if( list == NULL ) { @@ -2051,6 +2181,144 @@ } internal_list = (libcdata_internal_list_t *) list; + if( internal_list->number_of_elements == 0 ) + { + if( internal_list->first_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first element already set.", + function ); + + return( -1 ); + } + if( internal_list->last_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last element already set.", + function ); + + return( -1 ); + } + } + else + { + if( internal_list->first_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first element.", + function ); + + return( -1 ); + } + if( internal_list->last_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last element.", + function ); + + return( -1 ); + } + } + if( element_to_insert == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid element to insert.", + function ); + + return( -1 ); + } + if( value_compare_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value compare function.", + function ); + + return( -1 ); + } + if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported insert flags: 0x%02" PRIx8 ".", + function, + insert_flags ); + + return( -1 ); + } + if( existing_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid existing element.", + function ); + + return( -1 ); + } + *existing_element = NULL; + + if( libcdata_list_element_get_elements( + element_to_insert, + &previous_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous and next element from element to insert.", + function ); + + return( -1 ); + } + if( ( previous_element != NULL ) + || ( next_element != NULL ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid element to insert - already part of a list.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_value( + element_to_insert, + &value_to_insert, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from element to insert.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_list->read_write_lock, @@ -2065,12 +2333,18 @@ return( -1 ); } -#endif - result = libcdata_internal_list_insert_element( + backup_first_element = internal_list->first_element; + backup_last_element = internal_list->last_element; + +#endif /* defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) */ + + result = libcdata_internal_list_insert_element_find_element( internal_list, - element, + value_to_insert, value_compare_function, insert_flags, + &element_index, + &safe_existing_element, error ); if( result == -1 ) @@ -2078,12 +2352,56 @@ libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert element to list.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to find element in list.", function ); result = -1; } + else if( result == 0 ) + { + *existing_element = safe_existing_element; + } + else + { + if( safe_existing_element != NULL ) + { + if( libcdata_list_element_get_elements( + safe_existing_element, + &previous_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous and next element from list element: %d.", + function, + element_index ); + + result = -1; + } + } + if( result == 1 ) + { + if( libcdata_internal_list_insert_element_before_element( + internal_list, + safe_existing_element, + element_to_insert, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert element before list element.", + function ); + + result = -1; + } + } + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, @@ -2096,10 +2414,45 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( result ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + +on_error: + if( result == 1 ) + { + libcdata_list_element_set_elements( + element_to_insert, + NULL, + NULL, + NULL ); + + if( safe_existing_element != NULL ) + { + libcdata_list_element_set_elements( + safe_existing_element, + previous_element, + next_element, + NULL ); + } + else if( backup_last_element != NULL ) + { + libcdata_list_element_set_next_element( + backup_last_element, + NULL, + NULL ); + } + internal_list->first_element = backup_first_element; + internal_list->last_element = backup_last_element; + + internal_list->number_of_elements -= 1; + } + return( -1 ); + +#endif /* defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) */ } /* Inserts a value to the list @@ -2125,39 +2478,74 @@ uint8_t insert_flags, libcerror_error_t **error ) { - libcdata_internal_list_t *internal_list = NULL; - libcdata_list_element_t *element = NULL; - static char *function = "libcdata_list_insert_value"; - int result = 1; + intptr_t *existing_value = NULL; + static char *function = "libcdata_list_insert_value"; + int result = 0; + + result = libcdata_list_insert_value_with_existing( + list, + value, + value_compare_function, + insert_flags, + &existing_value, + error ); - if( list == NULL ) + if( result == -1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert value into list.", function ); return( -1 ); } - internal_list = (libcdata_internal_list_t *) list; + return( result ); +} -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_list->read_write_lock, - error ) != 1 ) +/* Inserts a value to the list + * + * Creates a new list element + * + * Uses the value_compare_function to determine the order of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, + * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error + * + * Duplicate entries are allowed by default and inserted after the last duplicate value. + * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES + * + * Returns 1 if successful, 0 if the list element already exists or -1 on error + */ +int libcdata_list_insert_value_with_existing( + libcdata_list_t *list, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + uint8_t insert_flags, + intptr_t **existing_value, + libcerror_error_t **error ) +{ + libcdata_list_element_t *element = NULL; + libcdata_list_element_t *existing_element = NULL; + static char *function = "libcdata_list_insert_value_with_existing"; + int result = 1; + + if( existing_value == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid existing value.", function ); return( -1 ); } -#endif + *existing_value = NULL; + if( libcdata_list_element_initialize( &element, error ) != 1 ) @@ -2185,11 +2573,12 @@ goto on_error; } - result = libcdata_internal_list_insert_element( - internal_list, + result = libcdata_list_insert_element_with_existing( + list, element, value_compare_function, insert_flags, + &existing_element, error ); if( result == -1 ) @@ -2219,30 +2608,24 @@ goto on_error; } - } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + if( libcdata_list_element_get_value( + existing_element, + existing_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from existing list element.", + function ); - return( -1 ); + goto on_error; + } } -#endif return( result ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - NULL ); -#endif if( element != NULL ) { libcdata_list_element_free( @@ -2258,13 +2641,19 @@ */ int libcdata_list_remove_element( libcdata_list_t *list, - libcdata_list_element_t *element, + libcdata_list_element_t *element_to_remove, libcerror_error_t **error ) { - libcdata_internal_list_t *internal_list = NULL; - libcdata_list_element_t *next_element = NULL; - libcdata_list_element_t *previous_element = NULL; - static char *function = "libcdata_list_remove_element"; + libcdata_internal_list_t *internal_list = NULL; + libcdata_list_element_t *next_element = NULL; + libcdata_list_element_t *previous_element = NULL; + static char *function = "libcdata_list_remove_element"; + int result = 1; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_last_element = NULL; +#endif if( list == NULL ) { @@ -2279,13 +2668,78 @@ } internal_list = (libcdata_internal_list_t *) list; - if( element == NULL ) + if( internal_list->number_of_elements == 0 ) + { + if( internal_list->first_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first element already set.", + function ); + + return( -1 ); + } + if( internal_list->last_element != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last element already set.", + function ); + + return( -1 ); + } + } + else + { + if( internal_list->first_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first element.", + function ); + + return( -1 ); + } + if( internal_list->last_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last element.", + function ); + + return( -1 ); + } + } + if( element_to_remove == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list element.", + "%s: invalid element to remove.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_elements( + element_to_remove, + &previous_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous and next element from element to remove.", function ); return( -1 ); @@ -2304,81 +2758,102 @@ return( -1 ); } + backup_first_element = internal_list->first_element; + backup_last_element = internal_list->last_element; + #endif - if( libcdata_list_element_get_elements( - element, - &previous_element, - &next_element, - error ) != 1 ) + result = libcdata_list_element_set_elements( + element_to_remove, + NULL, + NULL, + error ); + + if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous and next element from list element.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous and next element of element to remove.", function ); - goto on_error; - } - if( element == internal_list->first_element ) - { - internal_list->first_element = next_element; - } - if( element == internal_list->last_element ) - { - internal_list->last_element = previous_element; + result = -1; } - if( next_element != NULL ) + if( result == 1 ) { - if( libcdata_list_element_set_previous_element( - next_element, - previous_element, - error ) != 1 ) + if( next_element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous element of next element.", - function ); + result = libcdata_list_element_set_previous_element( + next_element, + previous_element, + error ); - goto on_error; + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous element of next element.", + function ); + + libcdata_list_element_set_elements( + element_to_remove, + previous_element, + next_element, + NULL ); + + result = -1; + } } } - if( previous_element != NULL ) + if( result == 1 ) { - if( libcdata_list_element_set_next_element( - previous_element, - next_element, - error ) != 1 ) + if( previous_element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next element of previous element.", - function ); + result = libcdata_list_element_set_next_element( + previous_element, + next_element, + error ); - goto on_error; + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next element of previous element.", + function ); + + if( next_element != NULL ) + { + libcdata_list_element_set_previous_element( + next_element, + element_to_remove, + NULL ); + } + libcdata_list_element_set_elements( + element_to_remove, + previous_element, + next_element, + NULL ); + + result = -1; + } } } - if( libcdata_list_element_set_elements( - element, - NULL, - NULL, - error ) != 1 ) + if( result == 1 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous and next element of list element.", - function ); - - goto on_error; + if( element_to_remove == internal_list->first_element ) + { + internal_list->first_element = next_element; + } + if( element_to_remove == internal_list->last_element ) + { + internal_list->last_element = previous_element; + } + internal_list->number_of_elements -= 1; } - internal_list->number_of_elements--; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_list->read_write_lock, @@ -2391,17 +2866,41 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_list->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + libcdata_list_element_set_elements( + element_to_remove, + previous_element, + next_element, + NULL ); + + if( next_element != NULL ) + { + libcdata_list_element_set_previous_element( + next_element, + element_to_remove, + NULL ); + } + if( previous_element != NULL ) + { + libcdata_list_element_set_next_element( + previous_element, + element_to_remove, + NULL ); + } + internal_list->first_element = backup_first_element; + internal_list->last_element = backup_last_element; + + internal_list->number_of_elements += 1; + } return( -1 ); +#endif } diff -Nru libbde-20190102/libcdata/libcdata_list.h libbde-20240223/libcdata/libcdata_list.h --- libbde-20190102/libcdata/libcdata_list.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_list.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * List functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_LIST_H ) @@ -70,13 +70,6 @@ libcerror_error_t **error ), libcerror_error_t **error ); -int libcdata_internal_list_empty( - libcdata_internal_list_t *internal_list, - int (*value_free_function)( - intptr_t **value, - libcerror_error_t **error ), - libcerror_error_t **error ); - LIBCDATA_EXTERN \ int libcdata_list_empty( libcdata_list_t *list, @@ -115,11 +108,6 @@ libcdata_list_element_t *element, libcerror_error_t **error ); -int libcdata_list_set_first_element( - libcdata_list_t *list, - libcdata_list_element_t *element, - libcerror_error_t **error ); - LIBCDATA_EXTERN \ int libcdata_list_get_last_element( libcdata_list_t *list, @@ -131,11 +119,6 @@ libcdata_list_element_t *element, libcerror_error_t **error ); -int libcdata_list_set_last_element( - libcdata_list_t *list, - libcdata_list_element_t *element, - libcerror_error_t **error ); - LIBCDATA_EXTERN \ int libcdata_list_get_element_by_index( libcdata_list_t *list, @@ -162,11 +145,6 @@ intptr_t *value, libcerror_error_t **error ); -int libcdata_internal_list_append_element( - libcdata_internal_list_t *internal_list, - libcdata_list_element_t *element, - libcerror_error_t **error ); - LIBCDATA_EXTERN \ int libcdata_list_append_element( libcdata_list_t *list, @@ -179,9 +157,28 @@ intptr_t *value, libcerror_error_t **error ); -int libcdata_internal_list_insert_element( +int libcdata_internal_list_insert_element_find_element( libcdata_internal_list_t *internal_list, - libcdata_list_element_t *element, + intptr_t *value_to_insert, + int (*value_compare_function)( + intptr_t *first_value, + intptr_t *second_value, + libcerror_error_t **error ), + uint8_t insert_flags, + int *element_index, + libcdata_list_element_t **element, + libcerror_error_t **error ); + +int libcdata_internal_list_insert_element_before_element( + libcdata_internal_list_t *internal_list, + libcdata_list_element_t *list_element, + libcdata_list_element_t *element_to_insert, + libcerror_error_t **error ); + +LIBCDATA_EXTERN \ +int libcdata_list_insert_element( + libcdata_list_t *list, + libcdata_list_element_t *element_to_insert, int (*value_compare_function)( intptr_t *first, intptr_t *second, @@ -190,14 +187,15 @@ libcerror_error_t **error ); LIBCDATA_EXTERN \ -int libcdata_list_insert_element( +int libcdata_list_insert_element_with_existing( libcdata_list_t *list, - libcdata_list_element_t *element, + libcdata_list_element_t *element_to_insert, int (*value_compare_function)( intptr_t *first, intptr_t *second, libcerror_error_t **error ), uint8_t insert_flags, + libcdata_list_element_t **existing_element, libcerror_error_t **error ); LIBCDATA_EXTERN \ @@ -212,9 +210,21 @@ libcerror_error_t **error ); LIBCDATA_EXTERN \ +int libcdata_list_insert_value_with_existing( + libcdata_list_t *list, + intptr_t *value, + int (*value_compare_function)( + intptr_t *first, + intptr_t *second, + libcerror_error_t **error ), + uint8_t insert_flags, + intptr_t **existing_value, + libcerror_error_t **error ); + +LIBCDATA_EXTERN \ int libcdata_list_remove_element( libcdata_list_t *list, - libcdata_list_element_t *element, + libcdata_list_element_t *element_to_remove, libcerror_error_t **error ); #if defined( __cplusplus ) diff -Nru libbde-20190102/libcdata/libcdata_list_element.c libbde-20240223/libcdata/libcdata_list_element.c --- libbde-20190102/libcdata/libcdata_list_element.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_list_element.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * List element functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -101,7 +101,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -201,16 +201,16 @@ return( result ); } -/* Retrieves the value from the list element +/* Retrieves the parent list from the list element * Returns 1 if successful or -1 on error */ -int libcdata_list_element_get_value( +int libcdata_list_element_get_parent_list( libcdata_list_element_t *element, - intptr_t **value, + intptr_t **parent_list, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; - static char *function = "libcdata_list_element_get_value"; + static char *function = "libcdata_list_element_get_parent_list"; if( element == NULL ) { @@ -225,13 +225,13 @@ } internal_element = (libcdata_internal_list_element_t *) element; - if( value == NULL ) + if( parent_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value.", + "%s: invalid parent list.", function ); return( -1 ); @@ -251,7 +251,7 @@ return( -1 ); } #endif - *value = internal_element->value; + *parent_list = internal_element->parent_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_read( @@ -271,16 +271,20 @@ return( 1 ); } -/* Sets the value in the list element +/* Sets the parent list in the list element * Returns 1 if successful or -1 on error */ -int libcdata_list_element_set_value( +int libcdata_list_element_set_parent_list( libcdata_list_element_t *element, - intptr_t *value, + intptr_t *parent_list, libcerror_error_t **error ) { libcdata_internal_list_element_t *internal_element = NULL; - static char *function = "libcdata_list_element_set_value"; + static char *function = "libcdata_list_element_set_parent_list"; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + intptr_t *backup_parent_list = NULL; +#endif if( element == NULL ) { @@ -309,8 +313,9 @@ return( -1 ); } + backup_parent_list = internal_element->parent_list; #endif - internal_element->value = value; + internal_element->parent_list = parent_list; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( @@ -324,10 +329,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_element->parent_list = backup_parent_list; + + return( -1 ); +#endif } /* Retrieves the previous element from the list element @@ -411,6 +423,10 @@ libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_previous_element"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_previous_element = NULL; +#endif + if( element == NULL ) { libcerror_error_set( @@ -438,6 +454,7 @@ return( -1 ); } + backup_previous_element = internal_element->previous_element; #endif internal_element->previous_element = previous_element; @@ -453,10 +470,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_element->previous_element = backup_previous_element; + + return( -1 ); +#endif } /* Retrieves the next element from the list element @@ -540,6 +564,10 @@ libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_next_element"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_next_element = NULL; +#endif + if( element == NULL ) { libcerror_error_set( @@ -567,6 +595,7 @@ return( -1 ); } + backup_next_element = internal_element->next_element; #endif internal_element->next_element = next_element; @@ -582,10 +611,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_element->next_element = backup_next_element; + + return( -1 ); +#endif } /* Retrieves the previous and next element from the list element @@ -683,6 +719,11 @@ libcdata_internal_list_element_t *internal_element = NULL; static char *function = "libcdata_list_element_set_elements"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_list_element_t *backup_next_element = NULL; + libcdata_list_element_t *backup_previous_element = NULL; +#endif + if( element == NULL ) { libcerror_error_set( @@ -710,6 +751,8 @@ return( -1 ); } + backup_previous_element = internal_element->previous_element; + backup_next_element = internal_element->next_element; #endif internal_element->previous_element = previous_element; internal_element->next_element = next_element; @@ -726,9 +769,158 @@ "%s: unable to release read/write lock for writing.", function ); + goto on_error; + } +#endif + return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_element->previous_element = backup_previous_element; + internal_element->next_element = backup_next_element; + + return( -1 ); +#endif +} + +/* Retrieves the value from the list element + * Returns 1 if successful or -1 on error + */ +int libcdata_list_element_get_value( + libcdata_list_element_t *element, + intptr_t **value, + libcerror_error_t **error ) +{ + libcdata_internal_list_element_t *internal_element = NULL; + static char *function = "libcdata_list_element_get_value"; + + if( element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid list element.", + function ); + + return( -1 ); + } + internal_element = (libcdata_internal_list_element_t *) element; + + if( value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value.", + function ); + + return( -1 ); + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_element->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + *value = internal_element->value; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_release_for_read( + internal_element->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + return( 1 ); +} + +/* Sets the value in the list element + * Returns 1 if successful or -1 on error + */ +int libcdata_list_element_set_value( + libcdata_list_element_t *element, + intptr_t *value, + libcerror_error_t **error ) +{ + libcdata_internal_list_element_t *internal_element = NULL; + static char *function = "libcdata_list_element_set_value"; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + intptr_t *backup_value = NULL; +#endif + + if( element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid list element.", + function ); + + return( -1 ); + } + internal_element = (libcdata_internal_list_element_t *) element; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_write( + internal_element->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + return( -1 ); } + backup_value = internal_element->value; +#endif + internal_element->value = value; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_release_for_write( + internal_element->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); + + goto on_error; + } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_element->value = backup_value; + + return( -1 ); +#endif } diff -Nru libbde-20190102/libcdata/libcdata_list_element.h libbde-20240223/libcdata/libcdata_list_element.h --- libbde-20190102/libcdata/libcdata_list_element.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_list_element.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * List element functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_LIST_ELEMENT_H ) @@ -38,6 +38,10 @@ struct libcdata_internal_list_element { + /* The list the element is part of + */ + intptr_t *parent_list; + /* The previous list element */ libcdata_list_element_t *previous_element; @@ -70,16 +74,14 @@ libcerror_error_t **error ), libcerror_error_t **error ); -LIBCDATA_EXTERN \ -int libcdata_list_element_get_value( +int libcdata_list_element_get_parent_list( libcdata_list_element_t *element, - intptr_t **value, + intptr_t **parent_list, libcerror_error_t **error ); -LIBCDATA_EXTERN \ -int libcdata_list_element_set_value( +int libcdata_list_element_set_parent_list( libcdata_list_element_t *element, - intptr_t *value, + intptr_t *parent_list, libcerror_error_t **error ); LIBCDATA_EXTERN \ @@ -120,6 +122,18 @@ libcdata_list_element_t *next_element, libcerror_error_t **error ); +LIBCDATA_EXTERN \ +int libcdata_list_element_get_value( + libcdata_list_element_t *element, + intptr_t **value, + libcerror_error_t **error ); + +LIBCDATA_EXTERN \ +int libcdata_list_element_set_value( + libcdata_list_element_t *element, + intptr_t *value, + libcerror_error_t **error ); + #if defined( __cplusplus ) } #endif diff -Nru libbde-20190102/libcdata/libcdata_range_list.c libbde-20240223/libcdata/libcdata_range_list.c --- libbde-20190102/libcdata/libcdata_range_list.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_range_list.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Range list * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -30,6 +30,7 @@ #include "libcdata_range_list.h" #include "libcdata_range_list_value.h" #include "libcdata_types.h" +#include "libcdata_unused.h" /* Creates a range list * Make sure the value range_list is referencing, is set to NULL @@ -104,7 +105,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -189,6 +190,92 @@ return( result ); } +/* Frees a range list element + * Uses the value_free_function to free the element value + * Returns 1 if successful or -1 on error + */ +int libcdata_internal_range_list_free_element( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t **range_list_element, + int (*value_free_function)( + intptr_t **value, + libcerror_error_t **error ), + libcerror_error_t **error ) +{ + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_free_element"; + int result = 1; + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( range_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list element.", + function ); + + return( -1 ); + } + if( *range_list_element != NULL ) + { + if( libcdata_list_element_get_value( + *range_list_element, + (intptr_t **) &range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from range list element.", + function ); + + return( -1 ); + } + if( libcdata_range_list_value_free( + &range_list_value, + value_free_function, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free range list value.", + function ); + + result = -1; + } + if( libcdata_list_element_free( + range_list_element, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free list element.", + function ); + + result = -1; + } + } + return( result ); +} + /* Empties a range list and frees the elements * Uses the value_free_function to free the element value * Returns 1 if successful or -1 on error @@ -203,7 +290,6 @@ libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_list_element_t *list_element = NULL; libcdata_list_element_t *next_element = NULL; - libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_empty"; int element_index = 0; int number_of_elements = 0; @@ -259,7 +345,9 @@ function, element_index ); - goto on_error; + result = -1; + + break; } internal_range_list->first_element = next_element; @@ -267,7 +355,7 @@ { internal_range_list->last_element = next_element; } - internal_range_list->number_of_elements--; + internal_range_list->number_of_elements -= 1; if( next_element != NULL ) { @@ -284,7 +372,7 @@ function, element_index + 1 ); - goto on_error; + result = -1; } } if( libcdata_list_element_set_next_element( @@ -300,48 +388,19 @@ function, element_index ); - goto on_error; - } - if( libcdata_list_element_get_value( - list_element, - (intptr_t **) &range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element: %d.", - function, - element_index ); - - goto on_error; - } - if( libcdata_range_list_value_free( - &range_list_value, - value_free_function, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free range list value: %d.", - function, - element_index ); - result = -1; } - if( libcdata_list_element_free( + if( libcdata_internal_range_list_free_element( + internal_range_list, &list_element, - NULL, + value_free_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free list element: %d.", + "%s: unable to free range list element: %d.", function, element_index ); @@ -364,18 +423,10 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + result = -1; } #endif return( result ); - -on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_range_list->read_write_lock, - NULL ); -#endif - return( -1 ); } /* Clones the range list @@ -434,45 +485,45 @@ } internal_source_range_list = (libcdata_internal_range_list_t *) source_range_list; - if( libcdata_range_list_initialize( - (libcdata_range_list_t **) &internal_destination_range_list, +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_source_range_list->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination range list.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } - if( internal_destination_range_list == NULL ) +#endif + if( libcdata_range_list_initialize( + (libcdata_range_list_t **) &internal_destination_range_list, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing destination range list.", + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create destination range list.", function ); - return( -1 ); + goto on_error; } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_read( - internal_source_range_list->read_write_lock, - error ) != 1 ) + if( internal_destination_range_list == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for reading.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing destination range list.", function ); - return( -1 ); + goto on_error; } -#endif if( internal_source_range_list->first_element != NULL ) { internal_source_list_element = (libcdata_internal_list_element_t *) internal_source_range_list->first_element; @@ -725,7 +776,9 @@ libcdata_list_element_t *element, libcerror_error_t **error ) { - static char *function = "libcdata_internal_range_list_set_first_element"; + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_next_element = NULL; + static char *function = "libcdata_internal_range_list_set_first_element"; if( internal_range_list == NULL ) { @@ -740,6 +793,25 @@ } if( element != NULL ) { + if( libcdata_list_element_get_next_element( + element, + &backup_next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element of element.", + function ); + + return( -1 ); + } + } + backup_first_element = internal_range_list->first_element; + + if( element != NULL ) + { if( libcdata_list_element_set_next_element( element, internal_range_list->first_element, @@ -749,10 +821,10 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next element of list element.", + "%s: unable to set next element of element.", function ); - return( -1 ); + goto on_error; } } if( internal_range_list->first_element != NULL ) @@ -769,12 +841,31 @@ "%s: unable to set previous element of first element.", function ); - return( -1 ); + goto on_error; } } internal_range_list->first_element = element; return( 1 ); + +on_error: + if( element != NULL ) + { + libcdata_list_element_set_next_element( + element, + backup_next_element, + NULL ); + } + if( backup_first_element != NULL ) + { + libcdata_list_element_set_next_element( + backup_first_element, + NULL, + NULL ); + } + internal_range_list->first_element = backup_first_element; + + return( -1 ); } /* Retrieves the last elements in the range list @@ -855,7 +946,9 @@ libcdata_list_element_t *element, libcerror_error_t **error ) { - static char *function = "libcdata_internal_range_list_set_last_element"; + libcdata_list_element_t *backup_last_element = NULL; + libcdata_list_element_t *backup_previous_element = NULL; + static char *function = "libcdata_internal_range_list_set_last_element"; if( internal_range_list == NULL ) { @@ -870,6 +963,25 @@ } if( element != NULL ) { + if( libcdata_list_element_get_previous_element( + element, + &backup_previous_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous element of element.", + function ); + + return( -1 ); + } + } + backup_last_element = internal_range_list->last_element; + + if( element != NULL ) + { if( libcdata_list_element_set_previous_element( element, internal_range_list->last_element, @@ -879,10 +991,10 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous element of list element.", + "%s: unable to set previous element of element.", function ); - return( -1 ); + goto on_error; } } if( internal_range_list->last_element != NULL ) @@ -899,12 +1011,31 @@ "%s: unable to set next element of last element.", function ); - return( -1 ); + goto on_error; } } internal_range_list->last_element = element; return( 1 ); + +on_error: + if( element != NULL ) + { + libcdata_list_element_set_previous_element( + element, + backup_previous_element, + NULL ); + } + if( backup_last_element != NULL ) + { + libcdata_list_element_set_next_element( + backup_last_element, + NULL, + NULL ); + } + internal_range_list->last_element = backup_last_element; + + return( -1 ); } /* Append a list element to the list @@ -957,7 +1088,7 @@ return( -1 ); } - internal_range_list->number_of_elements++; + internal_range_list->number_of_elements += 1; return( 1 ); } @@ -1028,44 +1159,123 @@ return( -1 ); } -/* Inserts a range - * - * The values are merged using the value_merge_function. - * If the source value is NULL the merge function is not called. - * - * After a merge and on error the values are freed using - * the value_free_function - * +/* Removes an element from the range list * Returns 1 if successful, or -1 on error */ -int libcdata_internal_range_list_insert_range( +int libcdata_internal_range_list_remove_element( libcdata_internal_range_list_t *internal_range_list, - uint64_t range_start, - uint64_t range_size, - intptr_t *value, + libcdata_list_element_t *range_list_element, + libcerror_error_t **error ) +{ + libcdata_list_element_t *next_element = NULL; + libcdata_list_element_t *previous_element = NULL; + static char *function = "libcdata_internal_range_list_remove_element"; + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_elements( + range_list_element, + &previous_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous and next element from range list element.", + function ); + + return( -1 ); + } + if( range_list_element == internal_range_list->first_element ) + { + internal_range_list->first_element = next_element; + } + if( range_list_element == internal_range_list->last_element ) + { + internal_range_list->last_element = previous_element; + } + if( next_element != NULL ) + { + if( libcdata_list_element_set_previous_element( + next_element, + previous_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous element of next element.", + function ); + + return( -1 ); + } + } + if( previous_element != NULL ) + { + if( libcdata_list_element_set_next_element( + previous_element, + next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next element of previous element.", + function ); + + return( -1 ); + } + } + if( libcdata_list_element_set_elements( + range_list_element, + NULL, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous and next element of range list element.", + function ); + + return( -1 ); + } + internal_range_list->current_element = NULL; + internal_range_list->current_element_index = 0; + + internal_range_list->number_of_elements -= 1; + + return( 1 ); +} + +/* Removes an element from the range list and frees the element + * Returns 1 if successful, or -1 on error + */ +int libcdata_internal_range_list_remove_range_value( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t **range_list_element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), - int (*value_merge_function)( - intptr_t *destination_value, - intptr_t *source_value, - libcerror_error_t **error ), libcerror_error_t **error ) { - libcdata_list_element_t *last_element = NULL; - libcdata_list_element_t *list_element = NULL; - libcdata_list_element_t *next_element = NULL; - libcdata_list_element_t *previous_element = NULL; - libcdata_range_list_value_t *next_range_list_value = NULL; - libcdata_range_list_value_t *new_range_list_value = NULL; - libcdata_range_list_value_t *range_list_value = NULL; - libcdata_range_list_value_t *previous_range_list_value = NULL; - static char *function = "libcdata_internal_range_list_insert_range"; - uint64_t range_end = 0; - int create_element = 0; - int element_index = 0; - int merge_next_element_check = 0; - int merge_previous_element_check = 0; + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_remove_range_value"; + int result = 1; if( internal_range_list == NULL ) { @@ -1078,52 +1288,143 @@ return( -1 ); } - if( range_start > (uint64_t) INT64_MAX ) + if( range_list_element == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid range start value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list element.", function ); return( -1 ); } - if( range_size > (uint64_t) INT64_MAX ) + if( libcdata_internal_range_list_remove_element( + internal_range_list, + *range_list_element, + error ) != 1 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid range size value exceeds maximum.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove range list element.", function ); return( -1 ); } - range_end = range_start + range_size; + if( libcdata_list_element_get_value( + *range_list_element, + (intptr_t **) &range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve range list value from range list element.", + function ); - if( range_end < range_start ) + return( -1 ); + } + if( libcdata_list_element_free( + range_list_element, + NULL, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid range end value out of bounds.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free range list element.", function ); - goto on_error; + result = -1; } - create_element = 1; + if( libcdata_range_list_value_free( + &range_list_value, + value_free_function, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free range list value.", + function ); + + result = -1; + } + return( result ); +} + +/* Retrieves the element which the range should be inserted before or merged within + * + * On return element will be set to NULL if the range should be inserted at the end of the list. + * + * Returns 1 if successful or -1 on error + */ +int libcdata_internal_range_list_insert_range_find_element( + libcdata_internal_range_list_t *internal_range_list, + uint64_t range_start, + uint64_t range_end LIBCDATA_ATTRIBUTE_UNUSED, + int *element_index, + libcdata_list_element_t **element, + libcerror_error_t **error ) +{ + libcdata_list_element_t *current_element = NULL; + libcdata_list_element_t *previous_element = NULL; + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_insert_range_find_element"; + int current_element_index = 0; + int last_element_index = 0; + + LIBCDATA_UNREFERENCED_PARAMETER( range_end ) + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid element.", + function ); + + return( -1 ); + } + if( element_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid element index.", + function ); + + return( -1 ); + } + current_element = internal_range_list->last_element; + current_element_index = internal_range_list->number_of_elements; if( internal_range_list->number_of_elements > 0 ) { /* Check the last element first, most often the list will be filled linear */ - list_element = internal_range_list->last_element; - element_index = internal_range_list->number_of_elements - 1; + current_element_index--; if( libcdata_list_element_get_value( - list_element, + current_element, (intptr_t **) &range_list_value, error ) != 1 ) { @@ -1133,9 +1434,9 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, - element_index ); + current_element_index ); - goto on_error; + return( -1 ); } if( range_list_value == NULL ) { @@ -1145,184 +1446,79 @@ LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, - element_index ); + current_element_index ); - goto on_error; - } - /* Check if the range overlaps at the end of the existing range - */ - if( ( range_start >= range_list_value->start ) - && ( range_start <= range_list_value->end ) ) - { - if( range_end > range_list_value->end ) - { - range_list_value->size += range_end - range_list_value->end; - range_list_value->end = range_end; - } - create_element = 0; - merge_next_element_check = 1; - } - /* Check if the range overlaps at the beginning of the existing range - */ - else if( ( range_end >= range_list_value->start ) - && ( range_end <= range_list_value->end ) ) - { - if( range_start < range_list_value->start ) - { - range_list_value->size += range_list_value->start - range_start; - range_list_value->start = range_start; - } - create_element = 0; - merge_previous_element_check = 1; + return( -1 ); } - /* Check if the range overlaps the existing range entirely - */ - else if( ( range_start < range_list_value->start ) - && ( range_end > range_list_value->end ) ) + if( range_start > range_list_value->end ) { - range_list_value->start = range_start; - range_list_value->size = range_size; - range_list_value->end = range_end; + current_element = NULL; - create_element = 0; - merge_previous_element_check = 1; - } - /* Check if the range is after the existing range - */ - else if( range_end > range_list_value->end ) - { - last_element = list_element; + current_element_index++; } else if( internal_range_list->number_of_elements > 1 ) { - if( range_end > ( range_list_value->end / 2 ) ) + last_element_index = current_element_index; + + if( ( current_element_index != internal_range_list->current_element_index ) + && ( internal_range_list->current_element != NULL ) ) { - if( libcdata_list_element_get_previous_element( - list_element, - &list_element, + /* Check the current element + */ + current_element = internal_range_list->current_element; + current_element_index = internal_range_list->current_element_index; + + if( libcdata_list_element_get_value( + current_element, + (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous element from list element: %d.", + "%s: unable to retrieve value from list element: %d.", function, - element_index ); + current_element_index ); - goto on_error; + return( -1 ); } - for( element_index = ( internal_range_list->number_of_elements - 2 ); - element_index >= 0; - element_index-- ) + if( range_list_value == NULL ) { - if( libcdata_list_element_get_value( - list_element, - (intptr_t **) &range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element: %d.", - function, - element_index ); - - goto on_error; - } - if( range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing range list value element: %d.", - function, - element_index ); - - goto on_error; - } - /* Check if the range overlaps at the end of the existing range - */ - if( ( range_start >= range_list_value->start ) - && ( range_start <= range_list_value->end ) ) - { - if( range_end > range_list_value->end ) - { - range_list_value->size += range_end - range_list_value->end; - range_list_value->end = range_end; - } - create_element = 0; - merge_next_element_check = 1; - } - /* Check if the range overlaps at the beginning of the existing range - */ - else if( ( range_end >= range_list_value->start ) - && ( range_end <= range_list_value->end ) ) - { - if( range_start < range_list_value->start ) - { - range_list_value->size += range_list_value->start - range_start; - range_list_value->start = range_start; - } - create_element = 0; - merge_previous_element_check = 1; - } - /* Check if the range overlaps the existing range entirely - */ - else if( ( range_start < range_list_value->start ) - && ( range_end > range_list_value->end ) ) - { - range_list_value->start = range_start; - range_list_value->size = range_size; - range_list_value->end = range_end; - - create_element = 0; - merge_next_element_check = 1; - merge_previous_element_check = 1; - } - if( create_element == 0 ) - { - break; - } - /* Check if the range is after the existing range - */ - if( range_end > range_list_value->end ) - { - last_element = list_element; - - break; - } - last_element = list_element; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing range list value element: %d.", + function, + current_element_index ); - if( libcdata_list_element_get_previous_element( - list_element, - &list_element, + return( -1 ); + } + } + if( range_start > range_list_value->end ) + { + while( current_element_index < last_element_index ) + { + if( libcdata_list_element_get_next_element( + current_element, + ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous element from list element: %d.", + "%s: unable to retrieve next element from list element: %d.", function, - element_index ); + current_element_index ); - goto on_error; + return( -1 ); } - } - } - else - { - list_element = internal_range_list->first_element; + current_element_index++; - for( element_index = 0; - element_index < ( internal_range_list->number_of_elements - 1 ); - element_index++ ) - { if( libcdata_list_element_get_value( - list_element, + current_element, (intptr_t **) &range_list_value, error ) != 1 ) { @@ -1332,9 +1528,9 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve value from list element: %d.", function, - element_index ); + current_element_index ); - goto on_error; + return( -1 ); } if( range_list_value == NULL ) { @@ -1344,502 +1540,172 @@ LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, "%s: missing range list value element: %d.", function, - element_index ); + current_element_index ); - goto on_error; - } - /* Check if the range overlaps at the end of the existing range - */ - if( ( range_start >= range_list_value->start ) - && ( range_start <= range_list_value->end ) ) - { - if( range_end > range_list_value->end ) - { - range_list_value->size += range_end - range_list_value->end; - range_list_value->end = range_end; - } - create_element = 0; - merge_next_element_check = 1; - } - /* Check if the range overlaps at the beginning of the existing range - */ - else if( ( range_end >= range_list_value->start ) - && ( range_end <= range_list_value->end ) ) - { - if( range_start < range_list_value->start ) - { - range_list_value->size += range_list_value->start - range_start; - range_list_value->start = range_start; - } - create_element = 0; - merge_previous_element_check = 1; - } - /* Check if the range overlaps the existing range entirely - */ - else if( ( range_start < range_list_value->start ) - && ( range_end > range_list_value->end ) ) - { - range_list_value->start = range_start; - range_list_value->size = range_size; - range_list_value->end = range_end; - - create_element = 0; - merge_next_element_check = 1; - merge_previous_element_check = 1; - } - if( create_element == 0 ) - { - break; + return( -1 ); } - /* Check if the range belongs before the existing range - */ - if( range_end < range_list_value->end ) + if( range_start <= range_list_value->end ) { - if( libcdata_list_element_get_previous_element( - list_element, - &last_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous element from list element: %d.", - function, - element_index ); - - goto on_error; - } break; } - last_element = list_element; - - if( libcdata_list_element_get_next_element( - list_element, - &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next element from list element: %d.", - function, - element_index ); - - goto on_error; - } } } - } - /* Check if the current range should be merged with the previous range - */ - if( merge_previous_element_check != 0 ) - { - if( libcdata_list_element_get_previous_element( - list_element, - &previous_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous element from list element: %d.", - function, - element_index ); - - goto on_error; - } - if( previous_element != NULL ) + else { - if( libcdata_list_element_get_value( - previous_element, - (intptr_t **) &previous_range_list_value, - error ) != 1 ) + while( current_element_index > 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element: %d.", - function, - element_index - 1 ); - - goto on_error; - } - if( previous_range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing range list value element: %d.", - function, - element_index - 1 ); + previous_element = current_element; - goto on_error; - } - if( range_list_value->start <= previous_range_list_value->end ) - { - /* Merge range with previous - */ - if( libcdata_range_list_value_merge( - range_list_value, - previous_range_list_value, - value_merge_function, + if( libcdata_list_element_get_previous_element( + current_element, + ¤t_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to merge range list value with previous.", - function ); - - previous_range_list_value = NULL; + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous element from list element: %d.", + function, + current_element_index ); - goto on_error; + return( -1 ); } - /* Remove previous list element - */ - if( libcdata_internal_range_list_remove_element( - internal_range_list, - previous_element, + current_element_index--; + + if( libcdata_list_element_get_value( + current_element, + (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove list element: %d.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from list element: %d.", function, - element_index - 1 ); - - previous_range_list_value = NULL; + current_element_index ); - goto on_error; + return( -1 ); } - if( libcdata_list_element_free( - &previous_element, - NULL, - error ) != 1 ) + if( range_list_value == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free list element: %d.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing range list value element: %d.", function, - element_index - 1 ); + current_element_index ); - goto on_error; + return( -1 ); } - if( libcdata_range_list_value_free( - &previous_range_list_value, - value_free_function, - error ) != 1 ) + if( range_start > range_list_value->end ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free previous range list value: %d.", - function, - element_index ); + current_element = previous_element; + + current_element_index++; - goto on_error; + break; } } - previous_range_list_value = NULL; } } - /* Check if the current range should be merged with the next range - */ - if( merge_next_element_check != 0 ) - { - if( libcdata_list_element_get_next_element( - list_element, - &next_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next element from list element: %d.", - function, - element_index ); - - goto on_error; - } - if( next_element != NULL ) - { - if( libcdata_list_element_get_value( - next_element, - (intptr_t **) &next_range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element: %d.", - function, - element_index + 1 ); - - goto on_error; - } - if( next_range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing range list value element: %d.", - function, - element_index + 1 ); - - goto on_error; - } - if( range_list_value->end >= next_range_list_value->start ) - { - /* Merge range with next - */ - if( libcdata_range_list_value_merge( - range_list_value, - next_range_list_value, - value_merge_function, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to merge range list value with next.", - function ); - - next_range_list_value = NULL; - - goto on_error; - } - /* Remove next list element - */ - if( libcdata_internal_range_list_remove_element( - internal_range_list, - next_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove list element: %d.", - function, - element_index + 1 ); + } + if( current_element != NULL ) + { + internal_range_list->current_element = current_element; + internal_range_list->current_element_index = current_element_index; + } + *element = current_element; + *element_index = current_element_index; - next_range_list_value = NULL; + return( 1 ); +} - goto on_error; - } - if( libcdata_list_element_free( - &next_element, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free list element: %d.", - function, - element_index + 1 ); +/* Checks if the range overlaps with the value of the range list element + * Returns 1 if the range overlaps, 0 if not or -1 on error + */ +int libcdata_internal_range_list_check_range_overlap( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + uint64_t range_start, + uint64_t range_end, + libcerror_error_t **error ) +{ + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_check_range_overlap"; + int result = 0; - goto on_error; - } - if( libcdata_range_list_value_free( - &next_range_list_value, - value_free_function, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free next range list value: %d.", - function, - element_index + 1 ); + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); - goto on_error; - } - } - next_range_list_value = NULL; - } - } + return( -1 ); } - if( create_element != 0 ) + if( range_list_element != NULL ) { - if( libcdata_range_list_value_initialize( - &new_range_list_value, + if( libcdata_list_element_get_value( + range_list_element, + (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create range list value.", - function ); - - goto on_error; - } - if( new_range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing range list value.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from range list element.", function ); - goto on_error; + return( -1 ); } - new_range_list_value->start = range_start; - new_range_list_value->size = range_size; - new_range_list_value->end = range_end; - new_range_list_value->value = value; + result = libcdata_range_list_value_check_range_overlap( + range_list_value, + range_start, + range_end, + error ); - if( libcdata_internal_range_list_insert_value( - internal_range_list, - last_element, - new_range_list_value, - error ) != 1 ) + if( result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert range list value in range list.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine if range overlaps with range list value.", function ); - goto on_error; - } - new_range_list_value = NULL; - } - else if( value != NULL ) - { - if( range_list_value->value == NULL ) - { - range_list_value->value = value; - } - else - { - if( value_free_function == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value free function.", - function ); - - goto on_error; - } - if( value_merge_function == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value merge function.", - function ); - - goto on_error; - } - if( value_merge_function( - range_list_value->value, - value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to merge value.", - function ); - - goto on_error; - } - if( value_free_function( - &value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to free value.", - function ); - - goto on_error; - } + return( -1 ); } } - return( 1 ); - -on_error: - if( next_range_list_value != NULL ) - { - libcdata_range_list_value_free( - &next_range_list_value, - value_free_function, - NULL ); - } - if( previous_range_list_value != NULL ) - { - libcdata_range_list_value_free( - &previous_range_list_value, - value_free_function, - NULL ); - } - if( new_range_list_value != NULL ) - { - libcdata_range_list_value_free( - &new_range_list_value, - value_free_function, - NULL ); - } - return( -1 ); + return( result ); } -/* Inserts a range - * - * The values are merged using the value_merge_function. - * If the source value is NULL the merge function is not called. - * - * After a merge and on error the values are freed using - * the value_free_function - * +/* Inserts the range before the range list element + * If range_list_element is NULL the element is inserted before or as the first element in the list * Returns 1 if successful, or -1 on error */ -int libcdata_range_list_insert_range( - libcdata_range_list_t *range_list, +int libcdata_internal_range_list_insert_range_before_element( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, uint64_t range_start, - uint64_t range_size, + uint64_t range_end, intptr_t *value, - int (*value_free_function)( - intptr_t **value, - libcerror_error_t **error ), - int (*value_merge_function)( - intptr_t *destination_value, - intptr_t *source_value, - libcerror_error_t **error ), + libcdata_list_element_t **new_range_list_element, libcerror_error_t **error ) { - libcdata_internal_range_list_t *internal_range_list = NULL; - static char *function = "libcdata_range_list_insert_range"; - int result = 1; + libcdata_list_element_t *backup_first_element = NULL; + libcdata_list_element_t *backup_last_element = NULL; + libcdata_list_element_t *new_element = NULL; + libcdata_list_element_t *previous_element = NULL; + libcdata_range_list_value_t *new_range_list_value = NULL; + static char *function = "libcdata_internal_range_list_insert_range_before_element"; - if( range_list == NULL ) + if( internal_range_list == NULL ) { libcerror_error_set( error, @@ -1850,242 +1716,223 @@ return( -1 ); } - internal_range_list = (libcdata_internal_range_list_t *) range_list; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_range_list->read_write_lock, - error ) != 1 ) + if( new_range_list_element == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid new range list element.", function ); return( -1 ); } -#endif - if( libcdata_internal_range_list_insert_range( - internal_range_list, - range_start, - range_size, - value, - value_free_function, - value_merge_function, - error ) != 1 ) + if( range_list_element != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert range list into range list.", - function ); + if( libcdata_list_element_get_previous_element( + range_list_element, + &previous_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous element from range list element.", + function ); - result = -1; + return( -1 ); + } } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_range_list->read_write_lock, + if( libcdata_range_list_value_initialize( + &new_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create range list value.", function ); - return( -1 ); + goto on_error; } -#endif - return( result ); -} - -/* Inserts a range list - * - * The values are merged using the value_merge_function. - * If the source value is NULL the merge function is not called. - * - * After a merge and on error the values are freed using - * the value_free_function - * - * The values in the source_range_list are not affected. - * - * Returns 1 if successful, or -1 on error - */ -int libcdata_range_list_insert_range_list( - libcdata_range_list_t *range_list, - libcdata_range_list_t *source_range_list, - int (*value_free_function)( - intptr_t **value, - libcerror_error_t **error ), - int (*value_merge_function)( - intptr_t *destination_value, - intptr_t *source_value, - libcerror_error_t **error ), - libcerror_error_t **error ) -{ - libcdata_internal_range_list_t *internal_range_list = NULL; - libcdata_list_element_t *source_list_element = NULL; - libcdata_range_list_value_t *source_range_list_value = NULL; - static char *function = "libcdata_range_list_insert_range_list"; - int element_index = 0; - int number_of_elements = 0; + backup_first_element = internal_range_list->first_element; + backup_last_element = internal_range_list->last_element; - if( range_list == NULL ) + if( new_range_list_value == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing range list value.", function ); - return( -1 ); + goto on_error; } - internal_range_list = (libcdata_internal_range_list_t *) range_list; + new_range_list_value->start = range_start; + new_range_list_value->size = range_end - range_start; + new_range_list_value->end = range_end; + new_range_list_value->value = value; - if( source_range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source range list.", - function ); - - return( -1 ); - } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_range_list->read_write_lock, + if( libcdata_list_element_initialize( + &new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create list element.", function ); - return( -1 ); + goto on_error; } -#endif - if( libcdata_range_list_get_number_of_elements( - source_range_list, - &number_of_elements, + if( libcdata_list_element_set_value( + new_element, + (intptr_t *) new_range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of source list elements.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set value in list element.", function ); goto on_error; } - if( libcdata_range_list_get_first_element( - source_range_list, - &source_list_element, - error ) != 1 ) + if( internal_range_list->number_of_elements == 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve first element from source list.", - function ); - - goto on_error; + internal_range_list->first_element = new_element; + internal_range_list->last_element = new_element; } - for( element_index = 0; - element_index < number_of_elements; - element_index++ ) + else if( range_list_element == NULL ) { - if( libcdata_list_element_get_value( - source_list_element, - (intptr_t **) &source_range_list_value, + if( libcdata_internal_range_list_set_last_element( + internal_range_list, + new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from source list element: %d.", - function, - element_index ); + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set last element.", + function ); goto on_error; } - if( libcdata_internal_range_list_insert_range( - internal_range_list, - source_range_list_value->start, - source_range_list_value->size, - source_range_list_value->value, - value_free_function, - value_merge_function, + } + else + { + if( libcdata_list_element_set_elements( + new_element, + previous_element, + range_list_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert source range list value: %d to range list.", - function, - element_index ); + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous and next element of element.", + function ); goto on_error; } - if( libcdata_list_element_get_next_element( - source_list_element, - &source_list_element, + if( internal_range_list->first_element == range_list_element ) + { + internal_range_list->first_element = new_element; + } + else + { + if( libcdata_list_element_set_next_element( + previous_element, + new_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next element of previous element.", + function ); + + goto on_error; + } + } + if( libcdata_list_element_set_previous_element( + range_list_element, + new_element, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next element from source list element: %d.", - function, - element_index ); + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous element of range list element.", + function ); goto on_error; } } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_range_list->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); + internal_range_list->current_element = NULL; + internal_range_list->current_element_index = 0; + + internal_range_list->number_of_elements += 1; + + *new_range_list_element = new_element; - return( -1 ); - } -#endif return( 1 ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_range_list->read_write_lock, - NULL ); -#endif + if( new_element != NULL ) + { + libcdata_list_element_set_elements( + new_element, + NULL, + NULL, + NULL ); + + libcdata_list_element_free( + &new_element, + NULL, + NULL ); + } + if( new_range_list_value != NULL ) + { + libcdata_range_list_value_free( + &new_range_list_value, + NULL, + NULL ); + } + if( previous_element != NULL ) + { + libcdata_list_element_set_next_element( + previous_element, + range_list_element, + NULL ); + } + if( range_list_element != NULL ) + { + libcdata_list_element_set_previous_element( + range_list_element, + previous_element, + NULL ); + } + internal_range_list->first_element = backup_first_element; + internal_range_list->last_element = backup_last_element; + return( -1 ); } /* Inserts the element in the range list after the range list element - * If range_list_element is NULL the element is inserted before the first element in the list + * If range_list_element is NULL the element is inserted as the first element in the list * Returns 1 if successful, or -1 on error */ -int libcdata_internal_range_list_insert_element( +int libcdata_internal_range_list_insert_element_after_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_list_element_t *element, @@ -2093,7 +1940,7 @@ { libcdata_list_element_t *next_element = NULL; libcdata_list_element_t *previous_element = NULL; - static char *function = "libcdata_internal_range_list_insert_element"; + static char *function = "libcdata_internal_range_list_insert_element_after_element"; if( internal_range_list == NULL ) { @@ -2280,7 +2127,7 @@ } } } - internal_range_list->number_of_elements++; + internal_range_list->number_of_elements += 1; return( 1 ); } @@ -2289,14 +2136,14 @@ * If range_list_element is NULL the value is inserted before the first element in the list * Returns 1 if successful, or -1 on error */ -int libcdata_internal_range_list_insert_value( +int libcdata_internal_range_list_insert_value_after_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; - static char *function = "libcdata_internal_range_list_insert_value"; + static char *function = "libcdata_internal_range_list_insert_value_after_element"; if( internal_range_list == NULL ) { @@ -2336,7 +2183,7 @@ goto on_error; } - if( libcdata_internal_range_list_insert_element( + if( libcdata_internal_range_list_insert_element_after_element( internal_range_list, range_list_element, list_element, @@ -2346,7 +2193,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert list element in range list.", + "%s: unable to insert element after range list element.", function ); goto on_error; @@ -2366,17 +2213,23 @@ return( -1 ); } -/* Removes an element from the range list +/* Merges the range into the range list element * Returns 1 if successful, or -1 on error */ -int libcdata_internal_range_list_remove_element( +int libcdata_internal_range_list_merge_range( libcdata_internal_range_list_t *internal_range_list, - libcdata_list_element_t *element, + libcdata_list_element_t *range_list_element, + uint64_t range_start, + uint64_t range_end, + intptr_t *value, + int (*value_merge_function)( + intptr_t *destination_value, + intptr_t *source_value, + libcerror_error_t **error ), libcerror_error_t **error ) { - libcdata_list_element_t *next_element = NULL; - libcdata_list_element_t *previous_element = NULL; - static char *function = "libcdata_internal_range_list_remove_element"; + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_merge_range"; if( internal_range_list == NULL ) { @@ -2389,119 +2242,540 @@ return( -1 ); } - if( libcdata_list_element_get_elements( - element, - &previous_element, - &next_element, + if( libcdata_list_element_get_value( + range_list_element, + (intptr_t **) &range_list_value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous and next element from list element.", + "%s: unable to retrieve value from range list element.", function ); return( -1 ); } - if( element == internal_range_list->first_element ) + if( range_list_value == NULL ) { - internal_range_list->first_element = next_element; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing range list value.", + function ); + + return( -1 ); } - if( element == internal_range_list->last_element ) + if( range_list_value->value != NULL ) { - internal_range_list->last_element = previous_element; + if( value_merge_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value merge function.", + function ); + + return( -1 ); + } } - if( next_element != NULL ) + if( range_list_value->value == NULL ) { - if( libcdata_list_element_set_previous_element( - next_element, - previous_element, + range_list_value->value = value; + } + else + { + if( value_merge_function( + range_list_value->value, + value, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous element of next element.", + "%s: unable to merge value.", function ); return( -1 ); } } - if( previous_element != NULL ) + if( range_start < range_list_value->start ) { - if( libcdata_list_element_set_next_element( - previous_element, - next_element, + range_list_value->size += range_list_value->start - range_start; + range_list_value->start = range_start; + } + if( range_end > range_list_value->end ) + { + range_list_value->size += range_end - range_list_value->end; + range_list_value->end = range_end; + } + return( 1 ); +} + +/* Merges successive overlapping ranges + * Returns 1 if successful, or -1 on error + */ +int libcdata_internal_range_list_merge_overlapping_ranges( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + int (*value_merge_function)( + intptr_t *destination_value, + intptr_t *source_value, + libcerror_error_t **error ), + libcdata_range_list_t *backup_range_list, + libcerror_error_t **error ) +{ + libcdata_list_element_t *list_element = NULL; + libcdata_list_element_t *next_element = NULL; + libcdata_range_list_value_t *next_range_list_value = NULL; + static char *function = "libcdata_internal_range_list_merge_overlapping_ranges"; + int result = 0; + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_next_element( + range_list_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from range list element.", + function ); + + return( -1 ); + } + while( next_element != NULL ) + { + list_element = next_element; + + if( libcdata_list_element_get_next_element( + list_element, + &next_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_value( + list_element, + (intptr_t **) &next_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from next element.", + function ); + + return( -1 ); + } + if( next_range_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing next range list value.", + function ); + + return( -1 ); + } + result = libcdata_internal_range_list_check_range_overlap( + internal_range_list, + range_list_element, + next_range_list_value->start, + next_range_list_value->end, + error ); + + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine if next range overlaps with range list element.", + function ); + + return( -1 ); + } + else if( result == 0 ) + { + break; + } + if( libcdata_internal_range_list_append_value( + (libcdata_internal_range_list_t *) backup_range_list, + next_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to append value to backup range list.", + function ); + + return( -1 ); + } + if( libcdata_internal_range_list_remove_element( + internal_range_list, + list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove list element.", + function ); + + return( -1 ); + } + if( libcdata_list_element_free( + &list_element, + NULL, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free list element.", + function ); + + return( -1 ); + } + if( libcdata_internal_range_list_merge_range( + internal_range_list, + range_list_element, + next_range_list_value->start, + next_range_list_value->end, + next_range_list_value->value, + value_merge_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next element of previous element.", + "%s: unable to merge next range with range list element.", function ); return( -1 ); } } - if( libcdata_list_element_set_elements( - element, - NULL, - NULL, + return( 1 ); +} + +/* Inserts a range by merging the range into the range list element and successive overlapping ranges + * Returns 1 if successful or -1 on error + */ +int libcdata_internal_range_list_insert_range_merge( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + uint64_t range_start, + uint64_t range_end, + intptr_t *value, + int (*value_merge_function)( + intptr_t *destination_value, + intptr_t *source_value, + libcerror_error_t **error ), + libcdata_range_list_t *backup_range_list, + libcerror_error_t **error ) +{ + libcdata_range_list_value_t *backup_range_list_value = NULL; + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_insert_range_merge"; + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( libcdata_list_element_get_value( + range_list_element, + (intptr_t **) &range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from range list element.", + function ); + + goto on_error; + } + if( libcdata_range_list_value_initialize( + &backup_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create backup range list value.", + function ); + + goto on_error; + } + backup_range_list_value->start = range_list_value->start; + backup_range_list_value->end = range_list_value->end; + backup_range_list_value->size = range_list_value->size; + + if( libcdata_internal_range_list_append_value( + (libcdata_internal_range_list_t *) backup_range_list, + backup_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to append value to backup range list.", + function ); + + goto on_error; + } + backup_range_list_value = NULL; + + if( libcdata_internal_range_list_merge_range( + internal_range_list, + range_list_element, + range_start, + range_end, + value, + value_merge_function, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous and next element of list element.", + "%s: unable to merge range with range list element.", + function ); + + goto on_error; + } + if( libcdata_internal_range_list_merge_overlapping_ranges( + internal_range_list, + range_list_element, + value_merge_function, + backup_range_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to merge range list element with overlapping ranges.", + function ); + + goto on_error; + } + return( 1 ); + +on_error: + if( backup_range_list_value != NULL ) + { + libcdata_range_list_value_free( + &backup_range_list_value, + NULL, + NULL ); + } + return( -1 ); +} + +/* Reverts a previously merge of the range list element and successive overlapping ranges + * Returns 1 if successful or -1 on error + */ +int libcdata_internal_range_list_insert_range_revert_merge( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + libcdata_range_list_t *backup_range_list, + libcerror_error_t **error ) +{ + libcdata_internal_range_list_t *internal_backup_range_list = NULL; + libcdata_list_element_t *backup_range_list_element = NULL; + libcdata_range_list_value_t *backup_range_list_value = NULL; + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_internal_range_list_insert_range_revert_merge"; + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( backup_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid backup range list.", function ); return( -1 ); } - internal_range_list->number_of_elements--; + internal_backup_range_list = (libcdata_internal_range_list_t *) backup_range_list; + + if( internal_backup_range_list->first_element == NULL ) + { + return( 1 ); + } + if( libcdata_list_element_get_value( + internal_backup_range_list->first_element, + (intptr_t **) &backup_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from first backup range list element.", + function ); + return( -1 ); + } + if( libcdata_list_element_get_value( + range_list_element, + (intptr_t **) &range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from range list element.", + function ); + + return( -1 ); + } + range_list_value->start = backup_range_list_value->start; + range_list_value->end = backup_range_list_value->end; + range_list_value->size = backup_range_list_value->size; + + while( internal_backup_range_list->first_element != NULL ) + { + if( libcdata_list_element_get_next_element( + internal_backup_range_list->first_element, + &backup_range_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from first backup range list element.", + function ); + + return( -1 ); + } + if( backup_range_list_element == NULL ) + { + break; + } + if( libcdata_internal_range_list_remove_element( + internal_backup_range_list, + backup_range_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove backup range list element.", + function ); + + return( -1 ); + } + if( libcdata_internal_range_list_insert_element_after_element( + internal_range_list, + range_list_element, + backup_range_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert element after range list element.", + function ); + + return( -1 ); + } + backup_range_list_element = NULL; + } return( 1 ); } -/* Removes a range +/* Inserts a range * - * The values are split using the value_merge_function. - * If the source value is NULL the split function is not called. - * On return destination_value of the value_merge_function - * should contain data greater equal to the split_range_offset. + * The values are merged using the value_merge_function. + * If the source value is NULL the merge function is not called. * - * After a split and on error the values are freed using + * After a merge and on error the values are freed using * the value_free_function * - * Returns 1 if successful, or -1 on error + * Returns 1 if successful, 0 if the range was merged or -1 on error */ -int libcdata_internal_range_list_remove_range( - libcdata_internal_range_list_t *internal_range_list, +int libcdata_range_list_insert_range( + libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, + intptr_t *value, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), - int (*value_split_function)( - intptr_t **destination_value, + int (*value_merge_function)( + intptr_t *destination_value, intptr_t *source_value, - uint64_t split_range_offset, libcerror_error_t **error ), libcerror_error_t **error ) { + libcdata_internal_range_list_t *internal_range_list = NULL; libcdata_list_element_t *list_element = NULL; - libcdata_range_list_value_t *range_list_value = NULL; - libcdata_range_list_value_t *split_range_list_value = NULL; - intptr_t *split_value = NULL; - static char *function = "libcdata_internal_range_list_remove_range"; - uint64_t next_range_start = 0; + libcdata_list_element_t *new_element = NULL; + libcdata_range_list_t *backup_range_list = NULL; + static char *function = "libcdata_range_list_insert_range"; uint64_t range_end = 0; - int result = 0; + int element_index = 0; + int result = 1; - if( internal_range_list == NULL ) + if( range_list == NULL ) { libcerror_error_set( error, @@ -2512,6 +2786,8 @@ return( -1 ); } + internal_range_list = (libcdata_internal_range_list_t *) range_list; + if( range_start > (uint64_t) INT64_MAX ) { libcerror_error_set( @@ -2540,20 +2816,71 @@ { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, "%s: invalid range end value out of bounds.", function ); - goto on_error; + return( -1 ); } - while( range_start < range_end ) + if( libcdata_range_list_initialize( + &backup_range_list, + error ) != 1 ) { - result = libcdata_internal_range_list_get_element_at_offset( - internal_range_list, - range_start, - &list_element, - error ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create backup range list.", + function ); + + return( -1 ); + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_write( + internal_range_list->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", + function ); + + libcdata_range_list_free( + &backup_range_list, + NULL, + NULL ); + + return( -1 ); + } +#endif + if( libcdata_internal_range_list_insert_range_find_element( + internal_range_list, + range_start, + range_end, + &element_index, + &list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to find element in list.", + function ); + + result = -1; + } + if( result == 1 ) + { + result = libcdata_internal_range_list_check_range_overlap( + internal_range_list, + list_element, + range_start, + range_end, + error ); if( result == -1 ) { @@ -2561,351 +2888,590 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve list element for range offset: %" PRIu64 ".", + "%s: unable to determine if range overlaps with range list element: %d.", function, - range_start ); + element_index ); - goto on_error; + result = -1; } - else if( result == 0 ) + } + if( result == 0 ) + { + result = 1; + + if( libcdata_internal_range_list_insert_range_before_element( + internal_range_list, + list_element, + range_start, + range_end, + value, + &new_element, + error ) != 1 ) { - /* The specified range is not defined in the range list - */ - if( list_element == NULL ) - { - break; - } - if( libcdata_list_element_get_value( - list_element, - (intptr_t **) &range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from next list element.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert range before range list element.", + function ); - goto on_error; - } - if( range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing next range list value element.", - function ); + result = -1; + } + } + else if( result != -1 ) + { + result = 0; - goto on_error; - } - /* The specified range is not defined in the range list - */ - if( range_list_value->start >= range_end ) - { - break; - } - range_start = range_list_value->start; + if( libcdata_internal_range_list_insert_range_merge( + internal_range_list, + list_element, + range_start, + range_end, + value, + value_merge_function, + backup_range_list, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to merge range with list element: %d.", + function, + element_index ); + + result = -1; } - else + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_release_for_write( + internal_range_list->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for writing.", + function ); + + goto on_error; + } +#endif + libcdata_range_list_free( + &backup_range_list, + value_free_function, + NULL ); + + return( result ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + if( result == 0 ) + { + libcdata_internal_range_list_insert_range_revert_merge( + internal_range_list, + list_element, + backup_range_list, + NULL ); + } + else if( result == 1 ) + { + libcdata_internal_range_list_remove_range_value( + internal_range_list, + &new_element, + NULL, + NULL ); + } + libcdata_range_list_free( + &backup_range_list, + NULL, + NULL ); + + return( -1 ); +#endif +} + +/* Inserts a range list + * + * The values are merged using the value_merge_function. + * If the source value is NULL the merge function is not called. + * + * After a merge and on error the values are freed using + * the value_free_function + * + * The values in the source_range_list are not affected. + * + * Returns 1 if successful, or -1 on error + */ +int libcdata_range_list_insert_range_list( + libcdata_range_list_t *range_list, + libcdata_range_list_t *source_range_list, + int (*value_free_function)( + intptr_t **value, + libcerror_error_t **error ), + int (*value_merge_function)( + intptr_t *destination_value, + intptr_t *source_value, + libcerror_error_t **error ), + libcerror_error_t **error ) +{ + libcdata_list_element_t *source_list_element = NULL; + libcdata_range_list_value_t *source_range_list_value = NULL; + static char *function = "libcdata_range_list_insert_range_list"; + int element_index = 0; + int number_of_elements = 0; + int result = 0; + + if( range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( source_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid source range list.", + function ); + + return( -1 ); + } + if( libcdata_range_list_get_number_of_elements( + source_range_list, + &number_of_elements, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve number of source list elements.", + function ); + + return( -1 ); + } + if( libcdata_range_list_get_first_element( + source_range_list, + &source_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve first element from source list.", + function ); + + return( -1 ); + } + for( element_index = 0; + element_index < number_of_elements; + element_index++ ) + { + if( libcdata_list_element_get_value( + source_list_element, + (intptr_t **) &source_range_list_value, + error ) != 1 ) { - if( libcdata_list_element_get_value( - list_element, - (intptr_t **) &range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from list element for range offset: %" PRIu64 ".", - function, - range_start ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from source list element: %d.", + function, + element_index ); - goto on_error; - } - if( range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing range list value element for range offset: %" PRIu64 ".", - function, - range_start ); + return( -1 ); + } + result = libcdata_range_list_insert_range( + range_list, + source_range_list_value->start, + source_range_list_value->size, + source_range_list_value->value, + value_free_function, + value_merge_function, + error ); - goto on_error; - } + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert source range list value: %d to range list.", + function, + element_index ); + + return( -1 ); } - next_range_start = range_list_value->end; + if( libcdata_list_element_get_next_element( + source_list_element, + &source_list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from source list element: %d.", + function, + element_index ); + + return( -1 ); + } + } + return( 1 ); +} + +/* Shrinks a range + * + * A range that either overlaps the start or the end of the range list element + * is removed by shrining the range of the range list element. + * + * Returns 1 if successful, or -1 on error + */ +int libcdata_internal_range_list_remove_shrink_range( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + libcdata_range_list_value_t *range_list_value, + uint64_t range_start, + uint64_t range_end, + int (*value_free_function)( + intptr_t **value, + libcerror_error_t **error ), + int (*value_split_function)( + intptr_t **destination_value, + intptr_t *source_value, + uint64_t split_range_offset, + libcerror_error_t **error ), + libcerror_error_t **error ) +{ + intptr_t *split_value = NULL; + static char *function = "libcdata_internal_range_list_remove_shrink_range"; + uint64_t split_offset = 0; + + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + if( range_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list element.", + function ); + + return( -1 ); + } + if( range_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list value.", + function ); - if( range_list_value->value != NULL ) + return( -1 ); + } + if( ( range_start > range_list_value->start ) + && ( range_end < range_list_value->end ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid range value out of bounds.", + function ); + + return( -1 ); + } + if( range_list_value->value != NULL ) + { + if( value_free_function == NULL ) { - if( value_free_function == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value free function.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value free function.", + function ); - goto on_error; - } - if( value_split_function == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value split function.", - function ); + return( -1 ); + } + if( value_split_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value split function.", + function ); - goto on_error; - } + return( -1 ); } - if( range_list_value->start == range_start ) + } + if( range_start <= range_list_value->start ) + { + split_offset = range_end; + } + else + { + split_offset = range_start; + } + if( range_list_value->value != NULL ) + { + if( value_split_function( + &split_value, + range_list_value->value, + split_offset, + error ) != 1 ) { - if( range_list_value->end <= range_end ) - { - /* If the range marked for removal overlaps with the current range, - * remove the current range entirely. - */ - if( libcdata_internal_range_list_remove_element( - internal_range_list, - list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove list element.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to split value range offset: %" PRIu64 ".", + function, + split_offset ); - goto on_error; - } - if( libcdata_list_element_free( - &list_element, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free list element.", - function ); + goto on_error; + } + if( value_free_function( + &( range_list_value->value ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to free value.", + function ); - libcdata_range_list_value_free( - &range_list_value, - value_free_function, - NULL ); + range_list_value->value = split_value; - goto on_error; - } - if( libcdata_range_list_value_free( - &range_list_value, - value_free_function, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free range list value.", - function ); + goto on_error; + } + range_list_value->value = split_value; + } + if( split_offset > range_list_value->start ) + { + range_list_value->start = split_offset; + range_list_value->size = range_list_value->end - split_offset; + } + else + { + range_list_value->end = split_offset; + range_list_value->size = split_offset - range_list_value->start; + } + return( 1 ); - goto on_error; - } - } - else - { - /* If the range marked for removal is smaller than the current range, - * split off of the part that remains after removal and remove the rest. - */ - if( range_list_value->value != NULL ) - { - if( value_split_function( - &split_value, - range_list_value->value, - range_end, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to split value at range offset: %" PRIu64 ".", - function, - range_end ); +on_error: + return( -1 ); +} - goto on_error; - } - if( value_free_function( - &( range_list_value->value ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to free value.", - function ); +/* Splits a range + * + * A range that either overlaps a part of the range list element + * is removed by splitting the range of the range list element. + * + * Returns 1 if successful, or -1 on error + */ +int libcdata_internal_range_list_remove_split_range( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + libcdata_range_list_value_t *range_list_value, + uint64_t range_start, + uint64_t range_end, + int (*value_free_function)( + intptr_t **value, + libcerror_error_t **error ), + int (*value_split_function)( + intptr_t **destination_value, + intptr_t *source_value, + uint64_t split_range_offset, + libcerror_error_t **error ), + libcerror_error_t **error ) +{ + libcdata_range_list_value_t *split_range_list_value = NULL; + static char *function = "libcdata_internal_range_list_remove_split_range"; + uint64_t split_offset = 0; - range_list_value->value = split_value; + if( internal_range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); - goto on_error; - } - range_list_value->value = split_value; - } - range_list_value->start = range_end; - range_list_value->size = range_list_value->end - range_list_value->start; - } + return( -1 ); + } + if( range_list_element == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list element.", + function ); + + return( -1 ); + } + if( range_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list value.", + function ); + + return( -1 ); + } + if( ( range_start <= range_list_value->start ) + || ( range_end >= range_list_value->end ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid range value out of bounds.", + function ); + + return( -1 ); + } + if( range_list_value->value != NULL ) + { + if( value_free_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value free function.", + function ); + + return( -1 ); } - else + if( value_split_function == NULL ) { - if( range_list_value->end <= range_end ) - { - if( range_list_value->value != NULL ) - { - if( value_split_function( - &split_value, - range_list_value->value, - range_start, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to split value at range offset: %" PRIu64 ".", - function, - range_start ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value split function.", + function ); - goto on_error; - } - if( value_free_function( - &split_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to free value.", - function ); + return( -1 ); + } + } + split_offset = range_end; - goto on_error; - } - } - range_list_value->end = range_start; - range_list_value->size = range_list_value->end - range_list_value->start; - } - else - { - /* If the range marked for removal is smaller than the current range, - * split off of the part that remains after removal and remove the rest. - */ - if( libcdata_range_list_value_initialize( - &split_range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create range list value.", - function ); + if( libcdata_range_list_value_initialize( + &split_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create range list value.", + function ); - goto on_error; - } - if( split_range_list_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing range list value.", - function ); + goto on_error; + } + if( split_range_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing range list value.", + function ); - goto on_error; - } - split_range_list_value->start = range_end; - split_range_list_value->size = range_list_value->end - range_end; - split_range_list_value->end = range_list_value->end; + goto on_error; + } + if( range_list_value->value != NULL ) + { + if( value_split_function( + &( split_range_list_value->value ), + range_list_value->value, + split_offset, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to split value at range offset: %" PRIu64 ".", + function, + split_offset ); - if( range_list_value->value != NULL ) - { - if( value_split_function( - &( split_range_list_value->value ), - range_list_value->value, - range_end, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to split value at range offset: %" PRIu64 ".", - function, - range_end ); + goto on_error; + } + } + split_range_list_value->start = split_offset; + split_range_list_value->size = range_list_value->end - split_offset; + split_range_list_value->end = range_list_value->end; - goto on_error; - } - if( value_split_function( - &split_value, - range_list_value->value, - range_start, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to split value at range offset: %" PRIu64 ".", - function, - range_start ); + range_list_value->size = split_offset - range_list_value->start; + range_list_value->end = split_offset; - goto on_error; - } - if( value_free_function( - &split_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to free value.", - function ); + if( libcdata_internal_range_list_insert_value_after_element( + internal_range_list, + range_list_element, + split_range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert range list value after range list element.", + function ); - goto on_error; - } - } - range_list_value->size = range_start - range_list_value->start; - range_list_value->end = range_start; + goto on_error; + } + split_range_list_value = NULL; - if( libcdata_internal_range_list_insert_value( - internal_range_list, - list_element, - split_range_list_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert range list value in range list.", - function ); + if( libcdata_internal_range_list_remove_shrink_range( + internal_range_list, + range_list_element, + range_list_value, + range_start, + range_end, + value_free_function, + value_split_function, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to shrink range.", + function ); - goto on_error; - } - split_range_list_value = NULL; - } - } - range_start = next_range_start; + goto on_error; } return( 1 ); @@ -2947,7 +3513,11 @@ libcerror_error_t **error ) { libcdata_internal_range_list_t *internal_range_list = NULL; + libcdata_list_element_t *list_element = NULL; + libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_remove_range"; + uint64_t next_range_start = 0; + uint64_t range_end = 0; int result = 1; if( range_list == NULL ) @@ -2963,6 +3533,41 @@ } internal_range_list = (libcdata_internal_range_list_t *) range_list; + if( range_start > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid range start value exceeds maximum.", + function ); + + return( -1 ); + } + if( range_size > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid range size value exceeds maximum.", + function ); + + return( -1 ); + } + range_end = range_start + range_size; + + if( range_end < range_start ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid range end value out of bounds.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_range_list->read_write_lock, @@ -2978,22 +3583,139 @@ return( -1 ); } #endif - if( libcdata_internal_range_list_remove_range( - internal_range_list, - range_start, - range_size, - value_free_function, - value_split_function, - error ) != 1 ) + while( range_start < range_end ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, - "%s: unable to remove range.", - function ); + result = libcdata_internal_range_list_get_element_at_offset( + internal_range_list, + range_start, + &list_element, + error ); - result = -1; + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve list element for range offset: %" PRIu64 ".", + function, + range_start ); + + goto on_error; + } + else if( result == 0 ) + { + /* The specified range is not defined in the range list + */ + if( list_element == NULL ) + { + break; + } + } + if( libcdata_list_element_get_value( + list_element, + (intptr_t **) &range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from list element for range offset: %" PRIu64 ".", + function, + range_start ); + + goto on_error; + } + if( range_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing range list value element for range offset: %" PRIu64 ".", + function, + range_start ); + + goto on_error; + } + if( result == 0 ) + { + /* The specified range is not defined in the range list + */ + if( range_list_value->start >= range_end ) + { + break; + } + range_start = range_list_value->start; + } + next_range_start = range_list_value->end; + + if( ( range_start <= range_list_value->start ) + && ( range_end >= range_list_value->end ) ) + { + if( libcdata_internal_range_list_remove_range_value( + internal_range_list, + &list_element, + value_free_function, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED, + "%s: unable to remove range value.", + function ); + + goto on_error; + } + } + else if( ( range_start > range_list_value->start ) + && ( range_end < range_list_value->end ) ) + { + if( libcdata_internal_range_list_remove_split_range( + internal_range_list, + list_element, + range_list_value, + range_start, + range_end, + value_free_function, + value_split_function, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to split range.", + function ); + + goto on_error; + } + } + else + { + if( libcdata_internal_range_list_remove_shrink_range( + internal_range_list, + list_element, + range_list_value, + range_start, + range_end, + value_free_function, + value_split_function, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to shrink range.", + function ); + + goto on_error; + } + } + range_start = next_range_start; } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( @@ -3011,6 +3733,14 @@ } #endif return( result ); + +on_error: +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcthreads_read_write_lock_release_for_write( + internal_range_list->read_write_lock, + NULL ); +#endif + return( -1 ); } /* Retrieves a specific element from the range list @@ -3022,7 +3752,9 @@ libcdata_list_element_t **element, libcerror_error_t **error ) { - static char *function = "libcdata_internal_range_list_get_element_by_index"; + libcdata_list_element_t *current_element = NULL; + static char *function = "libcdata_internal_range_list_get_element_by_index"; + int current_element_index = 0; if( internal_range_list == NULL ) { @@ -3058,18 +3790,21 @@ return( -1 ); } - if( ( internal_range_list->current_element != NULL ) - && ( internal_range_list->current_element_index != element_index ) ) + current_element = internal_range_list->current_element; + current_element_index = internal_range_list->current_element_index; + + if( ( current_element != NULL ) + && ( current_element_index != element_index ) ) { - if( element_index < internal_range_list->current_element_index ) + if( element_index < current_element_index ) { - if( ( internal_range_list->current_element_index - element_index ) < ( internal_range_list->number_of_elements / 2 ) ) + if( ( current_element_index - element_index ) < ( internal_range_list->number_of_elements / 2 ) ) { - while( internal_range_list->current_element_index > element_index ) + while( current_element_index > element_index ) { if( libcdata_list_element_get_previous_element( - internal_range_list->current_element, - &( internal_range_list->current_element ), + current_element, + ¤t_element, error ) != 1 ) { libcerror_error_set( @@ -3078,23 +3813,23 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element: %d.", function, - internal_range_list->current_element_index ); + current_element_index ); return( -1 ); } - internal_range_list->current_element_index--; + current_element_index--; } } } else { - if( ( element_index - internal_range_list->current_element_index ) < ( internal_range_list->number_of_elements / 2 ) ) + if( ( element_index - current_element_index ) < ( internal_range_list->number_of_elements / 2 ) ) { - while( internal_range_list->current_element_index < element_index ) + while( current_element_index < element_index ) { if( libcdata_list_element_get_next_element( - internal_range_list->current_element, - &( internal_range_list->current_element ), + current_element, + ¤t_element, error ) != 1 ) { libcerror_error_set( @@ -3103,29 +3838,29 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, - internal_range_list->current_element_index ); + current_element_index ); return( -1 ); } - internal_range_list->current_element_index++; + current_element_index++; } } } } - if( ( internal_range_list->current_element == NULL ) - || ( internal_range_list->current_element_index != element_index ) ) + if( ( current_element == NULL ) + || ( current_element_index != element_index ) ) { if( element_index < ( internal_range_list->number_of_elements / 2 ) ) { - internal_range_list->current_element = internal_range_list->first_element; + current_element = internal_range_list->first_element; - for( internal_range_list->current_element_index = 0; - internal_range_list->current_element_index < element_index; - internal_range_list->current_element_index++ ) + for( current_element_index = 0; + current_element_index < element_index; + current_element_index++ ) { if( libcdata_list_element_get_next_element( - internal_range_list->current_element, - &( internal_range_list->current_element ), + current_element, + ¤t_element, error ) != 1 ) { libcerror_error_set( @@ -3134,7 +3869,7 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve next element from list element: %d.", function, - internal_range_list->current_element_index ); + current_element_index ); return( -1 ); } @@ -3142,15 +3877,15 @@ } else { - internal_range_list->current_element = internal_range_list->last_element; + current_element = internal_range_list->last_element; - for( internal_range_list->current_element_index = ( internal_range_list->number_of_elements - 1 ); - internal_range_list->current_element_index > element_index; - internal_range_list->current_element_index-- ) + for( current_element_index = ( internal_range_list->number_of_elements - 1 ); + current_element_index > element_index; + current_element_index-- ) { if( libcdata_list_element_get_previous_element( - internal_range_list->current_element, - &( internal_range_list->current_element ), + current_element, + ¤t_element, error ) != 1 ) { libcerror_error_set( @@ -3159,14 +3894,19 @@ LIBCERROR_RUNTIME_ERROR_GET_FAILED, "%s: unable to retrieve previous element from list element: %d.", function, - internal_range_list->current_element_index ); + current_element_index ); return( -1 ); } } } } - *element = internal_range_list->current_element; + if( current_element != NULL ) + { + internal_range_list->current_element = current_element; + internal_range_list->current_element_index = current_element_index; + } + *element = current_element; return( 1 ); } @@ -3703,8 +4443,9 @@ return( -1 ); } -/* Determines if a certain range is present - * Returns 1 if present, 0 if not present or -1 on error +/* Determines if a certain range is present in the list + * This function does not check for partial overlapping ranges + * Returns 1 if a range is present, 0 if not or -1 on error */ int libcdata_range_list_range_is_present( libcdata_range_list_t *range_list, @@ -3744,7 +4485,163 @@ return( -1 ); } - if( range_size > (size_t) SSIZE_MAX ) + if( range_size > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + range_end = range_start + range_size; + + if( range_end < range_start ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid range end value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_range_list->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", + function ); + + return( -1 ); + } +#endif +/* TODO add optimization using current element */ + list_element = internal_range_list->first_element; + + for( element_index = 0; + element_index < internal_range_list->number_of_elements; + element_index++ ) + { + if( libcdata_list_element_get_value( + list_element, + (intptr_t **) &range_list_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from list element: %d.", + function, + element_index ); + + goto on_error; + } + if( range_end < range_list_value->start ) + { + break; + } + if( ( range_start >= range_list_value->start ) + && ( range_end <= range_list_value->end ) ) + { + result = 1; + + break; + } + if( libcdata_list_element_get_next_element( + list_element, + &list_element, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve next element from list element: %d.", + function, + element_index ); + + goto on_error; + } + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_release_for_read( + internal_range_list->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + return( result ); + +on_error: +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcthreads_read_write_lock_release_for_read( + internal_range_list->read_write_lock, + NULL ); +#endif + return( -1 ); +} + +/* Determines if a certain range is present in the list + * This function does not check for partial overlapping ranges + * Returns 1 if a range is present, 0 if not or -1 on error + */ +int libcdata_range_list_range_has_overlapping_range( + libcdata_range_list_t *range_list, + uint64_t range_start, + uint64_t range_size, + libcerror_error_t **error ) +{ + libcdata_internal_range_list_t *internal_range_list = NULL; + libcdata_list_element_t *list_element = NULL; + libcdata_range_list_value_t *range_list_value = NULL; + static char *function = "libcdata_range_list_range_has_overlapping_range"; + uint64_t range_end = 0; + int element_index = 0; + int result = 0; + + if( range_list == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list.", + function ); + + return( -1 ); + } + internal_range_list = (libcdata_internal_range_list_t *) range_list; + + if( range_start > (uint64_t) INT64_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid range start value exceeds maximum.", + function ); + + return( -1 ); + } + if( range_size > (uint64_t) INT64_MAX ) { libcerror_error_set( error, @@ -3810,6 +4707,13 @@ break; } if( ( range_start >= range_list_value->start ) + && ( range_start < range_list_value->end ) ) + { + result = 1; + + break; + } + if( ( range_end > range_list_value->start ) && ( range_end <= range_list_value->end ) ) { result = 1; @@ -3867,8 +4771,8 @@ uint64_t *range_size, libcerror_error_t **error ) { - libcdata_range_list_value_t *range_list_value = NULL; libcdata_internal_range_list_t *internal_range_list = NULL; + libcdata_range_list_value_t *range_list_value = NULL; static char *function = "libcdata_range_list_get_spanning_range"; int element_index = 0; int result = 0; diff -Nru libbde-20190102/libcdata/libcdata_range_list.h libbde-20240223/libcdata/libcdata_range_list.h --- libbde-20190102/libcdata/libcdata_range_list.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_range_list.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Range list * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_RANGE_LIST_H ) @@ -79,8 +79,9 @@ libcerror_error_t **error ), libcerror_error_t **error ); -int libcdata_internal_range_list_empty( +int libcdata_internal_range_list_free_element( libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t **range_list_element, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), @@ -113,6 +114,7 @@ int *number_of_elements, libcerror_error_t **error ); +LIBCDATA_EXTERN \ int libcdata_range_list_get_first_element( libcdata_range_list_t *range_list, libcdata_list_element_t **element, @@ -123,38 +125,115 @@ libcdata_list_element_t *element, libcerror_error_t **error ); +LIBCDATA_EXTERN \ +int libcdata_range_list_get_last_element( + libcdata_range_list_t *range_list, + libcdata_list_element_t **element, + libcerror_error_t **error ); + int libcdata_internal_range_list_set_last_element( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *element, libcerror_error_t **error ); -int libcdata_range_list_get_last_element( - libcdata_range_list_t *range_list, +int libcdata_internal_range_list_append_element( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *element, + libcerror_error_t **error ); + +int libcdata_internal_range_list_append_value( + libcdata_internal_range_list_t *internal_range_list, + libcdata_range_list_value_t *value, + libcerror_error_t **error ); + +int libcdata_internal_range_list_remove_element( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + libcerror_error_t **error ); + +int libcdata_internal_range_list_remove_range_value( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t **range_list_element, + int (*value_free_function)( + intptr_t **value, + libcerror_error_t **error ), + libcerror_error_t **error ); + +int libcdata_internal_range_list_insert_range_find_element( + libcdata_internal_range_list_t *internal_range_list, + uint64_t range_start, + uint64_t range_end, + int *element_index, libcdata_list_element_t **element, libcerror_error_t **error ); -int libcdata_internal_range_list_append_element( +int libcdata_internal_range_list_check_range_overlap( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + uint64_t range_start, + uint64_t range_end, + libcerror_error_t **error ); + +int libcdata_internal_range_list_insert_range_before_element( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + uint64_t range_start, + uint64_t range_end, + intptr_t *value, + libcdata_list_element_t **new_range_list_element, + libcerror_error_t **error ); + +int libcdata_internal_range_list_insert_element_after_element( libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, libcdata_list_element_t *element, libcerror_error_t **error ); -int libcdata_internal_range_list_append_value( +int libcdata_internal_range_list_insert_value_after_element( libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, libcdata_range_list_value_t *value, libcerror_error_t **error ); -int libcdata_internal_range_list_insert_range( +int libcdata_internal_range_list_merge_range( libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, uint64_t range_start, - uint64_t range_size, + uint64_t range_end, intptr_t *value, - int (*value_free_function)( - intptr_t **value, + int (*value_merge_function)( + intptr_t *destination_value, + intptr_t *source_value, libcerror_error_t **error ), + libcerror_error_t **error ); + +int libcdata_internal_range_list_merge_overlapping_ranges( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, int (*value_merge_function)( intptr_t *destination_value, intptr_t *source_value, libcerror_error_t **error ), + libcdata_range_list_t *backup_range_list, + libcerror_error_t **error ); + +int libcdata_internal_range_list_insert_range_merge( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + uint64_t range_start, + uint64_t range_end, + intptr_t *value, + int (*value_merge_function)( + intptr_t *destination_value, + intptr_t *source_value, + libcerror_error_t **error ), + libcdata_range_list_t *backup_range_list, + libcerror_error_t **error ); + +int libcdata_internal_range_list_insert_range_revert_merge( + libcdata_internal_range_list_t *internal_range_list, + libcdata_list_element_t *range_list_element, + libcdata_range_list_t *backup_range_list, libcerror_error_t **error ); LIBCDATA_EXTERN \ @@ -185,27 +264,28 @@ libcerror_error_t **error ), libcerror_error_t **error ); -int libcdata_internal_range_list_insert_element( +int libcdata_internal_range_list_remove_shrink_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, - libcdata_list_element_t *element, + libcdata_range_list_value_t *range_list_value, + uint64_t range_start, + uint64_t range_end, + int (*value_free_function)( + intptr_t **value, + libcerror_error_t **error ), + int (*value_split_function)( + intptr_t **destination_value, + intptr_t *source_value, + uint64_t split_range_offset, + libcerror_error_t **error ), libcerror_error_t **error ); -int libcdata_internal_range_list_insert_value( +int libcdata_internal_range_list_remove_split_range( libcdata_internal_range_list_t *internal_range_list, libcdata_list_element_t *range_list_element, - libcdata_range_list_value_t *value, - libcerror_error_t **error ); - -int libcdata_internal_range_list_remove_element( - libcdata_internal_range_list_t *internal_range_list, - libcdata_list_element_t *element, - libcerror_error_t **error ); - -int libcdata_internal_range_list_remove_range( - libcdata_internal_range_list_t *internal_range_list, + libcdata_range_list_value_t *range_list_value, uint64_t range_start, - uint64_t range_size, + uint64_t range_end, int (*value_free_function)( intptr_t **value, libcerror_error_t **error ), @@ -278,6 +358,13 @@ libcdata_range_list_t *range_list, uint64_t range_start, uint64_t range_size, + libcerror_error_t **error ); + +LIBCDATA_EXTERN \ +int libcdata_range_list_range_has_overlapping_range( + libcdata_range_list_t *range_list, + uint64_t range_start, + uint64_t range_size, libcerror_error_t **error ); LIBCDATA_EXTERN \ diff -Nru libbde-20190102/libcdata/libcdata_range_list_value.c libbde-20240223/libcdata/libcdata_range_list_value.c --- libbde-20190102/libcdata/libcdata_range_list_value.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_range_list_value.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Range list value * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -381,3 +381,49 @@ return( 1 ); } +/* Checks if the range overlaps with the range list value + * Returns 1 if the range overlaps, 0 if not or -1 on error + */ +int libcdata_range_list_value_check_range_overlap( + libcdata_range_list_value_t *range_list_value, + uint64_t range_start, + uint64_t range_end, + libcerror_error_t **error ) +{ + static char *function = "libcdata_range_list_value_check_range_overlap"; + + if( range_list_value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid range list value.", + function ); + + return( -1 ); + } + /* Check if the range overlaps the existing range entirely + */ + if( ( range_start < range_list_value->start ) + && ( range_end > range_list_value->end ) ) + { + return( 1 ); + } + /* Check if the range overlaps at the end of the existing range + */ + if( ( range_start >= range_list_value->start ) + && ( range_start <= range_list_value->end ) ) + { + return( 1 ); + } + /* Check if the range overlaps at the beginning of the existing range + */ + if( ( range_end >= range_list_value->start ) + && ( range_end <= range_list_value->end ) ) + { + return( 1 ); + } + return( 0 ); +} + diff -Nru libbde-20190102/libcdata/libcdata_range_list_value.h libbde-20240223/libcdata/libcdata_range_list_value.h --- libbde-20190102/libcdata/libcdata_range_list_value.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_range_list_value.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Range list value * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_RANGE_LIST_VALUE_H ) @@ -86,6 +86,12 @@ libcerror_error_t **error ), libcerror_error_t **error ); +int libcdata_range_list_value_check_range_overlap( + libcdata_range_list_value_t *range_list_value, + uint64_t range_start, + uint64_t range_end, + libcerror_error_t **error ); + #if defined( __cplusplus ) } #endif diff -Nru libbde-20190102/libcdata/libcdata_support.c libbde-20240223/libcdata/libcdata_support.c --- libbde-20190102/libcdata/libcdata_support.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_support.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcdata/libcdata_support.h libbde-20240223/libcdata/libcdata_support.h --- libbde-20190102/libcdata/libcdata_support.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_support.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_SUPPORT_H ) diff -Nru libbde-20190102/libcdata/libcdata_tree_node.c libbde-20240223/libcdata/libcdata_tree_node.c --- libbde-20190102/libcdata/libcdata_tree_node.c 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_tree_node.c 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Tree functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -103,7 +103,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize read/write lock.", + "%s: unable to initialize read/write lock.", function ); goto on_error; @@ -314,7 +314,7 @@ { internal_node->last_sub_node = next_node; } - internal_node->number_of_sub_nodes--; + internal_node->number_of_sub_nodes -= 1; if( next_node != NULL ) { @@ -472,45 +472,45 @@ } internal_source_node = (libcdata_internal_tree_node_t *) source_node; - if( libcdata_tree_node_initialize( - (libcdata_tree_node_t **) &internal_destination_node, +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_source_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination tree node.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", function ); return( -1 ); } - if( internal_destination_node == NULL ) +#endif + if( libcdata_tree_node_initialize( + (libcdata_tree_node_t **) &internal_destination_node, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing destination tree node.", + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create destination tree node.", function ); - return( -1 ); + goto on_error; } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_read( - internal_source_node->read_write_lock, - error ) != 1 ) + if( internal_destination_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for reading.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: missing destination tree node.", function ); - return( -1 ); + goto on_error; } -#endif if( value_clone_function( &( internal_destination_node->value ), internal_source_node->value, @@ -723,6 +723,10 @@ libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_value"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + intptr_t *backup_value = NULL; +#endif + if( node == NULL ) { libcerror_error_set( @@ -750,7 +754,9 @@ return( -1 ); } + backup_value = internal_node->value; #endif + internal_node->value = value; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) @@ -765,10 +771,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_node->value = backup_value; + + return( -1 ); +#endif } /* Retrieves the parent node from the tree node @@ -852,6 +865,10 @@ libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_parent_node"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_parent_node = NULL; +#endif + if( node == NULL ) { libcerror_error_set( @@ -879,7 +896,9 @@ return( -1 ); } + backup_parent_node = internal_node->parent_node; #endif + internal_node->parent_node = parent_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) @@ -894,10 +913,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_node->parent_node = backup_parent_node; + + return( -1 ); +#endif } /* Retrieves the previous node from the tree node @@ -981,6 +1007,10 @@ libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_previous_node"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_previous_node = NULL; +#endif + if( node == NULL ) { libcerror_error_set( @@ -1008,7 +1038,9 @@ return( -1 ); } + backup_previous_node = internal_node->previous_node; #endif + internal_node->previous_node = previous_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) @@ -1023,10 +1055,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_node->previous_node = backup_previous_node; + + return( -1 ); +#endif } /* Retrieves the next node from the tree node @@ -1110,6 +1149,10 @@ libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_next_node"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_next_node = NULL; +#endif + if( node == NULL ) { libcerror_error_set( @@ -1137,7 +1180,9 @@ return( -1 ); } + backup_next_node = internal_node->next_node ; #endif + internal_node->next_node = next_node; #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) @@ -1152,10 +1197,17 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_node->next_node = backup_next_node; + + return( -1 ); +#endif } /* Retrieves the nodes from the tree node @@ -1267,6 +1319,12 @@ libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_nodes"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_next_node = NULL; + libcdata_tree_node_t *backup_parent_node = NULL; + libcdata_tree_node_t *backup_previous_node = NULL; +#endif + if( node == NULL ) { libcerror_error_set( @@ -1294,7 +1352,11 @@ return( -1 ); } + backup_parent_node = internal_node->parent_node; + backup_previous_node = internal_node->previous_node; + backup_next_node = internal_node->next_node; #endif + internal_node->parent_node = parent_node; internal_node->previous_node = previous_node; internal_node->next_node = next_node; @@ -1311,12 +1373,361 @@ "%s: unable to release read/write lock for writing.", function ); + goto on_error; + } +#endif + return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_node->parent_node = backup_parent_node; + internal_node->previous_node = backup_previous_node; + internal_node->next_node = backup_next_node; + + return( -1 ); +#endif +} + +/* Retrieves the first sub node from the tree node + * Returns 1 if successful or -1 on error + */ +int libcdata_tree_node_get_first_sub_node( + libcdata_tree_node_t *node, + libcdata_tree_node_t **first_sub_node, + libcerror_error_t **error ) +{ + libcdata_internal_tree_node_t *internal_node = NULL; + static char *function = "libcdata_tree_node_get_first_sub_node"; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + internal_node = (libcdata_internal_tree_node_t *) node; + + if( first_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid first sub node.", + function ); + + return( -1 ); + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_node->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + *first_sub_node = internal_node->first_sub_node; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_release_for_read( + internal_node->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for reading.", + function ); + return( -1 ); } #endif return( 1 ); } +/* Sets the first sub node in the tree node + * Returns 1 if successful or -1 on error + */ +int libcdata_internal_tree_node_set_first_sub_node( + libcdata_internal_tree_node_t *internal_node, + libcdata_tree_node_t *first_sub_node, + libcerror_error_t **error ) +{ + libcdata_tree_node_t *backup_first_sub_node = NULL; + libcdata_tree_node_t *backup_previous_node = NULL; + static char *function = "libcdata_internal_tree_node_set_first_sub_node"; + + if( internal_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( first_sub_node != NULL ) + { + if( libcdata_tree_node_get_previous_node( + first_sub_node, + &backup_previous_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous node of sub node.", + function ); + + return( -1 ); + } + } + backup_first_sub_node = internal_node->first_sub_node; + + if( first_sub_node != NULL ) + { + if( libcdata_tree_node_set_previous_node( + first_sub_node, + internal_node->first_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous node of sub node.", + function ); + + goto on_error; + } + } + if( internal_node->first_sub_node != NULL ) + { + if( libcdata_tree_node_set_next_node( + internal_node->first_sub_node, + first_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next node of first sub node.", + function ); + + goto on_error; + } + } + internal_node->first_sub_node = first_sub_node; + + return( 1 ); + +on_error: + if( first_sub_node != NULL ) + { + libcdata_tree_node_set_previous_node( + first_sub_node, + backup_previous_node, + NULL ); + } + if( backup_first_sub_node != NULL ) + { + libcdata_tree_node_set_next_node( + backup_first_sub_node, + NULL, + NULL ); + } + internal_node->first_sub_node = backup_first_sub_node; + + return( -1 ); +} + +/* Retrieves the last sub node from the tree node + * Returns 1 if successful or -1 on error + */ +int libcdata_tree_node_get_last_sub_node( + libcdata_tree_node_t *node, + libcdata_tree_node_t **last_sub_node, + libcerror_error_t **error ) +{ + libcdata_internal_tree_node_t *internal_node = NULL; + static char *function = "libcdata_tree_node_get_last_sub_node"; + + if( node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + internal_node = (libcdata_internal_tree_node_t *) node; + + if( last_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid last sub node.", + function ); + + return( -1 ); + } +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_read( + internal_node->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + *last_sub_node = internal_node->last_sub_node; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_release_for_read( + internal_node->read_write_lock, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to release read/write lock for reading.", + function ); + + return( -1 ); + } +#endif + return( 1 ); +} + +/* Sets the last sub node in the tree node + * Returns 1 if successful or -1 on error + */ +int libcdata_internal_tree_node_set_last_sub_node( + libcdata_internal_tree_node_t *internal_node, + libcdata_tree_node_t *last_sub_node, + libcerror_error_t **error ) +{ + libcdata_tree_node_t *backup_last_sub_node = NULL; + libcdata_tree_node_t *backup_previous_node = NULL; + static char *function = "libcdata_internal_tree_node_set_last_sub_node"; + + if( internal_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); + + return( -1 ); + } + if( last_sub_node != NULL ) + { + if( libcdata_tree_node_get_previous_node( + last_sub_node, + &backup_previous_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous node of sub node.", + function ); + + return( -1 ); + } + } + backup_last_sub_node = internal_node->last_sub_node; + + if( last_sub_node != NULL ) + { + if( libcdata_tree_node_set_previous_node( + last_sub_node, + internal_node->last_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous node of sub node.", + function ); + + goto on_error; + } + } + if( internal_node->last_sub_node != NULL ) + { + if( libcdata_tree_node_set_next_node( + internal_node->last_sub_node, + last_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next node of last sub node.", + function ); + + goto on_error; + } + } + internal_node->last_sub_node = last_sub_node; + + return( 1 ); + +on_error: + if( last_sub_node != NULL ) + { + libcdata_tree_node_set_previous_node( + last_sub_node, + backup_previous_node, + NULL ); + } + if( backup_last_sub_node != NULL ) + { + libcdata_tree_node_set_next_node( + backup_last_sub_node, + NULL, + NULL ); + } + internal_node->last_sub_node = backup_last_sub_node; + + return( -1 ); +} + /* Retrieves the sub nodes from the tree node * Returns 1 if successful or -1 on error */ @@ -1412,6 +1823,11 @@ libcdata_internal_tree_node_t *internal_node = NULL; static char *function = "libcdata_tree_node_set_sub_nodes"; +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_first_sub_node = NULL; + libcdata_tree_node_t *backup_last_sub_node = NULL; +#endif + if( node == NULL ) { libcerror_error_set( @@ -1439,7 +1855,10 @@ return( -1 ); } + backup_first_sub_node = internal_node->first_sub_node; + backup_last_sub_node = internal_node->last_sub_node; #endif + internal_node->first_sub_node = first_sub_node; internal_node->last_sub_node = last_sub_node; @@ -1455,10 +1874,18 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + internal_node->first_sub_node = backup_first_sub_node; + internal_node->last_sub_node = backup_last_sub_node; + + return( -1 ); +#endif } /* Appends a sub tree node to the node @@ -1620,7 +2047,7 @@ return( -1 ); } - internal_node->number_of_sub_nodes++; + internal_node->number_of_sub_nodes += 1; return( 1 ); } @@ -1630,12 +2057,20 @@ */ int libcdata_tree_node_append_node( libcdata_tree_node_t *node, - libcdata_tree_node_t *sub_node, + libcdata_tree_node_t *node_to_append, libcerror_error_t **error ) { - libcdata_internal_tree_node_t *internal_node = NULL; - static char *function = "libcdata_tree_node_append_node"; - int result = 1; + libcdata_internal_tree_node_t *internal_node = NULL; + libcdata_tree_node_t *to_append_next_node = NULL; + libcdata_tree_node_t *to_append_parent_node = NULL; + libcdata_tree_node_t *to_append_previous_node = NULL; + static char *function = "libcdata_tree_node_append_node"; + int result = 1; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_first_sub_node = NULL; + libcdata_tree_node_t *backup_last_sub_node = NULL; +#endif if( node == NULL ) { @@ -1650,6 +2085,85 @@ } internal_node = (libcdata_internal_tree_node_t *) node; + if( internal_node->number_of_sub_nodes == 0 ) + { + if( internal_node->first_sub_node != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first sub node already set.", + function ); + + return( -1 ); + } + if( internal_node->last_sub_node != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last sub node already set.", + function ); + + return( -1 ); + } + } + else + { + if( internal_node->first_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first sub node.", + function ); + + return( -1 ); + } + if( internal_node->last_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last sub node.", + function ); + + return( -1 ); + } + } + if( libcdata_tree_node_get_nodes( + node_to_append, + &to_append_parent_node, + &to_append_previous_node, + &to_append_next_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve nodes of node to append.", + function ); + + return( -1 ); + } + if( ( to_append_parent_node != NULL ) + || ( to_append_previous_node != NULL ) + || ( to_append_next_node != NULL ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid node to append - node is already part of a tree.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, @@ -1664,21 +2178,92 @@ return( -1 ); } + backup_first_sub_node = internal_node->first_sub_node; + backup_last_sub_node = internal_node->last_sub_node; #endif - if( libcdata_internal_tree_node_append_node( - internal_node, - sub_node, - error ) != 1 ) + + result = libcdata_tree_node_set_parent_node( + node_to_append, + node, + error ); + + if( result != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append node.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set parent node of node to append.", function ); result = -1; } + if( result == 1 ) + { + result = libcdata_tree_node_set_previous_node( + node_to_append, + internal_node->last_sub_node, + error ); + + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous node of node to append.", + function ); + + libcdata_tree_node_set_parent_node( + node_to_append, + NULL, + NULL ); + + result = -1; + } + } + if( result == 1 ) + { + if( internal_node->last_sub_node != NULL ) + { + result = libcdata_tree_node_set_next_node( + internal_node->last_sub_node, + node_to_append, + error ); + + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next node of last sub node.", + function ); + + libcdata_tree_node_set_parent_node( + node_to_append, + NULL, + NULL ); + + libcdata_tree_node_set_previous_node( + node_to_append, + NULL, + NULL ); + + result = -1; + } + } + } + if( result == 1 ) + { + if( internal_node->first_sub_node == NULL ) + { + internal_node->first_sub_node = node_to_append; + } + internal_node->last_sub_node = node_to_append; + + internal_node->number_of_sub_nodes += 1; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, @@ -1691,10 +2276,30 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( result ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + libcdata_tree_node_set_parent_node( + node_to_append, + NULL, + NULL ); + + libcdata_tree_node_set_previous_node( + node_to_append, + NULL, + NULL ); + + internal_node->first_sub_node = backup_first_sub_node; + internal_node->last_sub_node = backup_last_sub_node; + + internal_node->number_of_sub_nodes -= 1; + + return( -1 ); +#endif } /* Appends a value to the node @@ -1706,9 +2311,8 @@ intptr_t *value, libcerror_error_t **error ) { - libcdata_internal_tree_node_t *internal_node = NULL; - libcdata_tree_node_t *sub_node = NULL; - static char *function = "libcdata_tree_node_append_value"; + libcdata_tree_node_t *sub_node = NULL; + static char *function = "libcdata_tree_node_append_value"; if( node == NULL ) { @@ -1721,23 +2325,6 @@ return( -1 ); } - internal_node = (libcdata_internal_tree_node_t *) node; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_node->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif if( libcdata_tree_node_initialize( &sub_node, error ) != 1 ) @@ -1765,8 +2352,8 @@ goto on_error; } - if( libcdata_internal_tree_node_append_node( - internal_node, + if( libcdata_tree_node_append_node( + node, sub_node, error ) != 1 ) { @@ -1779,29 +2366,9 @@ goto on_error; } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_node->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); - - return( -1 ); - } -#endif return( 1 ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_node->read_write_lock, - NULL ); -#endif if( sub_node != NULL ) { libcdata_tree_node_free( @@ -1812,37 +2379,38 @@ return( -1 ); } -/* Inserts a sub tree node in the node + +/* Retrieves the node which the sub node should be inserted before * - * Uses the entry_compare_function to determine the order of the entries - * The entry_compare_function should return LIBCDATA_COMPARE_LESS, + * Uses the value_compare_function to determine the order of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * - * Duplicate entries are allowed by default and inserted after the last duplicate entry. + * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * - * Returns 1 if successful, 0 if the node already exists or -1 on error + * On return sub_node will be set to NULL if the sub node should be inserted at the end of the list. + * + * Returns 1 if successful, 0 if a sub node containing the value already exists or -1 on error */ -int libcdata_internal_tree_node_insert_node( +int libcdata_internal_tree_node_insert_node_find_sub_node( libcdata_internal_tree_node_t *internal_node, - libcdata_tree_node_t *node_to_insert, + intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, + int *sub_node_index, + libcdata_tree_node_t **sub_node, libcerror_error_t **error ) { - libcdata_tree_node_t *previous_node = NULL; - libcdata_tree_node_t *sub_node = NULL; - libcdata_tree_node_t *to_insert_next_node = NULL; - libcdata_tree_node_t *to_insert_parent_node = NULL; - libcdata_tree_node_t *to_insert_previous_node = NULL; - intptr_t *sub_node_value = NULL; - intptr_t *value_to_insert = NULL; - static char *function = "libcdata_internal_tree_node_insert_node"; - int result = -1; - int sub_node_index = 0; + libcdata_tree_node_t *sub_tree_node = NULL; + intptr_t *sub_node_value = NULL; + static char *function = "libcdata_internal_tree_node_insert_node_find_sub_node"; + int compare_result = 0; + int result = 1; + int safe_sub_node_index = 0; if( internal_node == NULL ) { @@ -1855,298 +2423,249 @@ return( -1 ); } - if( node_to_insert == NULL ) + if( value_compare_function == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node to insert.", + "%s: invalid value compare function.", function ); return( -1 ); } - if( libcdata_tree_node_get_nodes( - node_to_insert, - &to_insert_parent_node, - &to_insert_previous_node, - &to_insert_next_node, - error ) != 1 ) + if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve nodes of node to insert.", - function ); + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported insert flags: 0x%02" PRIx8 ".", + function, + insert_flags ); return( -1 ); } - if( ( to_insert_parent_node != NULL ) - || ( to_insert_previous_node != NULL ) - || ( to_insert_next_node != NULL ) ) + if( sub_node_index == NULL ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid node to insert - node is already part of a tree.", + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid sub node index.", function ); return( -1 ); } - if( value_compare_function == NULL ) + if( sub_node == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value compare function.", + "%s: invalid sub node.", function ); return( -1 ); } - if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported insert flags: 0x%02" PRIx8 ".", - function, - insert_flags ); + sub_tree_node = internal_node->first_sub_node; - return( -1 ); - } - if( internal_node->number_of_sub_nodes == 0 ) + for( safe_sub_node_index = 0; + safe_sub_node_index < internal_node->number_of_sub_nodes; + safe_sub_node_index++ ) { - if( internal_node->first_sub_node != NULL ) + if( libcdata_tree_node_get_value( + sub_tree_node, + &sub_node_value, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: corruption detected - first sub node already set.", - function ); + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value of sub node: %d.", + function, + safe_sub_node_index ); return( -1 ); } - if( internal_node->last_sub_node != NULL ) + compare_result = value_compare_function( + value_to_insert, + sub_node_value, + error ); + + if( compare_result == -1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: corruption detected - last sub node already set.", - function ); + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to compare sub node: %d.", + function, + safe_sub_node_index ); return( -1 ); } - internal_node->first_sub_node = node_to_insert; - internal_node->last_sub_node = node_to_insert; - } - else - { - if( internal_node->first_sub_node == NULL ) + else if( compare_result == LIBCDATA_COMPARE_EQUAL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - missing first sub node.", - function ); + if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) + { + result = 0; - return( -1 ); + break; + } } - if( internal_node->last_sub_node == NULL ) + else if( compare_result == LIBCDATA_COMPARE_LESS ) + { + break; + } + else if( compare_result != LIBCDATA_COMPARE_GREATER ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - missing last sub node.", - function ); + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported value compare function return value: %d.", + function, + result ); return( -1 ); } - if( libcdata_tree_node_get_value( - node_to_insert, - &value_to_insert, + if( libcdata_tree_node_get_next_node( + sub_tree_node, + &sub_tree_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value of node to insert.", - function ); + "%s: unable to retrieve next node of sub node: %d.", + function, + safe_sub_node_index ); return( -1 ); } - sub_node = internal_node->first_sub_node; + } + if( ( compare_result == LIBCDATA_COMPARE_EQUAL ) + || ( compare_result == LIBCDATA_COMPARE_LESS ) ) + { + *sub_node_index = safe_sub_node_index; + *sub_node = sub_tree_node; + } + else + { + *sub_node_index = internal_node->number_of_sub_nodes; + *sub_node = NULL; + } + return( result ); +} - for( sub_node_index = 0; - sub_node_index < internal_node->number_of_sub_nodes; - sub_node_index++ ) - { - if( libcdata_tree_node_get_value( - sub_node, - &sub_node_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value of sub node: %d.", - function, - sub_node_index ); +/* Inserts the node before the sub node + * If sub_node is NULL the node is inserted before or as the first sub node in the list + * Returns 1 if successful, or -1 on error + */ +int libcdata_internal_tree_node_insert_node_before_sub_node( + libcdata_internal_tree_node_t *internal_node, + libcdata_tree_node_t *sub_node, + libcdata_tree_node_t *node_to_insert, + libcerror_error_t **error ) +{ + libcdata_tree_node_t *backup_first_sub_node = NULL; + libcdata_tree_node_t *backup_last_sub_node = NULL; + libcdata_tree_node_t *previous_node = NULL; + static char *function = "libcdata_internal_tree_node_insert_node_before_sub_node"; - return( -1 ); - } - result = value_compare_function( - value_to_insert, - sub_node_value, - error ); + if( internal_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node.", + function ); - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare sub node: %d.", - function, - sub_node_index ); + return( -1 ); + } + if( node_to_insert == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node to insert.", + function ); - return( -1 ); - } - else if( result == LIBCDATA_COMPARE_EQUAL ) - { - if( ( insert_flags & LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) != 0 ) - { - return( 0 ); - } - } - else if( result == LIBCDATA_COMPARE_LESS ) - { - break; - } - else if( result != LIBCDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported value compare function return value: %d.", - function, - result ); + return( -1 ); + } + backup_first_sub_node = internal_node->first_sub_node; + backup_last_sub_node = internal_node->last_sub_node; - return( -1 ); - } - if( libcdata_tree_node_get_next_node( - sub_node, - &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next node of sub node: %d.", - function, - sub_node_index ); + if( sub_node != NULL ) + { + if( libcdata_tree_node_get_previous_node( + sub_node, + &previous_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve previous node from sub node.", + function ); - return( -1 ); - } + return( -1 ); } - if( result == LIBCDATA_COMPARE_LESS ) + } + if( internal_node->number_of_sub_nodes == 0 ) + { + internal_node->first_sub_node = node_to_insert; + internal_node->last_sub_node = node_to_insert; + } + else if( sub_node == NULL ) + { + if( libcdata_internal_tree_node_set_last_sub_node( + internal_node, + node_to_insert, + error ) != 1 ) { - if( libcdata_tree_node_get_previous_node( - sub_node, - &previous_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous node of sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libcdata_tree_node_set_nodes( - node_to_insert, - NULL, - previous_node, - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous and next node of node to insert.", - function ); - - return( -1 ); - } - if( sub_node == internal_node->first_sub_node ) - { - internal_node->first_sub_node = node_to_insert; - } - else - { - if( previous_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: corruption detected - missing previous node in sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libcdata_tree_node_set_next_node( - previous_node, - node_to_insert, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next node of sub node: %d.", - function, - sub_node_index - 1 ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set last sub node.", + function ); - return( -1 ); - } - } - if( libcdata_tree_node_set_previous_node( - sub_node, - node_to_insert, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous node of sub node: %d.", - function, - sub_node_index ); + goto on_error; + } + } + else + { + if( libcdata_tree_node_set_nodes( + node_to_insert, + (libcdata_tree_node_t *) internal_node, + previous_node, + sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set parent, previous and next node of node to insert.", + function ); - return( -1 ); - } + goto on_error; + } + if( internal_node->first_sub_node == sub_node ) + { + internal_node->first_sub_node = node_to_insert; } else { if( libcdata_tree_node_set_next_node( - internal_node->last_sub_node, + previous_node, node_to_insert, error ) != 1 ) { @@ -2154,26 +2673,25 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next node of last sub node.", + "%s: unable to set next node of previous node.", function ); - return( -1 ); + goto on_error; } - if( libcdata_tree_node_set_previous_node( - node_to_insert, - internal_node->last_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous node of node to insert.", - function ); + } + if( libcdata_tree_node_set_previous_node( + sub_node, + node_to_insert, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous node of sub node.", + function ); - return( -1 ); - } - internal_node->last_sub_node = node_to_insert; + goto on_error; } } if( libcdata_tree_node_set_parent_node( @@ -2188,20 +2706,49 @@ "%s: unable to set parent node of node to insert.", function ); - return( -1 ); + goto on_error; } - internal_node->number_of_sub_nodes++; + internal_node->number_of_sub_nodes += 1; return( 1 ); + +on_error: + if( node_to_insert != NULL ) + { + libcdata_tree_node_set_nodes( + node_to_insert, + NULL, + NULL, + NULL, + NULL ); + } + if( previous_node != NULL ) + { + libcdata_tree_node_set_next_node( + previous_node, + sub_node, + NULL ); + } + if( sub_node != NULL ) + { + libcdata_tree_node_set_previous_node( + sub_node, + previous_node, + NULL ); + } + internal_node->first_sub_node = backup_first_sub_node; + internal_node->last_sub_node = backup_last_sub_node; + + return( -1 ); } -/* Inserts a sub tree node in the node +/* Inserts a sub node in the node * - * Uses the entry_compare_function to determine the order of the entries - * The entry_compare_function should return LIBCDATA_COMPARE_LESS, + * Uses the value_compare_function to determine the order of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * - * Duplicate entries are allowed by default and inserted after the last duplicate entry. + * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the node already exists or -1 on error @@ -2217,8 +2764,19 @@ libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; + libcdata_tree_node_t *next_node = NULL; + libcdata_tree_node_t *parent_node = NULL; + libcdata_tree_node_t *previous_node = NULL; + libcdata_tree_node_t *sub_node = NULL; + intptr_t *value_to_insert = NULL; static char *function = "libcdata_tree_node_insert_node"; int result = 1; + int sub_node_index = 0; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_first_sub_node = NULL; + libcdata_tree_node_t *backup_last_sub_node = NULL; +#endif if( node == NULL ) { @@ -2233,6 +2791,133 @@ } internal_node = (libcdata_internal_tree_node_t *) node; + if( internal_node->number_of_sub_nodes == 0 ) + { + if( internal_node->first_sub_node != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first sub node already set.", + function ); + + return( -1 ); + } + if( internal_node->last_sub_node != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last sub node already set.", + function ); + + return( -1 ); + } + } + else + { + if( internal_node->first_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first sub node.", + function ); + + return( -1 ); + } + if( internal_node->last_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last sub node.", + function ); + + return( -1 ); + } + } + if( node_to_insert == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid node to insert.", + function ); + + return( -1 ); + } + if( value_compare_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value compare function.", + function ); + + return( -1 ); + } + if( ( insert_flags & ~( LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES ) ) != 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported insert flags: 0x%02" PRIx8 ".", + function, + insert_flags ); + + return( -1 ); + } + if( libcdata_tree_node_get_nodes( + node_to_insert, + &parent_node, + &previous_node, + &next_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve nodes of node to insert.", + function ); + + return( -1 ); + } + if( ( parent_node != NULL ) + || ( previous_node != NULL ) + || ( next_node != NULL ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid node to insert - node is already part of a tree.", + function ); + + return( -1 ); + } + if( libcdata_tree_node_get_value( + node_to_insert, + &value_to_insert, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve value from node to insert.", + function ); + + return( -1 ); + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_write( internal_node->read_write_lock, @@ -2247,12 +2932,17 @@ return( -1 ); } + backup_first_sub_node = internal_node->first_sub_node; + backup_last_sub_node = internal_node->last_sub_node; #endif - result = libcdata_internal_tree_node_insert_node( + + result = libcdata_internal_tree_node_insert_node_find_sub_node( internal_node, - node_to_insert, + value_to_insert, value_compare_function, insert_flags, + &sub_node_index, + &sub_node, error ); if( result == -1 ) @@ -2260,12 +2950,53 @@ libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert node.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to find sub node in tree node.", function ); result = -1; } + else if( result == 1 ) + { + if( sub_node != NULL ) + { + if( libcdata_tree_node_get_nodes( + sub_node, + &parent_node, + &previous_node, + &next_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve nodes of sub node: %d.", + function, + sub_node_index ); + + result = -1; + } + } + if( result == 1 ) + { + if( libcdata_internal_tree_node_insert_node_before_sub_node( + internal_node, + sub_node, + node_to_insert, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to insert node before tree sub node.", + function ); + + result = -1; + } + } + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, @@ -2278,21 +3009,56 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( result ); + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) +on_error: + if( result == 1 ) + { + if( node_to_insert != NULL ) + { + libcdata_tree_node_set_nodes( + node_to_insert, + NULL, + NULL, + NULL, + NULL ); + } + if( previous_node != NULL ) + { + libcdata_tree_node_set_next_node( + previous_node, + sub_node, + NULL ); + } + if( sub_node != NULL ) + { + libcdata_tree_node_set_previous_node( + sub_node, + previous_node, + NULL ); + } + internal_node->first_sub_node = backup_first_sub_node; + internal_node->last_sub_node = backup_last_sub_node; + + internal_node->number_of_sub_nodes -= 1; + } + return( -1 ); +#endif } /* Inserts a value in the node * * Creates a new sub tree node * - * Uses the entry_compare_function to determine the order of the entries - * The entry_compare_function should return LIBCDATA_COMPARE_LESS, + * Uses the value_compare_function to determine the order of the entries + * The value_compare_function should return LIBCDATA_COMPARE_LESS, * LIBCDATA_COMPARE_EQUAL, LIBCDATA_COMPARE_GREATER if successful or -1 on error * - * Duplicate entries are allowed by default and inserted after the last duplicate entry. + * Duplicate entries are allowed by default and inserted after the last duplicate value. * Only allowing unique entries can be enforced by setting the flag LIBCDATA_INSERT_FLAG_UNIQUE_ENTRIES * * Returns 1 if successful, 0 if the node already exists or -1 on error @@ -2307,10 +3073,9 @@ uint8_t insert_flags, libcerror_error_t **error ) { - libcdata_internal_tree_node_t *internal_node = NULL; - libcdata_tree_node_t *sub_node = NULL; - static char *function = "libcdata_tree_node_insert_value"; - int result = 0; + libcdata_tree_node_t *sub_node = NULL; + static char *function = "libcdata_tree_node_insert_value"; + int result = 0; if( node == NULL ) { @@ -2323,23 +3088,6 @@ return( -1 ); } - internal_node = (libcdata_internal_tree_node_t *) node; - -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_node->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif if( libcdata_tree_node_initialize( &sub_node, error ) != 1 ) @@ -2367,8 +3115,8 @@ goto on_error; } - result = libcdata_internal_tree_node_insert_node( - internal_node, + result = libcdata_tree_node_insert_node( + node, sub_node, value_compare_function, insert_flags, @@ -2402,29 +3150,9 @@ goto on_error; } } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_release_for_write( - internal_node->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to release read/write lock for writing.", - function ); - - return( -1 ); - } -#endif return( result ); on_error: -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_node->read_write_lock, - NULL ); -#endif if( sub_node != NULL ) { libcdata_tree_node_free( @@ -2443,16 +3171,19 @@ libcdata_tree_node_t *replacement_node, libcerror_error_t **error ) { - libcdata_internal_tree_node_t *internal_node = NULL; - libcdata_tree_node_t *next_node = NULL; - libcdata_tree_node_t *parent_first_sub_node = NULL; - libcdata_tree_node_t *parent_last_sub_node = NULL; - libcdata_tree_node_t *parent_node = NULL; - libcdata_tree_node_t *previous_node = NULL; - libcdata_tree_node_t *replacement_next_node = NULL; - libcdata_tree_node_t *replacement_parent_node = NULL; - libcdata_tree_node_t *replacement_previous_node = NULL; - static char *function = "libcdata_tree_node_replace_node"; + libcdata_internal_tree_node_t *internal_node = NULL; + libcdata_tree_node_t *backup_parent_first_sub_node = NULL; + libcdata_tree_node_t *backup_parent_last_sub_node = NULL; + libcdata_tree_node_t *next_node = NULL; + libcdata_tree_node_t *parent_first_sub_node = NULL; + libcdata_tree_node_t *parent_last_sub_node = NULL; + libcdata_tree_node_t *parent_node = NULL; + libcdata_tree_node_t *previous_node = NULL; + libcdata_tree_node_t *replacement_next_node = NULL; + libcdata_tree_node_t *replacement_parent_node = NULL; + libcdata_tree_node_t *replacement_previous_node = NULL; + static char *function = "libcdata_tree_node_replace_node"; + int result = 1; if( node == NULL ) { @@ -2489,21 +3220,6 @@ return( -1 ); } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_node->read_write_lock, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", - function ); - - return( -1 ); - } -#endif if( libcdata_tree_node_get_nodes( replacement_node, &replacement_parent_node, @@ -2518,7 +3234,7 @@ "%s: unable to retrieve nodes of replacement node.", function ); - goto on_error; + return( -1 ); } if( ( replacement_parent_node != NULL ) || ( replacement_previous_node != NULL ) @@ -2528,111 +3244,189 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid replacement node - node is already part of a tree.", - function ); - - goto on_error; - } - if( libcdata_tree_node_get_sub_nodes( - internal_node->parent_node, - &parent_first_sub_node, - &parent_last_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub nodes of parent node.", + "%s: invalid replacement node - already part of a tree.", function ); - goto on_error; - } - parent_node = internal_node->parent_node; - internal_node->parent_node = replacement_parent_node; - replacement_parent_node = parent_node; - - previous_node = internal_node->previous_node; - internal_node->previous_node = replacement_previous_node; - replacement_previous_node = previous_node; - - next_node = internal_node->next_node; - internal_node->next_node = replacement_next_node; - replacement_next_node = next_node; - - if( parent_first_sub_node == node ) - { - parent_first_sub_node = replacement_node; - } - if( parent_last_sub_node == node ) - { - parent_last_sub_node = replacement_node; - } - if( libcdata_tree_node_set_nodes( - replacement_node, - replacement_parent_node, - replacement_previous_node, - replacement_next_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set nodes of replacement node.", - function ); - - goto on_error; + return( -1 ); } - if( libcdata_tree_node_set_sub_nodes( - parent_node, - parent_first_sub_node, - parent_last_sub_node, +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_write( + internal_node->read_write_lock, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub nodes of parent node.", + "%s: unable to grab read/write lock for writing.", function ); - goto on_error; + return( -1 ); } - if( previous_node != NULL ) - { - if( libcdata_tree_node_set_next_node( - previous_node, - replacement_node, +#endif + parent_node = internal_node->parent_node; + previous_node = internal_node->previous_node; + next_node = internal_node->next_node; + + if( parent_node != NULL ) + { + if( libcdata_tree_node_get_sub_nodes( + parent_node, + &parent_first_sub_node, + &parent_last_sub_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next node of previous node.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve sub nodes of parent node.", function ); - goto on_error; + result = -1; } } - if( next_node != NULL ) + if( result == 1 ) { - if( libcdata_tree_node_set_previous_node( - next_node, + if( libcdata_tree_node_set_nodes( replacement_node, + parent_node, + previous_node, + next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous node of next node.", + "%s: unable to set nodes of replacement node.", function ); - goto on_error; + result = -1; } } + if( result == 1 ) + { + if( parent_node != NULL ) + { + backup_parent_first_sub_node = parent_first_sub_node; + backup_parent_last_sub_node = parent_last_sub_node; + + if( parent_first_sub_node == node ) + { + parent_first_sub_node = replacement_node; + } + if( parent_last_sub_node == node ) + { + parent_last_sub_node = replacement_node; + } + if( libcdata_tree_node_set_sub_nodes( + parent_node, + parent_first_sub_node, + parent_last_sub_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set sub nodes of parent node.", + function ); + + libcdata_tree_node_set_nodes( + replacement_node, + NULL, + NULL, + NULL, + NULL ); + + result = -1; + } + } + } + if( result == 1 ) + { + if( previous_node != NULL ) + { + if( libcdata_tree_node_set_next_node( + previous_node, + replacement_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next node of previous node.", + function ); + + libcdata_tree_node_set_nodes( + replacement_node, + NULL, + NULL, + NULL, + NULL ); + + if( parent_node != NULL ) + { + libcdata_tree_node_set_sub_nodes( + parent_node, + backup_parent_first_sub_node, + backup_parent_last_sub_node, + NULL ); + } + result = -1; + } + } + } + if( result == 1 ) + { + if( next_node != NULL ) + { + if( libcdata_tree_node_set_previous_node( + next_node, + replacement_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous node of next node.", + function ); + + libcdata_tree_node_set_nodes( + replacement_node, + NULL, + NULL, + NULL, + NULL ); + + if( parent_node != NULL ) + { + libcdata_tree_node_set_sub_nodes( + parent_node, + backup_parent_first_sub_node, + backup_parent_last_sub_node, + NULL ); + } + if( previous_node != NULL ) + { + libcdata_tree_node_set_next_node( + previous_node, + node, + NULL ); + } + result = -1; + } + } + } + if( result == 1 ) + { + internal_node->parent_node = NULL; + internal_node->previous_node = NULL; + internal_node->next_node = NULL; + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, @@ -2645,18 +3439,50 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif - return( 1 ); + return( result ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_node->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + libcdata_tree_node_set_nodes( + replacement_node, + NULL, + NULL, + NULL, + NULL ); + + if( parent_node != NULL ) + { + libcdata_tree_node_set_sub_nodes( + parent_node, + backup_parent_first_sub_node, + backup_parent_last_sub_node, + NULL ); + } + if( previous_node != NULL ) + { + libcdata_tree_node_set_next_node( + previous_node, + node, + NULL ); + } + if( next_node != NULL ) + { + libcdata_tree_node_set_previous_node( + next_node, + node, + NULL ); + } + internal_node->parent_node = parent_node; + internal_node->previous_node = previous_node; + internal_node->next_node = next_node; + } return( -1 ); +#endif } /* Removes a sub tree node from the tree node @@ -2664,14 +3490,20 @@ */ int libcdata_tree_node_remove_node( libcdata_tree_node_t *node, - libcdata_tree_node_t *node_to_remove, + libcdata_tree_node_t *sub_node_to_remove, libcerror_error_t **error ) { - libcdata_internal_tree_node_t *internal_node = NULL; - libcdata_tree_node_t *to_remove_next_node = NULL; - libcdata_tree_node_t *to_remove_parent_node = NULL; - libcdata_tree_node_t *to_remove_previous_node = NULL; - static char *function = "libcdata_tree_node_remove_node"; + libcdata_internal_tree_node_t *internal_node = NULL; + libcdata_tree_node_t *next_node = NULL; + libcdata_tree_node_t *parent_node = NULL; + libcdata_tree_node_t *previous_node = NULL; + static char *function = "libcdata_tree_node_remove_node"; + int result = 1; + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcdata_tree_node_t *backup_first_sub_node = NULL; + libcdata_tree_node_t *backup_last_sub_node = NULL; +#endif if( node == NULL ) { @@ -2686,13 +3518,63 @@ } internal_node = (libcdata_internal_tree_node_t *) node; - if( node_to_remove == NULL ) + if( internal_node->number_of_sub_nodes == 0 ) + { + if( internal_node->first_sub_node != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - first sub node already set.", + function ); + + return( -1 ); + } + if( internal_node->last_sub_node != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - last sub node already set.", + function ); + + return( -1 ); + } + } + else + { + if( internal_node->first_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing first sub node.", + function ); + + return( -1 ); + } + if( internal_node->last_sub_node == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: corruption detected - missing last sub node.", + function ); + + return( -1 ); + } + } + if( sub_node_to_remove == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node to remove.", + "%s: invalid sub node to remove.", function ); return( -1 ); @@ -2730,54 +3612,58 @@ return( -1 ); } -#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - if( libcthreads_read_write_lock_grab_for_write( - internal_node->read_write_lock, + if( libcdata_tree_node_get_nodes( + sub_node_to_remove, + &parent_node, + &previous_node, + &next_node, error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to grab read/write lock for writing.", + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve nodes of node to remove.", function ); return( -1 ); } -#endif - if( libcdata_tree_node_get_nodes( - node_to_remove, - &to_remove_parent_node, - &to_remove_previous_node, - &to_remove_next_node, - error ) != 1 ) + if( parent_node != node ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve nodes of node to remove.", + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid node to remove - parent node mismatch.", function ); - goto on_error; + return( -1 ); } - if( to_remove_parent_node != node ) +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + if( libcthreads_read_write_lock_grab_for_write( + internal_node->read_write_lock, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid node to remove - parent node mismatch.", + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to grab read/write lock for writing.", function ); - goto on_error; + return( -1 ); } - if( libcdata_tree_node_set_nodes( - node_to_remove, - NULL, - NULL, - NULL, - error ) != 1 ) + backup_first_sub_node = internal_node->first_sub_node; + backup_last_sub_node = internal_node->last_sub_node; +#endif + result = libcdata_tree_node_set_nodes( + sub_node_to_remove, + NULL, + NULL, + NULL, + error ); + + if( result != 1 ) { libcerror_error_set( error, @@ -2786,52 +3672,81 @@ "%s: unable to set nodes of node to remove.", function ); - goto on_error; - } - if( internal_node->first_sub_node == node_to_remove ) - { - internal_node->first_sub_node = to_remove_next_node; + result = -1; } - if( internal_node->last_sub_node == node_to_remove ) + if( result == 1 ) { - internal_node->last_sub_node = to_remove_previous_node; + if( next_node != NULL ) + { + if( libcdata_tree_node_set_previous_node( + next_node, + previous_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set previous node of next node.", + function ); + + libcdata_tree_node_set_nodes( + sub_node_to_remove, + parent_node, + previous_node, + next_node, + NULL ); + + result = -1; + } + } } - if( to_remove_next_node != NULL ) + if( result == 1 ) { - if( libcdata_tree_node_set_previous_node( - to_remove_next_node, - to_remove_previous_node, - error ) != 1 ) + if( previous_node != NULL ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set previous node of next node.", - function ); + if( libcdata_tree_node_set_next_node( + previous_node, + next_node, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set next node of previous node.", + function ); - goto on_error; + libcdata_tree_node_set_nodes( + sub_node_to_remove, + parent_node, + previous_node, + next_node, + NULL ); + + if( next_node != NULL ) + { + libcdata_tree_node_set_previous_node( + next_node, + sub_node_to_remove, + NULL ); + } + result = -1; + } } } - if( to_remove_previous_node != NULL ) + if( result == 1 ) { - if( libcdata_tree_node_set_next_node( - to_remove_previous_node, - to_remove_next_node, - error ) != 1 ) + if( internal_node->first_sub_node == sub_node_to_remove ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set next node of previous node.", - function ); - - goto on_error; + internal_node->first_sub_node = next_node; + } + if( internal_node->last_sub_node == sub_node_to_remove ) + { + internal_node->last_sub_node = previous_node; } + internal_node->number_of_sub_nodes -= 1; } - internal_node->number_of_sub_nodes--; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_release_for_write( internal_node->read_write_lock, @@ -2844,18 +3759,43 @@ "%s: unable to release read/write lock for writing.", function ); - return( -1 ); + goto on_error; } #endif return( 1 ); -on_error: #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) - libcthreads_read_write_lock_release_for_write( - internal_node->read_write_lock, - NULL ); -#endif +on_error: + if( result == 1 ) + { + libcdata_tree_node_set_nodes( + sub_node_to_remove, + parent_node, + previous_node, + next_node, + NULL ); + + if( next_node != NULL ) + { + libcdata_tree_node_set_previous_node( + next_node, + sub_node_to_remove, + NULL ); + } + if( previous_node != NULL ) + { + libcdata_tree_node_set_next_node( + previous_node, + sub_node_to_remove, + NULL ); + } + internal_node->first_sub_node = backup_first_sub_node; + internal_node->last_sub_node = backup_last_sub_node; + + internal_node->number_of_sub_nodes += 1; + } return( -1 ); +#endif } /* Retrieves the number of sub nodes in the tree node @@ -3010,7 +3950,7 @@ result = 1; break; - } + } if( libcdata_tree_node_get_next_node( safe_sub_node, &safe_sub_node, @@ -3041,7 +3981,7 @@ result = 1; break; - } + } if( libcdata_tree_node_get_previous_node( safe_sub_node, &safe_sub_node, @@ -3098,6 +4038,7 @@ libcdata_internal_tree_node_t *internal_node = NULL; libcdata_tree_node_t *sub_node = NULL; static char *function = "libcdata_tree_node_get_leaf_node_list"; + int leaf_node_list_created_in_node = 0; int sub_node_index = 0; if( node == NULL ) @@ -3154,6 +4095,7 @@ goto on_error; } + leaf_node_list_created_in_node = 1; } /* Traverse the sub nodes */ @@ -3255,6 +4197,15 @@ return( 1 ); on_error: + if( leaf_node_list_created_in_node != 0 ) + { + if( *leaf_node_list == NULL ) + { + libcdata_list_initialize( + leaf_node_list, + NULL ); + } + } #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) libcthreads_read_write_lock_release_for_read( internal_node->read_write_lock, diff -Nru libbde-20190102/libcdata/libcdata_tree_node.h libbde-20240223/libcdata/libcdata_tree_node.h --- libbde-20190102/libcdata/libcdata_tree_node.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_tree_node.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * Tree functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_TREE_NODE_H ) @@ -171,6 +171,28 @@ libcdata_tree_node_t *next_node, libcerror_error_t **error ); +LIBCDATA_EXTERN \ +int libcdata_tree_node_get_first_sub_node( + libcdata_tree_node_t *node, + libcdata_tree_node_t **first_sub_node, + libcerror_error_t **error ); + +int libcdata_internal_tree_node_set_first_sub_node( + libcdata_internal_tree_node_t *internal_node, + libcdata_tree_node_t *first_sub_node, + libcerror_error_t **error ); + +LIBCDATA_EXTERN \ +int libcdata_tree_node_get_last_sub_node( + libcdata_tree_node_t *node, + libcdata_tree_node_t **last_sub_node, + libcerror_error_t **error ); + +int libcdata_internal_tree_node_set_last_sub_node( + libcdata_internal_tree_node_t *internal_node, + libcdata_tree_node_t *last_sub_node, + libcerror_error_t **error ); + int libcdata_tree_node_get_sub_nodes( libcdata_tree_node_t *node, libcdata_tree_node_t **first_sub_node, @@ -185,7 +207,7 @@ int libcdata_internal_tree_node_append_node( libcdata_internal_tree_node_t *internal_node, - libcdata_tree_node_t *sub_node, + libcdata_tree_node_t *node_to_append, libcerror_error_t **error ); LIBCDATA_EXTERN \ @@ -200,14 +222,22 @@ intptr_t *value, libcerror_error_t **error ); -int libcdata_internal_tree_node_insert_node( +int libcdata_internal_tree_node_insert_node_find_sub_node( libcdata_internal_tree_node_t *internal_node, - libcdata_tree_node_t *sub_node, + intptr_t *value_to_insert, int (*value_compare_function)( intptr_t *first_value, intptr_t *second_value, libcerror_error_t **error ), uint8_t insert_flags, + int *sub_node_index, + libcdata_tree_node_t **sub_node, + libcerror_error_t **error ); + +int libcdata_internal_tree_node_insert_node_before_sub_node( + libcdata_internal_tree_node_t *internal_node, + libcdata_tree_node_t *sub_node, + libcdata_tree_node_t *node_to_insert, libcerror_error_t **error ); LIBCDATA_EXTERN \ @@ -241,7 +271,7 @@ LIBCDATA_EXTERN \ int libcdata_tree_node_remove_node( libcdata_tree_node_t *node, - libcdata_tree_node_t *node_to_remove, + libcdata_tree_node_t *sub_node_to_remove, libcerror_error_t **error ); LIBCDATA_EXTERN \ diff -Nru libbde-20190102/libcdata/libcdata_types.h libbde-20240223/libcdata/libcdata_types.h --- libbde-20190102/libcdata/libcdata_types.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_types.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCDATA_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libcdata/libcdata_unused.h libbde-20240223/libcdata/libcdata_unused.h --- libbde-20190102/libcdata/libcdata_unused.h 2019-01-02 15:57:01.000000000 +0000 +++ libbde-20240223/libcdata/libcdata_unused.h 2024-02-23 03:03:24.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCDATA_INTERNAL_UNUSED_H ) -#define _LIBCDATA_INTERNAL_UNUSED_H +#if !defined( _LIBCDATA_UNUSED_H ) +#define _LIBCDATA_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCDATA_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCDATA_UNUSED_H ) */ diff -Nru libbde-20190102/libcerror/Makefile.am libbde-20240223/libcerror/Makefile.am --- libbde-20190102/libcerror/Makefile.am 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/Makefile.am 2024-02-23 03:03:25.000000000 +0000 @@ -19,9 +19,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcerror ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcerror_la_SOURCES) diff -Nru libbde-20190102/libcerror/Makefile.in libbde-20240223/libcerror/Makefile.in --- libbde-20190102/libcerror/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcerror/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcerror ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -178,6 +178,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -195,8 +196,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -213,6 +212,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -224,8 +229,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -243,7 +250,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -261,7 +267,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -315,8 +320,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -335,6 +338,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -345,8 +349,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -369,26 +373,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -397,7 +381,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -416,6 +399,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -458,9 +442,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -529,8 +510,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -553,11 +532,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -673,6 +649,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -725,7 +703,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -862,6 +839,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -878,15 +863,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcerror ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcerror_la_SOURCES) diff -Nru libbde-20190102/libcerror/libcerror_definitions.h libbde-20240223/libcerror/libcerror_definitions.h --- libbde-20190102/libcerror/libcerror_definitions.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_definitions.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCERROR_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCERROR_VERSION 20181117 +#define LIBCERROR_VERSION 20240101 /* The libcerror version string */ -#define LIBCERROR_VERSION_STRING "20181117" +#define LIBCERROR_VERSION_STRING "20240101" /* The error domains */ diff -Nru libbde-20190102/libcerror/libcerror_error.c libbde-20240223/libcerror/libcerror_error.c --- libbde-20190102/libcerror/libcerror_error.c 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_error.c 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -371,9 +371,6 @@ next_message_size = ( ( format_string_length / LIBCERROR_MESSAGE_INCREMENT_SIZE ) + 1 ) * LIBCERROR_MESSAGE_INCREMENT_SIZE; } - message_index = internal_error->number_of_messages - 1; - error_string = internal_error->messages[ message_index ]; - do { if( next_message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) @@ -440,6 +437,8 @@ error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 1 ] = 0; error_string_size = (size_t) LIBCERROR_MESSAGE_MAXIMUM_SIZE; } + message_index = internal_error->number_of_messages - 1; + internal_error->messages[ message_index ] = error_string; internal_error->sizes[ message_index ] = error_string_size; @@ -547,8 +546,8 @@ { libcerror_internal_error_t *internal_error = NULL; system_character_t *error_string = NULL; - size_t print_count = 0; size_t message_index = 0; + size_t print_count = 0; #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) size_t error_string_size = 0; @@ -598,9 +597,9 @@ } #else print_count = wcstombs( - string, - error_string, - size ); + string, + error_string, + size ); if( print_count == (size_t) -1 ) { diff -Nru libbde-20190102/libcerror/libcerror_error.h libbde-20240223/libcerror/libcerror_error.h --- libbde-20190102/libcerror/libcerror_error.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_error.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCERROR_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcerror/libcerror_extern.h libbde-20240223/libcerror/libcerror_extern.h --- libbde-20190102/libcerror/libcerror_extern.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_extern.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCERROR_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCERROR_EXTERN_VARIABLE extern +#else #define LIBCERROR_EXTERN_VARIABLE LIBCERROR_EXTERN +#endif #else #define LIBCERROR_EXTERN /* extern */ diff -Nru libbde-20190102/libcerror/libcerror_support.c libbde-20240223/libcerror/libcerror_support.c --- libbde-20190102/libcerror/libcerror_support.c 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_support.c 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcerror/libcerror_support.h libbde-20240223/libcerror/libcerror_support.h --- libbde-20190102/libcerror/libcerror_support.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_support.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCERROR_SUPPORT_H ) diff -Nru libbde-20190102/libcerror/libcerror_system.c libbde-20240223/libcerror/libcerror_system.c --- libbde-20190102/libcerror/libcerror_system.c 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_system.c 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * System functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -96,8 +96,8 @@ return( 0 ); } function = GetProcAddress( - library_handle, - (LPCSTR) "FormatMessageA" ); + library_handle, + (LPCSTR) "FormatMessageA" ); if( function != NULL ) { @@ -149,8 +149,8 @@ return( 0 ); } function = GetProcAddress( - library_handle, - (LPCSTR) "FormatMessageW" ); + library_handle, + (LPCSTR) "FormatMessageW" ); if( function != NULL ) { @@ -429,9 +429,6 @@ next_message_size = ( ( format_string_length / LIBCERROR_MESSAGE_INCREMENT_SIZE ) + 1 ) * LIBCERROR_MESSAGE_INCREMENT_SIZE; } - message_index = internal_error->number_of_messages - 1; - error_string = internal_error->messages[ message_index ]; - do { if( next_message_size >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) @@ -498,6 +495,8 @@ error_string[ LIBCERROR_MESSAGE_MAXIMUM_SIZE - 1 ] = 0; error_string_size = (size_t) LIBCERROR_MESSAGE_MAXIMUM_SIZE; } + message_index = internal_error->number_of_messages - 1; + internal_error->messages[ message_index ] = error_string; internal_error->sizes[ message_index ] = error_string_size; @@ -521,8 +520,8 @@ string_index -= 1; } reallocation = memory_reallocate( - internal_error->messages[ message_index ], - sizeof( system_character_t ) * ( message_size + 13 + 512 ) ); + internal_error->messages[ message_index ], + sizeof( system_character_t ) * ( message_size + 13 + 512 ) ); if( reallocation == NULL ) { @@ -559,8 +558,6 @@ { goto on_error; } - message_size += (size_t) print_count; - internal_error->sizes[ message_index ] += print_count; } if( internal_error->sizes[ message_index ] >= LIBCERROR_MESSAGE_MAXIMUM_SIZE ) diff -Nru libbde-20190102/libcerror/libcerror_system.h libbde-20240223/libcerror/libcerror_system.h --- libbde-20190102/libcerror/libcerror_system.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_system.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * System functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCERROR_SYSTEM_H ) diff -Nru libbde-20190102/libcerror/libcerror_types.h libbde-20240223/libcerror/libcerror_types.h --- libbde-20190102/libcerror/libcerror_types.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_types.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCERROR_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libcerror/libcerror_unused.h libbde-20240223/libcerror/libcerror_unused.h --- libbde-20190102/libcerror/libcerror_unused.h 2019-01-02 15:57:05.000000000 +0000 +++ libbde-20240223/libcerror/libcerror_unused.h 2024-02-23 03:03:25.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCERROR_INTERNAL_UNUSED_H ) -#define _LIBCERROR_INTERNAL_UNUSED_H +#if !defined( _LIBCERROR_UNUSED_H ) +#define _LIBCERROR_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCERROR_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCERROR_UNUSED_H ) */ diff -Nru libbde-20190102/libcfile/Makefile.am libbde-20240223/libcfile/Makefile.am --- libbde-20190102/libcfile/Makefile.am 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/Makefile.am 2024-02-23 03:03:27.000000000 +0000 @@ -5,7 +5,7 @@ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ - @LIBUNA_CPPFLAGS@ + @LIBUNA_CPPFLAGS@ noinst_LTLIBRARIES = libcfile.la @@ -22,16 +22,19 @@ libcfile_support.c libcfile_support.h \ libcfile_system_string.c libcfile_system_string.h \ libcfile_types.h \ - libcfile_unused.h + libcfile_unused.h \ + libcfile_winapi.c libcfile_winapi.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcfile ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcfile_la_SOURCES) diff -Nru libbde-20190102/libcfile/Makefile.in libbde-20240223/libcfile/Makefile.in --- libbde-20190102/libcfile/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcfile/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcfile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -126,11 +126,13 @@ libcfile_libcnotify.h libcfile_libuna.h libcfile_notify.c \ libcfile_notify.h libcfile_support.c libcfile_support.h \ libcfile_system_string.c libcfile_system_string.h \ - libcfile_types.h libcfile_unused.h + libcfile_types.h libcfile_unused.h libcfile_winapi.c \ + libcfile_winapi.h @HAVE_LOCAL_LIBCFILE_TRUE@am_libcfile_la_OBJECTS = libcfile_error.lo \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_file.lo libcfile_notify.lo \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_support.lo \ -@HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_system_string.lo +@HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_system_string.lo \ +@HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_winapi.lo libcfile_la_OBJECTS = $(am_libcfile_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -155,7 +157,8 @@ am__depfiles_remade = ./$(DEPDIR)/libcfile_error.Plo \ ./$(DEPDIR)/libcfile_file.Plo ./$(DEPDIR)/libcfile_notify.Plo \ ./$(DEPDIR)/libcfile_support.Plo \ - ./$(DEPDIR)/libcfile_system_string.Plo + ./$(DEPDIR)/libcfile_system_string.Plo \ + ./$(DEPDIR)/libcfile_winapi.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -182,6 +185,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -199,8 +203,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -217,6 +219,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -228,8 +236,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -247,7 +257,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -265,7 +274,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -319,8 +327,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -339,6 +345,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -349,8 +356,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -373,26 +380,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -401,7 +388,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -420,6 +406,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -462,9 +449,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -533,8 +517,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -557,11 +539,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -576,7 +555,7 @@ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBCERROR_CPPFLAGS@ \ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ @HAVE_LOCAL_LIBCFILE_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ -@HAVE_LOCAL_LIBCFILE_TRUE@ @LIBUNA_CPPFLAGS@ +@HAVE_LOCAL_LIBCFILE_TRUE@ @LIBUNA_CPPFLAGS@ @HAVE_LOCAL_LIBCFILE_TRUE@noinst_LTLIBRARIES = libcfile.la @HAVE_LOCAL_LIBCFILE_TRUE@libcfile_la_SOURCES = \ @@ -592,7 +571,8 @@ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_support.c libcfile_support.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_system_string.c libcfile_system_string.h \ @HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_types.h \ -@HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_unused.h +@HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_unused.h \ +@HAVE_LOCAL_LIBCFILE_TRUE@ libcfile_winapi.c libcfile_winapi.h MAINTAINERCLEANFILES = \ Makefile.in @@ -656,6 +636,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_notify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_system_string.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfile_winapi.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -689,6 +670,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -741,7 +724,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -864,6 +846,7 @@ -rm -f ./$(DEPDIR)/libcfile_notify.Plo -rm -f ./$(DEPDIR)/libcfile_support.Plo -rm -f ./$(DEPDIR)/libcfile_system_string.Plo + -rm -f ./$(DEPDIR)/libcfile_winapi.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -880,6 +863,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -896,15 +887,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcfile ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcfile_la_SOURCES) diff -Nru libbde-20190102/libcfile/libcfile_definitions.h libbde-20240223/libcfile/libcfile_definitions.h --- libbde-20190102/libcfile/libcfile_definitions.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_definitions.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCFILE_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCFILE_VERSION 20180102 +#define LIBCFILE_VERSION 20240106 /* The libcfile version string */ -#define LIBCFILE_VERSION_STRING "20180102" +#define LIBCFILE_VERSION_STRING "20240106" /* The file access flags * bit 1 set to 1 for read access diff -Nru libbde-20190102/libcfile/libcfile_error.c libbde-20240223/libcfile/libcfile_error.c --- libbde-20190102/libcfile/libcfile_error.c 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_error.c 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcfile/libcfile_error.h libbde-20240223/libcfile/libcfile_error.h --- libbde-20190102/libcfile/libcfile_error.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_error.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcfile/libcfile_extern.h libbde-20240223/libcfile/libcfile_extern.h --- libbde-20190102/libcfile/libcfile_extern.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_extern.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_INTERNAL_EXTERN_H ) @@ -28,17 +28,17 @@ */ #if !defined( HAVE_LOCAL_LIBCFILE ) -/* If libtool DLL support is enabled set LIBCFILE_DLL_EXPORT - * before including libcfile/extern.h - */ -#if defined( _WIN32 ) && defined( DLL_EXPORT ) -#define LIBCFILE_DLL_EXPORT -#endif - #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCFILE_EXTERN_VARIABLE extern +#else +#define LIBCFILE_EXTERN_VARIABLE LIBCFILE_EXTERN +#endif + #else -#define LIBCFILE_EXTERN /* extern */ +#define LIBCFILE_EXTERN /* extern */ +#define LIBCFILE_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ diff -Nru libbde-20190102/libcfile/libcfile_file.c libbde-20240223/libcfile/libcfile_file.c --- libbde-20190102/libcfile/libcfile_file.c 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_file.c 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * File functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -93,51 +93,7 @@ #include "libcfile_libcnotify.h" #include "libcfile_system_string.h" #include "libcfile_types.h" - -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of CloseHandle - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_CloseHandle( - HANDLE file_handle ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "CloseHandle" ); - - if( function != NULL ) - { - result = function( - file_handle ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ +#include "libcfile_winapi.h" /* Creates a file * Make sure the value file is referencing, is set to NULL @@ -266,77 +222,12 @@ } *file = NULL; - if( internal_file->block_data != NULL ) - { - memory_free( - internal_file->block_data ); - } memory_free( internal_file ); } return( result ); } -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of CreateFileA - * Returns a handle if successful or INVALID_HANDLE_VALUE on error - */ -HANDLE libcfile_CreateFileA( - LPCSTR filename, - DWORD desired_access, - DWORD share_mode, - SECURITY_ATTRIBUTES *security_attributes, - DWORD creation_disposition, - DWORD flags_and_attributes, - HANDLE template_file ) -{ - FARPROC function = NULL; - HANDLE result = INVALID_HANDLE_VALUE; - HMODULE library_handle = NULL; - - if( filename == NULL ) - { - return( INVALID_HANDLE_VALUE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( INVALID_HANDLE_VALUE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "CreateFileA" ); - - if( function != NULL ) - { - result = (HANDLE) function( - filename, - desired_access, - share_mode, - security_attributes, - creation_disposition, - flags_and_attributes, - template_file ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - libcfile_CloseHandle( - result ); - - return( INVALID_HANDLE_VALUE ); - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - /* Opens a file * Returns 1 if successful or -1 on error */ @@ -370,6 +261,18 @@ #if defined( WINAPI ) +#if ( WINVER >= 0x0600 ) && ( WINVER < 0x0602 ) + +#define FileAlignmentInfo 0x11 + +typedef struct _FILE_ALIGNMENT_INFO FILE_ALIGNMENT_INFO; + +struct _FILE_ALIGNMENT_INFO { + ULONG AlignmentRequirement; +}; + +#endif + /* Opens a file * This function uses the WINAPI function for Windows XP (0x0501) or later, * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier @@ -382,13 +285,20 @@ uint32_t *error_code, libcerror_error_t **error ) { +#if ( WINVER >= 0x0600 ) + FILE_ALIGNMENT_INFO file_alignment_information; + + BOOL result = 0; +#endif + libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_open_with_error_code"; - size_t filename_length = 0; DWORD file_io_access_flags = 0; DWORD file_io_creation_flags = 0; DWORD file_io_shared_flags = 0; DWORD flags_and_attributes = 0; + size_t filename_length = 0; + ssize_t read_count = 0; if( file == NULL ) { @@ -565,6 +475,107 @@ } return( -1 ); } + if( internal_file->is_device_filename != 0 ) + { + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, + FSCTL_ALLOW_EXTENDED_DASD_IO, + NULL, + 0, + NULL, + 0, + error_code, + error ); + + if( read_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_IOCTL_FAILED, + "%s: unable to query device for: FSCTL_ALLOW_EXTENDED_DASD_IO.", + function ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + if( ( error != NULL ) + && ( *error != NULL ) ) + { + libcnotify_print_error_backtrace( + *error ); + } + } +#endif + libcerror_error_free( + error ); + } +#if ( WINVER >= 0x0600 ) + result = GetFileInformationByHandleEx( + internal_file->handle, + FileAlignmentInfo, + (void *) &file_alignment_information, + (DWORD) sizeof( FILE_ALIGNMENT_INFO ) ); + + if( result == FALSE ) + { + *error_code = (uint32_t) GetLastError(); + + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_IOCTL_FAILED, + *error_code, + "%s: unable to retrieve file alignment information.", + function ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + if( ( error != NULL ) + && ( *error != NULL ) ) + { + libcnotify_print_error_backtrace( + *error ); + } + } +#endif + libcerror_error_free( + error ); + } + else if( file_alignment_information.AlignmentRequirement != 0 ) + { + if( libcfile_internal_file_set_block_size( + internal_file, + (size_t) 512, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set block size.", + function ); + + return( -1 ); + } + } +#endif /* ( WINVER >= 0x0600 ) */ + } + if( libcfile_internal_file_get_size( + internal_file, + &( internal_file->size ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve size.", + function ); + + return( -1 ); + } internal_file->access_flags = access_flags; internal_file->current_offset = 0; @@ -664,6 +675,11 @@ return( -1 ); } +#if defined( O_CLOEXEC ) + /* Prevent the file descriptor to remain open across an execve + */ + file_io_flags |= O_CLOEXEC; +#endif #if defined( HAVE_GLIB_H ) internal_file->descriptor = g_open( filename, @@ -717,6 +733,20 @@ } return( -1 ); } + if( libcfile_internal_file_get_size( + internal_file, + &( internal_file->size ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve size.", + function ); + + return( -1 ); + } internal_file->access_flags = access_flags; internal_file->current_offset = 0; @@ -729,66 +759,6 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of CreateFileW - * Returns a handle if successful or INVALID_HANDLE_VALUE on error - */ -HANDLE libcfile_CreateFileW( - LPCWSTR filename, - DWORD desired_access, - DWORD share_mode, - SECURITY_ATTRIBUTES *security_attributes, - DWORD creation_disposition, - DWORD flags_and_attributes, - HANDLE template_file ) -{ - FARPROC function = NULL; - HANDLE result = INVALID_HANDLE_VALUE; - HMODULE library_handle = NULL; - - if( filename == NULL ) - { - return( INVALID_HANDLE_VALUE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( INVALID_HANDLE_VALUE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "CreateFileW" ); - - if( function != NULL ) - { - result = (HANDLE) function( - filename, - desired_access, - share_mode, - security_attributes, - creation_disposition, - flags_and_attributes, - template_file ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - libcfile_CloseHandle( - result ); - - return( INVALID_HANDLE_VALUE ); - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - /* Opens a file * Returns 1 if successful or -1 on error */ @@ -834,13 +804,20 @@ uint32_t *error_code, libcerror_error_t **error ) { +#if ( WINVER >= 0x0600 ) + FILE_ALIGNMENT_INFO file_alignment_information; + + BOOL result = 0; +#endif + libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_open_wide_with_error_code"; - size_t filename_length = 0; DWORD file_io_access_flags = 0; DWORD file_io_creation_flags = 0; DWORD file_io_shared_flags = 0; DWORD flags_and_attributes = 0; + size_t filename_length = 0; + ssize_t read_count = 0; if( file == NULL ) { @@ -1017,6 +994,110 @@ } return( -1 ); } + if( internal_file->is_device_filename != 0 ) + { + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, + FSCTL_ALLOW_EXTENDED_DASD_IO, + NULL, + 0, + NULL, + 0, + error_code, + error ); + + if( read_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_IOCTL_FAILED, + "%s: unable to query device for: FSCTL_ALLOW_EXTENDED_DASD_IO.", + function ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + if( ( error != NULL ) + && ( *error != NULL ) ) + { + libcnotify_print_error_backtrace( + *error ); + } + } +#endif + libcerror_error_free( + error ); + } +#if ( WINVER >= 0x0600 ) + result = GetFileInformationByHandleEx( + internal_file->handle, + FileAlignmentInfo, + (void *) &file_alignment_information, + (DWORD) sizeof( FILE_ALIGNMENT_INFO ) ); + + if( result == FALSE ) + { + *error_code = (uint32_t) GetLastError(); + + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_IOCTL_FAILED, + *error_code, + "%s: unable to retrieve file alignment information.", + function ); + +#if defined( HAVE_DEBUG_OUTPUT ) + if( libcnotify_verbose != 0 ) + { + if( ( error != NULL ) + && ( *error != NULL ) ) + { + libcnotify_print_error_backtrace( + *error ); + } + } +#endif + libcerror_error_free( + error ); + } + else if( file_alignment_information.AlignmentRequirement != 0 ) + { + if( libcfile_internal_file_set_block_size( + internal_file, + (size_t) 512, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set block size.", + function ); + + return( -1 ); + } + } +#endif /* ( WINVER >= 0x0600 ) */ + } + if( libcfile_internal_file_get_size( + internal_file, + &( internal_file->size ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve size.", + function ); + + return( -1 ); + } + internal_file->access_flags = access_flags; + internal_file->current_offset = 0; + return( 1 ); } @@ -1164,6 +1245,11 @@ goto on_error; } +#if defined( O_CLOEXEC ) + /* Prevent the file descriptor to remain open across an execve + */ + file_io_flags |= O_CLOEXEC; +#endif #if defined( HAVE_GLIB_H ) internal_file->descriptor = g_open( narrow_filename, @@ -1223,6 +1309,20 @@ } goto on_error; } + if( libcfile_internal_file_get_size( + internal_file, + &( internal_file->size ), + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve size.", + function ); + + goto on_error; + } return( 1 ); on_error: @@ -1423,126 +1523,6 @@ return( read_count ); } -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of GetOverlappedResult - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_GetOverlappedResult( - HANDLE file_handle, - OVERLAPPED *overlapped, - DWORD *read_count, - BOOL wait_io_complete ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - if( overlapped == NULL ) - { - return( FALSE ); - } - if( read_count == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "GetOverlappedResult" ); - - if( function != NULL ) - { - result = function( - file_handle, - overlapped, - read_count, - wait_io_complete ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif - -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of ReadFile - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_ReadFile( - HANDLE file_handle, - VOID *buffer, - DWORD read_size, - DWORD *read_count, - OVERLAPPED *overlapped ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - if( buffer == NULL ) - { - return( FALSE ); - } - if( read_count == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "ReadFile" ); - - if( function != NULL ) - { - result = function( - file_handle, - buffer, - read_size, - read_count, - overlapped ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - #if defined( WINAPI ) /* Reads a buffer from the file @@ -1577,6 +1557,17 @@ return( -1 ); } + if( current_offset < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid current offset value out of bounds.", + function ); + + return( -1 ); + } if( buffer == NULL ) { libcerror_error_set( @@ -1804,109 +1795,122 @@ } if( internal_file->block_size != 0 ) { - if( internal_file->current_offset < 0 ) + if( internal_file->block_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid file - current offset value out of bounds.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid file - missing block data.", function ); return( -1 ); } - if( (size64_t) internal_file->current_offset > internal_file->size ) - { - return( 0 ); - } - if( ( (size64_t) internal_file->current_offset + size ) > internal_file->size ) - { - size = (size_t) ( internal_file->size - internal_file->current_offset ); - } } - if( size == 0 ) + if( internal_file->current_offset < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid file - current offset value out of bounds.", + function ); + + return( -1 ); + } + if( ( size == 0 ) + || ( (size64_t) internal_file->current_offset > internal_file->size ) ) { return( 0 ); } - if( ( internal_file->block_data_offset > 0 ) - && ( internal_file->block_data_size == 0 ) ) + if( ( (size64_t) internal_file->current_offset + size ) > internal_file->size ) { - if( memory_set( - internal_file->block_data, - 0, - internal_file->block_size ) == NULL ) + size = (size_t) ( internal_file->size - internal_file->current_offset ); + } + if( internal_file->block_size != 0 ) + { + /* Read a block of data to align with the next block + */ + if( ( internal_file->block_data_offset > 0 ) + && ( internal_file->block_data_size == 0 ) ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear block data.", - function ); + if( memory_set( + internal_file->block_data, + 0, + internal_file->block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear block data.", + function ); - return( -1 ); - } - read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( - internal_file, - internal_file->current_offset - internal_file->block_data_offset, - internal_file->block_data, - internal_file->block_size, - error_code, - error ); + return( -1 ); + } + read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( + internal_file, + internal_file->current_offset - internal_file->block_data_offset, + internal_file->block_data, + internal_file->block_size, + error_code, + error ); - if( read_count != (ssize_t) internal_file->block_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: invalid read count: %" PRIzd " returned.", - function, - read_count ); + if( read_count != (ssize_t) internal_file->block_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: invalid read count: %" PRIzd " returned.", + function, + read_count ); - return( -1 ); + return( -1 ); + } + internal_file->block_data_size = (size_t) read_count; } - internal_file->block_data_size = (size_t) read_count; - } - if( ( internal_file->block_data_offset > 0 ) - && ( internal_file->block_data_offset < internal_file->block_data_size ) ) - { - read_size = internal_file->block_data_size - internal_file->block_data_offset; - - if( read_size > size ) + if( ( internal_file->block_data_offset > 0 ) + && ( internal_file->block_data_offset < internal_file->block_data_size ) ) { - read_size = size; + read_size = internal_file->block_data_size - internal_file->block_data_offset; + + if( read_size > size ) + { + read_size = size; + } + if( memory_copy( + buffer, + &( internal_file->block_data[ internal_file->block_data_offset ] ), + read_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy block data.", + function ); + + return( -1 ); + } + buffer_offset += read_size; + size -= read_size; + internal_file->current_offset += read_size; + internal_file->block_data_offset += read_size; } - if( memory_copy( - buffer, - &( internal_file->block_data[ internal_file->block_data_offset ] ), - read_size ) == NULL ) + if( size == 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy block data.", - function ); - - return( -1 ); + return( (ssize_t) buffer_offset ); } - buffer_offset += read_size; - size -= read_size; - internal_file->current_offset += read_size; - internal_file->block_data_offset += read_size; - } - if( size == 0 ) - { - return( (ssize_t) buffer_offset ); } - if( internal_file->block_size == 0 ) - { - read_size = size; - } - else + read_size = size; + + if( internal_file->block_size != 0 ) { - read_size_remainder = size % internal_file->block_size; - read_size = size - read_size_remainder; + /* Read block aligned + */ + read_size_remainder = read_size % internal_file->block_size; + read_size -= read_size_remainder; } if( read_size > 0 ) { @@ -1926,100 +1930,31 @@ else if( ( internal_file->block_size != 0 ) && ( read_count != (ssize_t) read_size ) ) { - /* Windows devices sometimes don't allow to read the last block - * this behavior is seen with e.g. \\.\D: - */ - if( ( internal_file->is_device_filename != 0 ) - && ( ( read_size - read_count ) == internal_file->block_size ) - && ( (size64_t) internal_file->current_offset == ( internal_file->size - internal_file->block_size ) ) ) - { - result = 1; - } - else - { - result = 0; - } + result = 0; } else { result = 1; } - if( result != 0 ) - { - buffer_offset += (size_t) read_count; - internal_file->current_offset += read_count; - } - /* Non-buffered Windows devices require the buffer to be aligned. - * The alignment can be determined by GetFileInformationByHandleEx. - * The ReadFile function appears to return ERROR_INVALID_PARAMETER - * in case it fails on alignment. - */ - else if( *error_code == ERROR_INVALID_PARAMETER ) - { - /* As a fallback read the data using the block data buffer - */ - while( read_size > 0 ) - { - read_count = libcfile_internal_file_read_buffer_at_offset_with_error_code( - internal_file, - internal_file->current_offset, - internal_file->block_data, - internal_file->block_size, - error_code, - error ); - - if( read_count != (ssize_t) internal_file->block_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: invalid read count: %" PRIzd " returned.", - function, - read_count ); - - return( -1 ); - } - if( memory_copy( - &( buffer[ buffer_offset ] ), - internal_file->block_data, - internal_file->block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy block data.", - function ); - - return( -1 ); - } - buffer_offset += internal_file->block_size; - read_size -= internal_file->block_size; - internal_file->current_offset += internal_file->block_size; - } - } - else + if( result == 0 ) { - libcerror_error_set( + libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_READ_FAILED, - "%s: invalid read count: %" PRIzd " returned.", - function, - read_count ); + *error_code, + "%s: unable to read from file.", + function ); return( -1 ); } + buffer_offset += (size_t) read_count; + internal_file->current_offset += read_count; } + /* Read the non-aligned remainder + */ if( read_size_remainder > 0 ) { - /* The read was cut short - */ - if( read_count != (ssize_t) read_size ) - { - return( (ssize_t) buffer_offset ); - } if( memory_set( internal_file->block_data, 0, @@ -2158,108 +2093,121 @@ } if( internal_file->block_size != 0 ) { - if( internal_file->current_offset < 0 ) + if( internal_file->block_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid file - current offset value out of bounds.", + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid file - missing block data.", function ); return( -1 ); } - if( (size64_t) internal_file->current_offset > internal_file->size ) - { - return( 0 ); - } - if( ( (size64_t) internal_file->current_offset + size ) > internal_file->size ) - { - size = (size_t) ( internal_file->size - internal_file->current_offset ); - } } - if( size == 0 ) + if( internal_file->current_offset < 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid file - current offset value out of bounds.", + function ); + + return( -1 ); + } + if( ( size == 0 ) + || ( (size64_t) internal_file->current_offset > internal_file->size ) ) { return( 0 ); } - if( ( internal_file->block_data_offset > 0 ) - && ( internal_file->block_data_size == 0 ) ) + if( ( (size64_t) internal_file->current_offset + size ) > internal_file->size ) { - if( memory_set( - internal_file->block_data, - 0, - internal_file->block_size ) == NULL ) + size = (size_t) ( internal_file->size - internal_file->current_offset ); + } + if( internal_file->block_size != 0 ) + { + /* Read a block of data to align with the next block + */ + if( ( internal_file->block_data_offset > 0 ) + && ( internal_file->block_data_size == 0 ) ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear block data.", - function ); + if( memory_set( + internal_file->block_data, + 0, + internal_file->block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear block data.", + function ); - return( -1 ); - } - read_count = read( - internal_file->descriptor, - internal_file->block_data, - internal_file->block_size ); + return( -1 ); + } + read_count = read( + internal_file->descriptor, + internal_file->block_data, + internal_file->block_size ); - if( read_count != (ssize_t) internal_file->block_size ) - { - *error_code = (uint32_t) errno; + if( read_count != (ssize_t) internal_file->block_size ) + { + *error_code = (uint32_t) errno; - libcerror_system_set_error( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - *error_code, - "%s: unable to read from file.", - function ); + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + *error_code, + "%s: unable to read from file.", + function ); - return( -1 ); + return( -1 ); + } + internal_file->block_data_size = (size_t) read_count; } - internal_file->block_data_size = (size_t) read_count; - } - if( ( internal_file->block_data_offset > 0 ) - && ( internal_file->block_data_offset < internal_file->block_data_size ) ) - { - read_size = internal_file->block_data_size - internal_file->block_data_offset; - - if( read_size > size ) + if( ( internal_file->block_data_offset > 0 ) + && ( internal_file->block_data_offset < internal_file->block_data_size ) ) { - read_size = size; + read_size = internal_file->block_data_size - internal_file->block_data_offset; + + if( read_size > size ) + { + read_size = size; + } + if( memory_copy( + buffer, + &( internal_file->block_data[ internal_file->block_data_offset ] ), + read_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy block data.", + function ); + + return( -1 ); + } + buffer_offset += read_size; + size -= read_size; + internal_file->block_data_offset += read_size; + internal_file->current_offset += read_size; } - if( memory_copy( - buffer, - &( internal_file->block_data[ internal_file->block_data_offset ] ), - read_size ) == NULL ) + if( size == 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy block data.", - function ); - - return( -1 ); + return( (ssize_t) buffer_offset ); } - buffer_offset += read_size; - size -= read_size; - internal_file->block_data_offset += read_size; - internal_file->current_offset += read_size; - } - if( size == 0 ) - { - return( (ssize_t) buffer_offset ); } - if( internal_file->block_size == 0 ) - { - read_size = size; - } - else + read_size = size; + + if( internal_file->block_size != 0 ) { - read_size_remainder = size % internal_file->block_size; - read_size = size - read_size_remainder; + /* Read block aligned + */ + read_size_remainder = read_size % internal_file->block_size; + read_size -= read_size_remainder; } if( read_size > 0 ) { @@ -2299,14 +2247,10 @@ buffer_offset += (size_t) read_count; internal_file->current_offset += read_count; } + /* Read the non-aligned remainder + */ if( read_size_remainder > 0 ) { - /* The read was cut short - */ - if( read_count != (ssize_t) read_size ) - { - return( (ssize_t) buffer_offset ); - } if( memory_set( internal_file->block_data, 0, @@ -2402,67 +2346,6 @@ return( write_count ); } -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of WriteFile - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_WriteFile( - HANDLE file_handle, - VOID *buffer, - DWORD write_size, - DWORD *write_count, - OVERLAPPED *overlapped ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - if( buffer == NULL ) - { - return( FALSE ); - } - if( write_count == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "WriteFile" ); - - if( function != NULL ) - { - result = function( - file_handle, - buffer, - write_size, - write_count, - overlapped ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - #if defined( WINAPI ) /* Writes a buffer to the file @@ -2586,6 +2469,10 @@ } internal_file->current_offset += write_count; + if( (size64_t) internal_file->current_offset > internal_file->size ) + { + internal_file->size = (size64_t) internal_file->current_offset; + } return( write_count ); } @@ -2684,6 +2571,10 @@ } internal_file->current_offset += write_count; + if( (size64_t) internal_file->current_offset > internal_file->size ) + { + internal_file->size = (size64_t) internal_file->current_offset; + } return( write_count ); } @@ -2691,108 +2582,6 @@ #error Missing file write function #endif -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -#if !defined( INVALID_SET_FILE_POINTER ) -#define INVALID_SET_FILE_POINTER ((LONG) -1) -#endif - -/* Cross Windows safe version of SetFilePointerEx - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_SetFilePointerEx( - HANDLE file_handle, - LARGE_INTEGER distance_to_move_large_integer, - LARGE_INTEGER *new_file_pointer_large_integer, - DWORD move_method ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - LONG distance_to_move_lower_long = 0; - LONG distance_to_move_upper_long = 0; - DWORD error_number = 0; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - if( new_file_pointer_large_integer == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "SetFilePointerEx" ); - - if( function != NULL ) - { - result = function( - file_handle, - distance_to_move_large_integer, - new_file_pointer_large_integer, - move_method ); - } - else - { - function = GetProcAddress( - library_handle, - (LPCSTR) "SetFilePointer" ); - - if( function != NULL ) - { -#if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 - distance_to_move_lower_long = distance_to_move_large_integer.QuadPart & 0xffffffffUL; - distance_to_move_upper_long = distance_to_move_large_integer.QuadPart >> 32; -#else - distance_to_move_lower_long = distance_to_move_large_integer.LowPart; - distance_to_move_upper_long = distance_to_move_large_integer.HighPart; -#endif - - distance_to_move_lower_long = function( - file_handle, - distance_to_move_lower_long, - &distance_to_move_upper_long, - move_method ); - - error_number = GetLastError(); - - if( ( distance_to_move_lower_long != (LONG) INVALID_SET_FILE_POINTER ) - || ( error_number == NO_ERROR ) ) - { -#if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 - new_file_pointer_large_integer->QuadPart = distance_to_move_upper_long; - new_file_pointer_large_integer->QuadPart <<= 32; - new_file_pointer_large_integer->QuadPart += distance_to_move_lower_long; -#else - new_file_pointer_large_integer->HighPart = distance_to_move_upper_long; - new_file_pointer_large_integer->LowPart = distance_to_move_lower_long; -#endif - - result = TRUE; - } - } - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif - #if defined( WINAPI ) /* Seeks a certain offset within the file @@ -3064,51 +2853,6 @@ #error Missing file lseek function #endif -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of SetEndOfFile - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_SetEndOfFile( - HANDLE file_handle ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "SetEndOfFile" ); - - if( function != NULL ) - { - result = function( - file_handle ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - #if defined( WINAPI ) /* Resizes the file @@ -3366,90 +3110,6 @@ return( 1 ); } -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of GetFileSizeEx - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_GetFileSizeEx( - HANDLE file_handle, - LARGE_INTEGER *file_size_large_integer ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - DWORD error_number = 0; - DWORD file_size_upper_dword = 0; - DWORD file_size_lower_dword = 0; - BOOL result = FALSE; - - if( file_handle == NULL ) - { - return( FALSE ); - } - if( file_size_large_integer == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "GetFileSizeEx" ); - - if( function != NULL ) - { - result = function( - file_handle, - file_size_large_integer ); - } - else - { - function = GetProcAddress( - library_handle, - (LPCSTR) "GetFileSize" ); - - if( function != NULL ) - { - file_size_lower_dword = function( - file_handle, - &file_size_upper_dword ); - - error_number = GetLastError(); - - if( ( file_size_lower_dword != INVALID_FILE_SIZE ) - || ( error_number == NO_ERROR ) ) - { -#if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 - file_size_large_integer->QuadPart = file_size_upper_dword; - file_size_large_integer->QuadPart <<= 32; - file_size_large_integer->QuadPart += file_size_lower_dword; -#else - file_size_large_integer->HighPart = file_size_upper_dword; - file_size_large_integer->LowPart = file_size_lower_dword; -#endif - - result = TRUE; - } - } - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif - /* Retrieves the current offset in the file * Returns 1 if successful or -1 on error */ @@ -3534,22 +3194,21 @@ * or tries to dynamically call the function for Windows 2000 (0x0500) or earlier * Returns 1 if successful or -1 on error */ -int libcfile_file_get_size( - libcfile_file_t *file, +int libcfile_internal_file_get_size( + libcfile_internal_file_t *internal_file, size64_t *size, libcerror_error_t **error ) { DISK_GEOMETRY disk_geometry; GET_LENGTH_INFORMATION length_information; - libcfile_internal_file_t *internal_file = NULL; - static char *function = "libcfile_file_get_size"; - size_t read_count = 0; - LARGE_INTEGER large_integer_size = LIBCFILE_LARGE_INTEGER_ZERO; - uint32_t error_code = 0; - int result = 0; + static char *function = "libcfile_internal_file_get_size"; + LARGE_INTEGER large_integer_size = LIBCFILE_LARGE_INTEGER_ZERO; + size_t read_count = 0; + uint32_t error_code = 0; + int result = 0; - if( file == NULL ) + if( internal_file == NULL ) { libcerror_error_set( error, @@ -3560,8 +3219,6 @@ return( -1 ); } - internal_file = (libcfile_internal_file_t *) file; - if( internal_file->handle == INVALID_HANDLE_VALUE ) { libcerror_error_set( @@ -3585,7 +3242,7 @@ return( -1 ); } result = libcfile_file_is_device( - file, + (libcfile_file_t *) internal_file, error ); if( result == -1 ) @@ -3601,8 +3258,8 @@ } else if( result != 0 ) { - read_count = libcfile_file_io_control_read_with_error_code( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, @@ -3638,13 +3295,14 @@ { /* A floppy device does not support IOCTL_DISK_GET_LENGTH_INFO */ - read_count = libcfile_file_io_control_read( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, (uint8_t *) &disk_geometry, sizeof( DISK_GEOMETRY ), + &error_code, error ); if( read_count == -1 ) @@ -3682,7 +3340,7 @@ else { *size = (size64_t) length_information.Length.HighPart << 32; - *size += length_information.Length.LowPart; + *size += (uint32_t) length_information.Length.LowPart; } } else @@ -3709,7 +3367,8 @@ #if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 *size = (size64_t) large_integer_size.QuadPart; #else - *size = ( (size64_t) large_integer_size.HighPart << 32 ) + large_integer_size.LowPart; + *size = (size64_t) large_integer_size.HighPart << 32; + *size += (uint32_t) large_integer_size.LowPart; #endif } return( 1 ); @@ -3721,29 +3380,32 @@ * This function uses the POSIX fstat function or equivalent * Returns 1 if successful or -1 on error */ -int libcfile_file_get_size( - libcfile_file_t *file, +int libcfile_internal_file_get_size( + libcfile_internal_file_t *internal_file, size64_t *size, libcerror_error_t **error ) { struct stat file_statistics; - libcfile_internal_file_t *internal_file = NULL; - static char *function = "libcfile_file_get_size"; - off64_t current_offset = 0; - off64_t offset = 0; - ssize_t read_count = 0; - size_t file_statistics_size = 0; + static char *function = "libcfile_internal_file_get_size"; + size64_t safe_size = 0; + ssize_t read_count = 0; + off64_t current_offset = 0; + off64_t offset = 0; + +#if defined( BLKGETSIZE64 ) || defined( DIOCGMEDIASIZE ) || defined( DIOCGDINFO ) || ( defined( DKIOCGETBLOCKCOUNT ) && defined( DKIOCGETBLOCKSIZE ) ) + uint32_t error_code = 0; +#endif #if !defined( DIOCGMEDIASIZE ) && defined( DIOCGDINFO ) struct disklabel disk_label; #endif #if defined( DKIOCGETBLOCKCOUNT ) && defined( DKIOCGETBLOCKSIZE ) - uint64_t block_count = 0; - uint32_t bytes_per_sector = 0; + uint64_t block_count = 0; + uint32_t bytes_per_sector = 0; #endif - if( file == NULL ) + if( internal_file == NULL ) { libcerror_error_set( error, @@ -3754,8 +3416,6 @@ return( -1 ); } - internal_file = (libcfile_internal_file_t *) file; - if( internal_file->descriptor == -1 ) { libcerror_error_set( @@ -3778,12 +3438,10 @@ return( -1 ); } - file_statistics_size = sizeof( struct stat ); - if( memory_set( &file_statistics, 0, - file_statistics_size ) == NULL ) + sizeof( struct stat ) ) == NULL ) { libcerror_error_set( error, @@ -3811,13 +3469,14 @@ || S_ISCHR( file_statistics.st_mode ) ) { #if defined( BLKGETSIZE64 ) - read_count = libcfile_file_io_control_read( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, (uint32_t) BLKGETSIZE64, NULL, 0, - (uint8_t *) size, + (uint8_t *) &safe_size, 8, + &error_code, error ); if( read_count == -1 ) @@ -3844,13 +3503,14 @@ error ); } #elif defined( DIOCGMEDIASIZE ) - read_count = libcfile_file_io_control_read( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, (uint32_t) DIOCGMEDIASIZE, NULL, 0, - (uint8_t *) size, + (uint8_t *) &safe_size, 8, + &error_code, error ); if( read_count == -1 ) @@ -3877,13 +3537,14 @@ error ); } #elif defined( DIOCGDINFO ) - read_count = libcfile_file_io_control_read( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, (uint32_t) DIOCGDINFO, NULL, 0, (uint8_t *) &disk_label, sizeof( struct disklabel ), + &error_code, error ); if( read_count == -1 ) @@ -3911,16 +3572,17 @@ } else { - *size = disk_label.d_secperunit * disk_label.d_secsize; + safe_size = disk_label.d_secperunit * disk_label.d_secsize; } #elif defined( DKIOCGETBLOCKCOUNT ) && defined( DKIOCGETBLOCKSIZE ) - read_count = libcfile_file_io_control_read( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, (uint32_t) DKIOCGETBLOCKSIZE, NULL, 0, (uint8_t *) &bytes_per_sector, 4, + &error_code, error ); if( read_count == -1 ) @@ -3948,13 +3610,14 @@ } else { - read_count = libcfile_file_io_control_read( - file, + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, (uint32_t) DKIOCGETBLOCKCOUNT, NULL, 0, (uint8_t *) &block_count, 4, + &error_code, error ); if( read_count == -1 ) @@ -3992,16 +3655,17 @@ block_count ); } #endif - *size = (size64_t) ( block_count * bytes_per_sector ); + safe_size = (size64_t) ( block_count * bytes_per_sector ); } } -#endif +#endif /* defined( BLKGETSIZE64 ) || defined( DIOCGMEDIASIZE ) || defined( DIOCGDINFO ) || ( defined( DKIOCGETBLOCKCOUNT ) && defined( DKIOCGETBLOCKSIZE ) ) */ + if( read_count <= 0 ) { /* Try to seek the end of the file and determine the size based on the offset */ if( libcfile_file_get_offset( - file, + (libcfile_file_t *) internal_file, ¤t_offset, error ) != 1 ) { @@ -4015,7 +3679,7 @@ return( -1 ); } offset = libcfile_file_seek_offset( - file, + (libcfile_file_t *) internal_file, 0, SEEK_END, error ); @@ -4031,10 +3695,10 @@ return( -1 ); } - *size = (size64_t) offset; + safe_size = (size64_t) offset; offset = libcfile_file_seek_offset( - file, + (libcfile_file_t *) internal_file, current_offset, SEEK_SET, error ); @@ -4058,14 +3722,16 @@ libcnotify_printf( "%s: device media size: %" PRIu64 "\n", function, - *size ); + safe_size ); } #endif } else { - *size = (size64_t) file_statistics.st_size; + safe_size = (size64_t) file_statistics.st_size; } + *size = safe_size; + return( 1 ); } @@ -4073,50 +3739,45 @@ #error Missing file get size function #endif -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of GetFileType - * Returns the file type if successful or FILE_TYPE_UNKNOWN on error +/* Retrieves the size of the file + * Returns 1 if successful or -1 on error */ -DWORD libcfile_GetFileType( - HANDLE file_handle ) +int libcfile_file_get_size( + libcfile_file_t *file, + size64_t *size, + libcerror_error_t **error ) { - FARPROC function = NULL; - HMODULE library_handle = NULL; - DWORD result = FILE_TYPE_UNKNOWN; + libcfile_internal_file_t *internal_file = NULL; + static char *function = "libcfile_file_get_size"; - if( file_handle == NULL ) + if( file == NULL ) { - return( FILE_TYPE_UNKNOWN ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid file.", + function ); - if( library_handle == NULL ) - { - return( FILE_TYPE_UNKNOWN ); + return( -1 ); } - function = GetProcAddress( - library_handle, - (LPCSTR) "GetFileType" ); + internal_file = (libcfile_internal_file_t *) file; - if( function != NULL ) - { - result = function( - file_handle ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) + if( size == NULL ) { - result = FILE_TYPE_UNKNOWN; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid size.", + function ); + + return( -1 ); } - return( result ); -} + *size = internal_file->size; -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + return( 1 ); +} #if defined( WINAPI ) @@ -4206,7 +3867,6 @@ libcfile_internal_file_t *internal_file = NULL; static char *function = "libcfile_file_is_device"; - size_t file_statistics_size = 0; int result = 0; if( file == NULL ) @@ -4233,12 +3893,10 @@ return( -1 ); } - file_statistics_size = sizeof( struct stat ); - if( memory_set( &file_statistics, 0, - file_statistics_size ) == NULL ) + sizeof( struct stat ) ) == NULL ) { libcerror_error_set( error, @@ -4274,54 +3932,14 @@ #error Missing file is device function #endif -/* Read data from a device file using IO control - * Returns the number of bytes read if successful or -1 on error - */ -ssize_t libcfile_file_io_control_read( - libcfile_file_t *file, - uint32_t control_code, - uint8_t *control_data, - size_t control_data_size, - uint8_t *data, - size_t data_size, - libcerror_error_t **error ) -{ - static char *function = "libcfile_file_io_control_read"; - ssize_t read_count = 0; - uint32_t error_code = 0; - - read_count = libcfile_file_io_control_read_with_error_code( - file, - control_code, - control_data, - control_data_size, - data, - data_size, - &error_code, - error ); - - if( read_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_IOCTL_FAILED, - "%s: unable to to IO control device.", - function ); - - return( -1 ); - } - return( read_count ); -} - #if defined( HAVE_IOCTL ) || defined( WINAPI ) /* Read data from a device file using IO control * This function uses the POSIX ioctl function or WINAPI DeviceIoControl * Returns the number of bytes read if successful or -1 on error */ -ssize_t libcfile_file_io_control_read_with_error_code( - libcfile_file_t *file, +ssize_t libcfile_internal_file_io_control_read_with_error_code( + libcfile_internal_file_t *internal_file, uint32_t control_code, uint8_t *control_data, size_t control_data_size, @@ -4330,14 +3948,13 @@ uint32_t *error_code, libcerror_error_t **error ) { - libcfile_internal_file_t *internal_file = NULL; - static char *function = "libcfile_file_io_control_read_with_error_code"; + static char *function = "libcfile_internal_file_io_control_read_with_error_code"; #if defined( WINAPI ) - DWORD response_count = 0; + DWORD response_count = 0; #endif - if( file == NULL ) + if( internal_file == NULL ) { libcerror_error_set( error, @@ -4348,8 +3965,6 @@ return( -1 ); } - internal_file = (libcfile_internal_file_t *) file; - #if defined( WINAPI ) if( internal_file->handle == INVALID_HANDLE_VALUE ) { @@ -4525,6 +4140,114 @@ #error Missing file IO control with data function #endif +/* Read data from a device file using IO control + * Returns the number of bytes read if successful or -1 on error + */ +ssize_t libcfile_file_io_control_read( + libcfile_file_t *file, + uint32_t control_code, + uint8_t *control_data, + size_t control_data_size, + uint8_t *data, + size_t data_size, + libcerror_error_t **error ) +{ + libcfile_internal_file_t *internal_file = NULL; + static char *function = "libcfile_file_io_control_read"; + ssize_t read_count = 0; + uint32_t error_code = 0; + + if( file == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid file.", + function ); + + return( -1 ); + } + internal_file = (libcfile_internal_file_t *) file; + + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, + control_code, + control_data, + control_data_size, + data, + data_size, + &error_code, + error ); + + if( read_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_IOCTL_FAILED, + "%s: unable to to IO control device.", + function ); + + return( -1 ); + } + return( read_count ); +} + +/* Read data from a device file using IO control + * Returns the number of bytes read if successful or -1 on error + */ +ssize_t libcfile_file_io_control_read_with_error_code( + libcfile_file_t *file, + uint32_t control_code, + uint8_t *control_data, + size_t control_data_size, + uint8_t *data, + size_t data_size, + uint32_t *error_code, + libcerror_error_t **error ) +{ + libcfile_internal_file_t *internal_file = NULL; + static char *function = "libcfile_file_io_control_read_with_error_code"; + ssize_t read_count = 0; + + if( file == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid file.", + function ); + + return( -1 ); + } + internal_file = (libcfile_internal_file_t *) file; + + read_count = libcfile_internal_file_io_control_read_with_error_code( + internal_file, + control_code, + control_data, + control_data_size, + data, + data_size, + error_code, + error ); + + if( read_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_IOCTL_FAILED, + "%s: unable to to IO control device.", + function ); + + return( -1 ); + } + return( read_count ); +} + /* On some versions of Linux the FADVISE definions seem to be missing from fcntl.h */ #if defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) @@ -4648,6 +4371,94 @@ return( -1 ); } #endif /* defined( HAVE_POSIX_FADVISE ) && !defined( WINAPI ) */ + + return( 1 ); +} + +/* Sets the block size for the read and seek operations + * A block size of 0 represents no block-based operations + * The total size must be a multitude of block size + * Returns 1 if successful or -1 on error + */ +int libcfile_internal_file_set_block_size( + libcfile_internal_file_t *internal_file, + size_t block_size, + libcerror_error_t **error ) +{ + static char *function = "libcfile_internal_file_set_block_size"; + + if( internal_file == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid file.", + function ); + + return( -1 ); + } +#if defined( WINAPI ) && ( UINT32_MAX < SSIZE_MAX ) + if( block_size > (size_t) UINT32_MAX ) +#else + if( block_size > (size_t) SSIZE_MAX ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid block size value exceeds maximum.", + function ); + + return( -1 ); + } + if( internal_file->block_data != NULL ) + { + if( block_size != internal_file->block_size ) + { + memory_free( + internal_file->block_data ); + + internal_file->block_data = NULL; + internal_file->block_data_size = 0; + } + } + if( internal_file->block_data == NULL ) + { + if( block_size > 0 ) + { + internal_file->block_data = (uint8_t *) memory_allocate( + sizeof( uint8_t ) * block_size ); + + if( internal_file->block_data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create block data.", + function ); + + return( -1 ); + } + if( memory_set( + internal_file->block_data, + 0, + block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear block data.", + function ); + + return( -1 ); + } + } + internal_file->block_size = block_size; + } return( 1 ); } @@ -4728,73 +4539,31 @@ return( -1 ); } - if( block_size != internal_file->block_size ) + if( ( block_size != 0 ) + && ( ( internal_file->size % block_size ) != 0 ) ) { - if( libcfile_file_get_size( - file, - &( internal_file->size ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve size.", - function ); - - return( -1 ); - } - if( internal_file->block_data != NULL ) - { - memory_free( - internal_file->block_data ); - - internal_file->block_data = NULL; - internal_file->block_data_size = 0; - } - if( block_size > 0 ) - { - if( ( internal_file->size % block_size ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid block size value out of bounds.", - function ); - - return( -1 ); - } - internal_file->block_data = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * block_size ); - - if( internal_file == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create file.", - function ); + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid block size value out of bounds.", + function ); - return( -1 ); - } - if( memory_set( - internal_file->block_data, - 0, - block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear block data.", - function ); + return( -1 ); + } + if( libcfile_internal_file_set_block_size( + internal_file, + block_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set block size.", + function ); - return( -1 ); - } - } - internal_file->block_size = block_size; + return( -1 ); } return( 1 ); } diff -Nru libbde-20190102/libcfile/libcfile_file.h libbde-20240223/libcfile/libcfile_file.h --- libbde-20190102/libcfile/libcfile_file.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_file.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,26 +1,26 @@ /* * File functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCFILE_INTERNAL_FILE_H ) -#define _LIBCFILE_INTERNAL_FILE_H +#if !defined( _LIBCFILE_FILE_H ) +#define _LIBCFILE_FILE_H #include #include @@ -38,6 +38,7 @@ struct libcfile_internal_file { #if defined( WINAPI ) + /* The (file) handle */ HANDLE handle; @@ -85,13 +86,6 @@ size_t block_data_size; }; -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_CloseHandle( - HANDLE file_handle ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_initialize( libcfile_file_t **file, @@ -102,19 +96,6 @@ libcfile_file_t **file, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -HANDLE libcfile_CreateFileA( - LPCSTR filename, - DWORD desired_access, - DWORD share_mode, - SECURITY_ATTRIBUTES *security_attributes, - DWORD creation_disposition, - DWORD flags_and_attributes, - HANDLE template_file ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_open( libcfile_file_t *file, @@ -132,19 +113,6 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -HANDLE libcfile_CreateFileW( - LPCWSTR filename, - DWORD desired_access, - DWORD share_mode, - SECURITY_ATTRIBUTES *security_attributes, - DWORD creation_disposition, - DWORD flags_and_attributes, - HANDLE template_file ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_open_wide( libcfile_file_t *file, @@ -174,27 +142,6 @@ size_t size, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_GetOverlappedResult( - HANDLE file_handle, - OVERLAPPED *overlapped, - DWORD *read_count, - BOOL wait_io_complete ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_ReadFile( - HANDLE file_handle, - VOID *buffer, - DWORD read_size, - DWORD *read_count, - OVERLAPPED *overlapped ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - #if defined( WINAPI ) ssize_t libcfile_internal_file_read_buffer_at_offset_with_error_code( @@ -222,17 +169,6 @@ size_t size, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_WriteFile( - HANDLE file_handle, - VOID *buffer, - DWORD write_size, - DWORD *write_count, - OVERLAPPED *overlapped ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ ssize_t libcfile_file_write_buffer_with_error_code( libcfile_file_t *file, @@ -241,16 +177,6 @@ uint32_t *error_code, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_SetFilePointerEx( - HANDLE file_handle, - LARGE_INTEGER distance_to_move_large_integer, - LARGE_INTEGER *new_file_pointer_large_integer, - DWORD move_method ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ off64_t libcfile_file_seek_offset( libcfile_file_t *file, @@ -258,13 +184,6 @@ int whence, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_SetEndOfFile( - HANDLE file_handle ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_resize( libcfile_file_t *file, @@ -276,38 +195,38 @@ libcfile_file_t *file, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_GetFileSizeEx( - HANDLE file_handle, - LARGE_INTEGER *file_size_large_integer ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_get_offset( libcfile_file_t *file, off64_t *offset, libcerror_error_t **error ); +int libcfile_internal_file_get_size( + libcfile_internal_file_t *internal_file, + size64_t *size, + libcerror_error_t **error ); + LIBCFILE_EXTERN \ int libcfile_file_get_size( libcfile_file_t *file, size64_t *size, libcerror_error_t **error ); -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -DWORD libcfile_GetFileType( - HANDLE file_handle ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_is_device( libcfile_file_t *file, libcerror_error_t **error ); +ssize_t libcfile_internal_file_io_control_read_with_error_code( + libcfile_internal_file_t *internal_file, + uint32_t control_code, + uint8_t *control_data, + size_t control_data_size, + uint8_t *data, + size_t data_size, + uint32_t *error_code, + libcerror_error_t **error ); + LIBCFILE_EXTERN \ ssize_t libcfile_file_io_control_read( libcfile_file_t *file, @@ -335,6 +254,11 @@ int access_behavior, libcerror_error_t **error ); +int libcfile_internal_file_set_block_size( + libcfile_internal_file_t *internal_file, + size_t block_size, + libcerror_error_t **error ); + LIBCFILE_EXTERN \ int libcfile_file_set_block_size( libcfile_file_t *file, @@ -345,5 +269,5 @@ } #endif -#endif /* !defined( _LIBCFILE_INTERNAL_FILE_H ) */ +#endif /* !defined( _LIBCFILE_FILE_H ) */ diff -Nru libbde-20190102/libcfile/libcfile_libcerror.h libbde-20240223/libcfile/libcfile_libcerror.h --- libbde-20190102/libcfile/libcfile_libcerror.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_libcerror.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* - * The internal libcerror header + * The libcerror header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_LIBCERROR_H ) diff -Nru libbde-20190102/libcfile/libcfile_libclocale.h libbde-20240223/libcfile/libcfile_libclocale.h --- libbde-20190102/libcfile/libcfile_libclocale.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_libclocale.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* - * The internal libclocale header + * The libclocale header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_LIBCLOCALE_H ) diff -Nru libbde-20190102/libcfile/libcfile_libcnotify.h libbde-20240223/libcfile/libcfile_libcnotify.h --- libbde-20190102/libcfile/libcfile_libcnotify.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_libcnotify.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* - * The internal libcnotify header + * The libcnotify header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_LIBCNOTIFY_H ) diff -Nru libbde-20190102/libcfile/libcfile_libuna.h libbde-20240223/libcfile/libcfile_libuna.h --- libbde-20190102/libcfile/libcfile_libuna.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_libuna.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_LIBUNA_H ) diff -Nru libbde-20190102/libcfile/libcfile_notify.c libbde-20240223/libcfile/libcfile_notify.c --- libbde-20190102/libcfile/libcfile_notify.c 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_notify.c 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcfile/libcfile_notify.h libbde-20240223/libcfile/libcfile_notify.h --- libbde-20190102/libcfile/libcfile_notify.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_notify.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_NOTIFY_H ) diff -Nru libbde-20190102/libcfile/libcfile_support.c libbde-20240223/libcfile/libcfile_support.c --- libbde-20190102/libcfile/libcfile_support.c 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_support.c 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -43,6 +43,7 @@ #include "libcfile_libclocale.h" #include "libcfile_libuna.h" #include "libcfile_support.h" +#include "libcfile_winapi.h" #if !defined( HAVE_LOCAL_LIBCFILE ) @@ -108,51 +109,6 @@ #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of GetFileAttributesA - * Returns the file attributs if successful or INVALID_FILE_ATTRIBUTES on error - */ -DWORD libcfile_GetFileAttributesA( - LPCSTR filename ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - DWORD result = 0; - - if( filename == NULL ) - { - return( INVALID_FILE_ATTRIBUTES ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( INVALID_FILE_ATTRIBUTES ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "GetFileAttributesA" ); - - if( function != NULL ) - { - result = function( - filename ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = INVALID_FILE_ATTRIBUTES; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - #if defined( WINAPI ) /* Determines if a file exists @@ -164,10 +120,13 @@ const char *filename, libcerror_error_t **error ) { - static char *function = "libcfile_file_exists"; - int result = 1; - DWORD error_code = 0; - DWORD file_attributes = 0; + static char *function = "libcfile_file_exists"; + size_t filename_length = 0; + DWORD error_code = 0; + DWORD file_attributes = 0; + HANDLE handle = INVALID_HANDLE_VALUE; + int is_device_filename = 0; + int result = 1; if( filename == NULL ) { @@ -180,41 +139,143 @@ return( -1 ); } + filename_length = narrow_string_length( + filename ); + + if( filename_length > 4 ) + { + if( ( filename[ 0 ] == '\\' ) + && ( filename[ 1 ] == '\\' ) + && ( filename[ 2 ] == '.' ) + && ( filename[ 3 ] == '\\' ) ) + { + /* Ignore \\.\F:\ which is an alternative notation for F: + */ + if( ( filename_length < 7 ) + || ( filename[ 5 ] != ':' ) + || ( filename[ 6 ] != '\\' ) ) + { + is_device_filename = 1; + } + } + } + if( is_device_filename != 0 ) + { #if ( WINVER <= 0x0500 ) - file_attributes = libcfile_GetFileAttributesA( - (LPCSTR) filename ); + handle = libcfile_CreateFileA( + (LPCSTR) filename, + GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL ); #else - file_attributes = GetFileAttributesA( - (LPCSTR) filename ); + handle = CreateFileA( + (LPCSTR) filename, + GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL ); #endif - if( file_attributes == INVALID_FILE_ATTRIBUTES ) - { - error_code = GetLastError(); - - switch( error_code ) + if( handle == INVALID_HANDLE_VALUE ) { - case ERROR_ACCESS_DENIED: - result = 1; + error_code = (uint32_t) GetLastError(); - break; + switch( error_code ) + { + case ERROR_ACCESS_DENIED: + result = 1; + + break; + + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + result = 0; + + break; + + default: + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_OPEN_FAILED, + error_code, + "%s: unable to open file: %s.", + function, + filename ); - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - result = 0; - - break; + return( -1 ); + } + } + else + { +#if ( WINVER <= 0x0500 ) + result = libcfile_CloseHandle( + handle ); +#else + result = CloseHandle( + handle ); +#endif + if( result == 0 ) + { + error_code = GetLastError(); - default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_GENERIC, + LIBCERROR_IO_ERROR_CLOSE_FAILED, error_code, - "%s: unable to determine attributes of file: %s.", - function, - filename ); + "%s: unable to close file.", + function ); return( -1 ); + } + result = 1; + } + } + else + { + /* Note that GetFileAttributesA does not support Windows device file names. + */ +#if ( WINVER <= 0x0500 ) + file_attributes = libcfile_GetFileAttributesA( + (LPCSTR) filename ); +#else + file_attributes = GetFileAttributesA( + (LPCSTR) filename ); +#endif + if( file_attributes == INVALID_FILE_ATTRIBUTES ) + { + error_code = GetLastError(); + + switch( error_code ) + { + case ERROR_ACCESS_DENIED: + result = 1; + + break; + + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + result = 0; + + break; + + default: + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_GENERIC, + error_code, + "%s: unable to determine attributes of file: %s.", + function, + filename ); + + return( -1 ); + } } } return( result ); @@ -304,51 +365,6 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of GetFileAttributesW - * Returns the file attributs if successful or INVALID_FILE_ATTRIBUTES on error - */ -DWORD libcfile_GetFileAttributesW( - LPCWSTR filename ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - DWORD result = 0; - - if( filename == NULL ) - { - return( INVALID_FILE_ATTRIBUTES ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( INVALID_FILE_ATTRIBUTES ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "GetFileAttributesW" ); - - if( function != NULL ) - { - result = function( - filename ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = INVALID_FILE_ATTRIBUTES; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - #if defined( WINAPI ) /* Determines if a file exists using get file attibutes @@ -360,10 +376,13 @@ const wchar_t *filename, libcerror_error_t **error ) { - static char *function = "libcfile_file_exists_wide"; - int result = 1; - DWORD error_code = 0; - DWORD file_attributes = 0; + static char *function = "libcfile_file_exists_wide"; + size_t filename_length = 0; + DWORD error_code = 0; + DWORD file_attributes = 0; + HANDLE handle = INVALID_HANDLE_VALUE; + int is_device_filename = 0; + int result = 1; if( filename == NULL ) { @@ -376,41 +395,143 @@ return( -1 ); } + filename_length = wide_string_length( + filename ); + + if( filename_length > 4 ) + { + if( ( filename[ 0 ] == (uint16_t) '\\' ) + && ( filename[ 1 ] == (uint16_t) '\\' ) + && ( filename[ 2 ] == (uint16_t) '.' ) + && ( filename[ 3 ] == (uint16_t) '\\' ) ) + { + /* Ignore \\.\F:\ which is an alternative notation for F: + */ + if( ( filename_length < 7 ) + || ( filename[ 5 ] != (uint16_t) ':' ) + || ( filename[ 6 ] != (uint16_t) '\\' ) ) + { + is_device_filename = 1; + } + } + } + if( is_device_filename != 0 ) + { #if ( WINVER <= 0x0500 ) - file_attributes = libcfile_GetFileAttributesW( - (LPCWSTR) filename ); + handle = libcfile_CreateFileW( + (LPCWSTR) filename, + GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL ); #else - file_attributes = GetFileAttributesW( - (LPCWSTR) filename ); + handle = CreateFileW( + (LPCWSTR) filename, + GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL ); #endif - if( file_attributes == INVALID_FILE_ATTRIBUTES ) - { - error_code = GetLastError(); - - switch( error_code ) + if( handle == INVALID_HANDLE_VALUE ) { - case ERROR_ACCESS_DENIED: - result = 1; + error_code = (uint32_t) GetLastError(); - break; + switch( error_code ) + { + case ERROR_ACCESS_DENIED: + result = 1; + + break; + + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + result = 0; + + break; + + default: + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_OPEN_FAILED, + error_code, + "%s: unable to open file: %ls.", + function, + filename ); - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - result = 0; - - break; + return( -1 ); + } + } + else + { +#if ( WINVER <= 0x0500 ) + result = libcfile_CloseHandle( + handle ); +#else + result = CloseHandle( + handle ); +#endif + if( result == 0 ) + { + error_code = GetLastError(); - default: libcerror_system_set_error( error, LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_GENERIC, + LIBCERROR_IO_ERROR_CLOSE_FAILED, error_code, - "%s: unable to determine attributes of file: %ls.", - function, - filename ); + "%s: unable to close file.", + function ); return( -1 ); + } + result = 1; + } + } + else + { + /* Note that GetFileAttributesW does not support Windows device file names. + */ +#if ( WINVER <= 0x0500 ) + file_attributes = libcfile_GetFileAttributesW( + (LPCWSTR) filename ); +#else + file_attributes = GetFileAttributesW( + (LPCWSTR) filename ); +#endif + if( file_attributes == INVALID_FILE_ATTRIBUTES ) + { + error_code = GetLastError(); + + switch( error_code ) + { + case ERROR_ACCESS_DENIED: + result = 1; + + break; + + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + result = 0; + + break; + + default: + libcerror_system_set_error( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_GENERIC, + error_code, + "%s: unable to determine attributes of file: %ls.", + function, + filename ); + + return( -1 ); + } } } return( result ); @@ -617,51 +738,6 @@ #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of DeleteFileA - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_DeleteFileA( - LPCSTR filename ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( filename == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "DeleteFileA" ); - - if( function != NULL ) - { - result = function( - filename ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - /* Removes a file * Returns 1 if successful or -1 on error */ @@ -704,6 +780,17 @@ static char *function = "libcfile_file_remove_with_error_code"; BOOL result = FALSE; + if( filename == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid filename.", + function ); + + return( -1 ); + } if( error_code == NULL ) { libcerror_error_set( @@ -798,51 +885,6 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -/* Cross Windows safe version of DeleteFileW - * Returns TRUE if successful or FALSE on error - */ -BOOL libcfile_DeleteFileW( - LPCWSTR filename ) -{ - FARPROC function = NULL; - HMODULE library_handle = NULL; - BOOL result = FALSE; - - if( filename == NULL ) - { - return( FALSE ); - } - library_handle = LoadLibrary( - _SYSTEM_STRING( "kernel32.dll" ) ); - - if( library_handle == NULL ) - { - return( FALSE ); - } - function = GetProcAddress( - library_handle, - (LPCSTR) "DeleteFileW" ); - - if( function != NULL ) - { - result = function( - filename ); - } - /* This call should be after using the function - * in most cases kernel32.dll will still be available after free - */ - if( FreeLibrary( - library_handle ) != TRUE ) - { - result = FALSE; - } - return( result ); -} - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - /* Removes a file * Returns 1 if successful or -1 on error */ @@ -885,6 +927,17 @@ static char *function = "libcfile_file_remove_wide_with_error_code"; BOOL result = FALSE; + if( filename == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid filename.", + function ); + + return( -1 ); + } if( error_code == NULL ) { libcerror_error_set( diff -Nru libbde-20190102/libcfile/libcfile_support.h libbde-20240223/libcfile/libcfile_support.h --- libbde-20190102/libcfile/libcfile_support.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_support.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_SUPPORT_H ) @@ -50,13 +50,6 @@ #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */ -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -DWORD libcfile_GetFileAttributesA( - LPCSTR filename ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_exists( const char *filename, @@ -64,13 +57,6 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -DWORD libcfile_GetFileAttributesW( - LPCWSTR filename ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_exists_wide( const wchar_t *filename, @@ -78,13 +64,6 @@ #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_DeleteFileA( - LPCSTR filename ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_remove( const char *filename, @@ -98,13 +77,6 @@ #if defined( HAVE_WIDE_CHARACTER_TYPE ) -#if defined( WINAPI ) && ( WINVER <= 0x0500 ) - -BOOL libcfile_DeleteFileW( - LPCWSTR filename ); - -#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ - LIBCFILE_EXTERN \ int libcfile_file_remove_wide( const wchar_t *filename, diff -Nru libbde-20190102/libcfile/libcfile_system_string.c libbde-20240223/libcfile/libcfile_system_string.c --- libbde-20190102/libcfile/libcfile_system_string.c 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_system_string.c 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * System string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcfile/libcfile_system_string.h libbde-20240223/libcfile/libcfile_system_string.h --- libbde-20190102/libcfile/libcfile_system_string.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_system_string.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * System string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_SYSTEM_STRING_H ) diff -Nru libbde-20190102/libcfile/libcfile_types.h libbde-20240223/libcfile/libcfile_types.h --- libbde-20190102/libcfile/libcfile_types.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_types.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCFILE_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libcfile/libcfile_unused.h libbde-20240223/libcfile/libcfile_unused.h --- libbde-20190102/libcfile/libcfile_unused.h 2019-01-02 15:57:08.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_unused.h 2024-02-23 03:03:27.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCFILE_INTERNAL_UNUSED_H ) -#define _LIBCFILE_INTERNAL_UNUSED_H +#if !defined( _LIBCFILE_UNUSED_H ) +#define _LIBCFILE_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCFILE_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCFILE_UNUSED_H ) */ diff -Nru libbde-20190102/libcfile/libcfile_winapi.c libbde-20240223/libcfile/libcfile_winapi.c --- libbde-20190102/libcfile/libcfile_winapi.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_winapi.c 2024-02-23 03:03:27.000000000 +0000 @@ -0,0 +1,815 @@ +/* + * WINAPI fallback functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#if defined( WINAPI ) +#include +#endif + +#if defined( WINAPI ) && !defined( __CYGWIN__ ) +#include +#endif + +#include "libcfile_winapi.h" + +#if defined( WINAPI ) && ( WINVER <= 0x0500 ) + +/* Cross Windows safe version of CloseHandle + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_CloseHandle( + HANDLE file_handle ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "CloseHandle" ); + + if( function != NULL ) + { + result = function( + file_handle ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +/* Cross Windows safe version of CreateFileA + * Returns a handle if successful or INVALID_HANDLE_VALUE on error + */ +HANDLE libcfile_CreateFileA( + LPCSTR filename, + DWORD desired_access, + DWORD share_mode, + SECURITY_ATTRIBUTES *security_attributes, + DWORD creation_disposition, + DWORD flags_and_attributes, + HANDLE template_file ) +{ + FARPROC function = NULL; + HANDLE result = INVALID_HANDLE_VALUE; + HMODULE library_handle = NULL; + + if( filename == NULL ) + { + return( INVALID_HANDLE_VALUE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( INVALID_HANDLE_VALUE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "CreateFileA" ); + + if( function != NULL ) + { + result = (HANDLE) function( + filename, + desired_access, + share_mode, + security_attributes, + creation_disposition, + flags_and_attributes, + template_file ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + libcfile_CloseHandle( + result ); + + return( INVALID_HANDLE_VALUE ); + } + return( result ); +} + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +/* Cross Windows safe version of CreateFileW + * Returns a handle if successful or INVALID_HANDLE_VALUE on error + */ +HANDLE libcfile_CreateFileW( + LPCWSTR filename, + DWORD desired_access, + DWORD share_mode, + SECURITY_ATTRIBUTES *security_attributes, + DWORD creation_disposition, + DWORD flags_and_attributes, + HANDLE template_file ) +{ + FARPROC function = NULL; + HANDLE result = INVALID_HANDLE_VALUE; + HMODULE library_handle = NULL; + + if( filename == NULL ) + { + return( INVALID_HANDLE_VALUE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( INVALID_HANDLE_VALUE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "CreateFileW" ); + + if( function != NULL ) + { + result = (HANDLE) function( + filename, + desired_access, + share_mode, + security_attributes, + creation_disposition, + flags_and_attributes, + template_file ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + libcfile_CloseHandle( + result ); + + return( INVALID_HANDLE_VALUE ); + } + return( result ); +} + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +/* Cross Windows safe version of GetOverlappedResult + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_GetOverlappedResult( + HANDLE file_handle, + OVERLAPPED *overlapped, + DWORD *read_count, + BOOL wait_io_complete ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + if( overlapped == NULL ) + { + return( FALSE ); + } + if( read_count == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "GetOverlappedResult" ); + + if( function != NULL ) + { + result = function( + file_handle, + overlapped, + read_count, + wait_io_complete ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +/* Cross Windows safe version of ReadFile + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_ReadFile( + HANDLE file_handle, + VOID *buffer, + DWORD read_size, + DWORD *read_count, + OVERLAPPED *overlapped ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + if( buffer == NULL ) + { + return( FALSE ); + } + if( read_count == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "ReadFile" ); + + if( function != NULL ) + { + result = function( + file_handle, + buffer, + read_size, + read_count, + overlapped ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +/* Cross Windows safe version of WriteFile + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_WriteFile( + HANDLE file_handle, + VOID *buffer, + DWORD write_size, + DWORD *write_count, + OVERLAPPED *overlapped ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + if( buffer == NULL ) + { + return( FALSE ); + } + if( write_count == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "WriteFile" ); + + if( function != NULL ) + { + result = function( + file_handle, + buffer, + write_size, + write_count, + overlapped ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +#if !defined( INVALID_SET_FILE_POINTER ) +#define INVALID_SET_FILE_POINTER ((LONG) -1) +#endif + +/* Cross Windows safe version of SetFilePointerEx + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_SetFilePointerEx( + HANDLE file_handle, + LARGE_INTEGER distance_to_move_large_integer, + LARGE_INTEGER *new_file_pointer_large_integer, + DWORD move_method ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + LONG distance_to_move_lower_long = 0; + LONG distance_to_move_upper_long = 0; + DWORD error_number = 0; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + if( new_file_pointer_large_integer == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "SetFilePointerEx" ); + + if( function != NULL ) + { + result = function( + file_handle, + distance_to_move_large_integer, + new_file_pointer_large_integer, + move_method ); + } + else + { + function = GetProcAddress( + library_handle, + (LPCSTR) "SetFilePointer" ); + + if( function != NULL ) + { +#if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 + distance_to_move_lower_long = distance_to_move_large_integer.QuadPart & 0xffffffffUL; + distance_to_move_upper_long = distance_to_move_large_integer.QuadPart >> 32; +#else + distance_to_move_lower_long = distance_to_move_large_integer.LowPart; + distance_to_move_upper_long = distance_to_move_large_integer.HighPart; +#endif + + distance_to_move_lower_long = function( + file_handle, + distance_to_move_lower_long, + &distance_to_move_upper_long, + move_method ); + + error_number = GetLastError(); + + if( ( distance_to_move_lower_long != (LONG) INVALID_SET_FILE_POINTER ) + || ( error_number == NO_ERROR ) ) + { +#if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 + new_file_pointer_large_integer->QuadPart = distance_to_move_upper_long; + new_file_pointer_large_integer->QuadPart <<= 32; + new_file_pointer_large_integer->QuadPart += distance_to_move_lower_long; +#else + new_file_pointer_large_integer->HighPart = distance_to_move_upper_long; + new_file_pointer_large_integer->LowPart = distance_to_move_lower_long; +#endif + + result = TRUE; + } + } + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +/* Cross Windows safe version of SetEndOfFile + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_SetEndOfFile( + HANDLE file_handle ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "SetEndOfFile" ); + + if( function != NULL ) + { + result = function( + file_handle ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +/* Cross Windows safe version of GetFileSizeEx + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_GetFileSizeEx( + HANDLE file_handle, + LARGE_INTEGER *file_size_large_integer ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + DWORD error_number = 0; + DWORD file_size_upper_dword = 0; + DWORD file_size_lower_dword = 0; + BOOL result = FALSE; + + if( file_handle == NULL ) + { + return( FALSE ); + } + if( file_size_large_integer == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "GetFileSizeEx" ); + + if( function != NULL ) + { + result = function( + file_handle, + file_size_large_integer ); + } + else + { + function = GetProcAddress( + library_handle, + (LPCSTR) "GetFileSize" ); + + if( function != NULL ) + { + file_size_lower_dword = function( + file_handle, + &file_size_upper_dword ); + + error_number = GetLastError(); + + if( ( file_size_lower_dword != INVALID_FILE_SIZE ) + || ( error_number == NO_ERROR ) ) + { +#if defined( __BORLANDC__ ) && __BORLANDC__ <= 0x520 + file_size_large_integer->QuadPart = file_size_upper_dword; + file_size_large_integer->QuadPart <<= 32; + file_size_large_integer->QuadPart += file_size_lower_dword; +#else + file_size_large_integer->HighPart = file_size_upper_dword; + file_size_large_integer->LowPart = file_size_lower_dword; +#endif + + result = TRUE; + } + } + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +/* Cross Windows safe version of GetFileType + * Returns the file type if successful or FILE_TYPE_UNKNOWN on error + */ +DWORD libcfile_GetFileType( + HANDLE file_handle ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + DWORD result = FILE_TYPE_UNKNOWN; + + if( file_handle == NULL ) + { + return( FILE_TYPE_UNKNOWN ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FILE_TYPE_UNKNOWN ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "GetFileType" ); + + if( function != NULL ) + { + result = function( + file_handle ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FILE_TYPE_UNKNOWN; + } + return( result ); +} + +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#if defined( WINAPI ) && ( WINVER <= 0x0500 ) + +/* Cross Windows safe version of GetFileAttributesA + * Returns the file attributs if successful or INVALID_FILE_ATTRIBUTES on error + */ +DWORD libcfile_GetFileAttributesA( + LPCSTR filename ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + DWORD result = 0; + + if( filename == NULL ) + { + return( INVALID_FILE_ATTRIBUTES ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( INVALID_FILE_ATTRIBUTES ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "GetFileAttributesA" ); + + if( function != NULL ) + { + result = function( + filename ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = INVALID_FILE_ATTRIBUTES; + } + return( result ); +} + +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +#if defined( WINAPI ) && ( WINVER <= 0x0500 ) + +/* Cross Windows safe version of GetFileAttributesW + * Returns the file attributs if successful or INVALID_FILE_ATTRIBUTES on error + */ +DWORD libcfile_GetFileAttributesW( + LPCWSTR filename ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + DWORD result = 0; + + if( filename == NULL ) + { + return( INVALID_FILE_ATTRIBUTES ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( INVALID_FILE_ATTRIBUTES ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "GetFileAttributesW" ); + + if( function != NULL ) + { + result = function( + filename ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = INVALID_FILE_ATTRIBUTES; + } + return( result ); +} + +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +#if defined( WINAPI ) && ( WINVER <= 0x0500 ) + +/* Cross Windows safe version of DeleteFileA + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_DeleteFileA( + LPCSTR filename ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( filename == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "DeleteFileA" ); + + if( function != NULL ) + { + result = function( + filename ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +#if defined( WINAPI ) && ( WINVER <= 0x0500 ) + +/* Cross Windows safe version of DeleteFileW + * Returns TRUE if successful or FALSE on error + */ +BOOL libcfile_DeleteFileW( + LPCWSTR filename ) +{ + FARPROC function = NULL; + HMODULE library_handle = NULL; + BOOL result = FALSE; + + if( filename == NULL ) + { + return( FALSE ); + } + library_handle = LoadLibrary( + _SYSTEM_STRING( "kernel32.dll" ) ); + + if( library_handle == NULL ) + { + return( FALSE ); + } + function = GetProcAddress( + library_handle, + (LPCSTR) "DeleteFileW" ); + + if( function != NULL ) + { + result = function( + filename ); + } + /* This call should be after using the function + * in most cases kernel32.dll will still be available after free + */ + if( FreeLibrary( + library_handle ) != TRUE ) + { + result = FALSE; + } + return( result ); +} + +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + diff -Nru libbde-20190102/libcfile/libcfile_winapi.h libbde-20240223/libcfile/libcfile_winapi.h --- libbde-20190102/libcfile/libcfile_winapi.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libcfile/libcfile_winapi.h 2024-02-23 03:03:27.000000000 +0000 @@ -0,0 +1,122 @@ +/* + * WINAPI fallback functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBCFILE_WINAPI_H ) +#define _LIBCFILE_WINAPI_H + +#include +#include + +#if defined( __cplusplus ) +extern "C" { +#endif + +#if defined( WINAPI ) && ( WINVER <= 0x0500 ) + +BOOL libcfile_CloseHandle( + HANDLE file_handle ); + +HANDLE libcfile_CreateFileA( + LPCSTR filename, + DWORD desired_access, + DWORD share_mode, + SECURITY_ATTRIBUTES *security_attributes, + DWORD creation_disposition, + DWORD flags_and_attributes, + HANDLE template_file ); + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +HANDLE libcfile_CreateFileW( + LPCWSTR filename, + DWORD desired_access, + DWORD share_mode, + SECURITY_ATTRIBUTES *security_attributes, + DWORD creation_disposition, + DWORD flags_and_attributes, + HANDLE template_file ); + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +BOOL libcfile_GetOverlappedResult( + HANDLE file_handle, + OVERLAPPED *overlapped, + DWORD *read_count, + BOOL wait_io_complete ); + +BOOL libcfile_ReadFile( + HANDLE file_handle, + VOID *buffer, + DWORD read_size, + DWORD *read_count, + OVERLAPPED *overlapped ); + +BOOL libcfile_WriteFile( + HANDLE file_handle, + VOID *buffer, + DWORD write_size, + DWORD *write_count, + OVERLAPPED *overlapped ); + +BOOL libcfile_SetFilePointerEx( + HANDLE file_handle, + LARGE_INTEGER distance_to_move_large_integer, + LARGE_INTEGER *new_file_pointer_large_integer, + DWORD move_method ); + +BOOL libcfile_SetEndOfFile( + HANDLE file_handle ); + +BOOL libcfile_GetFileSizeEx( + HANDLE file_handle, + LARGE_INTEGER *file_size_large_integer ); + +DWORD libcfile_GetFileType( + HANDLE file_handle ); + +DWORD libcfile_GetFileAttributesA( + LPCSTR filename ); + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +DWORD libcfile_GetFileAttributesW( + LPCWSTR filename ); + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +BOOL libcfile_DeleteFileA( + LPCSTR filename ); + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +BOOL libcfile_DeleteFileW( + LPCWSTR filename ); + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBCFILE_WINAPI_H ) */ + diff -Nru libbde-20190102/libclocale/Makefile.am libbde-20240223/libclocale/Makefile.am --- libbde-20190102/libclocale/Makefile.am 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/Makefile.am 2024-02-23 03:03:28.000000000 +0000 @@ -3,7 +3,7 @@ -DLOCALEDIR=\"$(datadir)/locale\" \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ + @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libclocale.la @@ -22,9 +22,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libclocale ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libclocale_la_SOURCES) diff -Nru libbde-20190102/libclocale/Makefile.in libbde-20240223/libclocale/Makefile.in --- libbde-20190102/libclocale/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libclocale/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libclocale ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -182,6 +182,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -199,8 +200,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -217,6 +216,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -228,8 +233,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -247,7 +254,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -265,7 +271,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -319,8 +324,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -339,6 +342,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -349,8 +353,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -373,26 +377,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -401,7 +385,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -420,6 +403,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -462,9 +446,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -533,8 +514,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -557,11 +536,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -574,7 +550,7 @@ @HAVE_LOCAL_LIBCLOCALE_TRUE@ -DLOCALEDIR=\"$(datadir)/locale\" \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCLOCALE_TRUE@ -I$(top_srcdir)/common \ -@HAVE_LOCAL_LIBCLOCALE_TRUE@ @LIBCERROR_CPPFLAGS@ +@HAVE_LOCAL_LIBCLOCALE_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCLOCALE_TRUE@noinst_LTLIBRARIES = libclocale.la @HAVE_LOCAL_LIBCLOCALE_TRUE@libclocale_la_SOURCES = \ @@ -681,6 +657,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -733,7 +711,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -871,6 +848,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -887,15 +872,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libclocale ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libclocale_la_SOURCES) diff -Nru libbde-20190102/libclocale/libclocale_codepage.c libbde-20240223/libclocale/libclocale_codepage.c --- libbde-20190102/libclocale/libclocale_codepage.c 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_codepage.c 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Codepage functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libclocale/libclocale_codepage.h libbde-20240223/libclocale/libclocale_codepage.h --- libbde-20190102/libclocale/libclocale_codepage.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_codepage.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Codepage functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_CODEPAGE_H ) @@ -32,9 +32,10 @@ extern "C" { #endif -#if !defined( __CYGWIN__ ) -extern int libclocale_codepage; +#if defined( __CYGWIN__ ) && ( __GNUC__ < 10 ) +int libclocale_codepage; #else +LIBCLOCALE_EXTERN_VARIABLE \ int libclocale_codepage; #endif diff -Nru libbde-20190102/libclocale/libclocale_definitions.h libbde-20240223/libclocale/libclocale_definitions.h --- libbde-20190102/libclocale/libclocale_definitions.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_definitions.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_INTERNAL_DEFINITIONS_H ) @@ -34,11 +34,11 @@ */ #else -#define LIBCLOCALE_VERSION 20180721 +#define LIBCLOCALE_VERSION 20240107 /* The libclocale version string */ -#define LIBCLOCALE_VERSION_STRING "20180721" +#define LIBCLOCALE_VERSION_STRING "20240107" /* The codepage feature flag definitions */ diff -Nru libbde-20190102/libclocale/libclocale_extern.h libbde-20240223/libclocale/libclocale_extern.h --- libbde-20190102/libclocale/libclocale_extern.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_extern.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_INTERNAL_EXTERN_H ) @@ -28,16 +28,13 @@ */ #if !defined( HAVE_LOCAL_LIBCLOCALE ) -/* If libtool DLL support is enabled set LIBCLOCALE_DLL_EXPORT - * before including libclocale/extern.h - */ -#if defined( _WIN32 ) && defined( DLL_EXPORT ) -#define LIBCLOCALE_DLL_EXPORT -#endif - #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCLOCALE_EXTERN_VARIABLE extern +#else #define LIBCLOCALE_EXTERN_VARIABLE LIBCLOCALE_EXTERN +#endif #else #define LIBCLOCALE_EXTERN /* extern */ diff -Nru libbde-20190102/libclocale/libclocale_libcerror.h libbde-20240223/libclocale/libclocale_libcerror.h --- libbde-20190102/libclocale/libclocale_libcerror.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_libcerror.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcerror header * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_LIBCERROR_H ) diff -Nru libbde-20190102/libclocale/libclocale_locale.c libbde-20240223/libclocale/libclocale_locale.c --- libbde-20190102/libclocale/libclocale_locale.c 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_locale.c 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Locale functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libclocale/libclocale_locale.h libbde-20240223/libclocale/libclocale_locale.h --- libbde-20190102/libclocale/libclocale_locale.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_locale.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Locale functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_LOCALE_H ) diff -Nru libbde-20190102/libclocale/libclocale_support.c libbde-20240223/libclocale/libclocale_support.c --- libbde-20190102/libclocale/libclocale_support.c 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_support.c 2024-02-23 03:03:28.000000000 +0000 @@ -1,28 +1,28 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include -#if defined( HAVE_LIBINTL_H ) +#if defined( HAVE_LIBINTL_H ) && defined( ENABLE_NLS ) #include #endif @@ -68,7 +68,7 @@ return( -1 ); } -#if defined( HAVE_BINDTEXTDOMAIN ) && defined( HAVE_TEXTDOMAIN ) +#if defined( HAVE_BINDTEXTDOMAIN ) && defined( HAVE_TEXTDOMAIN ) && defined( LOCALEDIR ) if( bindtextdomain( domain_name, LOCALEDIR ) == NULL ) @@ -94,7 +94,7 @@ return( -1 ); } -#endif /* defined( HAVE_BINDTEXTDOMAIN ) && defined( HAVE_TEXTDOMAIN ) */ +#endif /* defined( HAVE_BINDTEXTDOMAIN ) && defined( HAVE_TEXTDOMAIN ) && defined( LOCALEDIR ) */ #if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_locale_get_codepage( diff -Nru libbde-20190102/libclocale/libclocale_support.h libbde-20240223/libclocale/libclocale_support.h --- libbde-20190102/libclocale/libclocale_support.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_support.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_SUPPORT_H ) diff -Nru libbde-20190102/libclocale/libclocale_unused.h libbde-20240223/libclocale/libclocale_unused.h --- libbde-20190102/libclocale/libclocale_unused.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_unused.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCLOCALE_INTERNAL_UNUSED_H ) -#define _LIBCLOCALE_INTERNAL_UNUSED_H +#if !defined( _LIBCLOCALE_UNUSED_H ) +#define _LIBCLOCALE_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCLOCALE_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCLOCALE_UNUSED_H ) */ diff -Nru libbde-20190102/libclocale/libclocale_wide_string.c libbde-20240223/libclocale/libclocale_wide_string.c --- libbde-20190102/libclocale/libclocale_wide_string.c 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_wide_string.c 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Wide character string functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libclocale/libclocale_wide_string.h libbde-20240223/libclocale/libclocale_wide_string.h --- libbde-20190102/libclocale/libclocale_wide_string.h 2019-01-02 15:57:10.000000000 +0000 +++ libbde-20240223/libclocale/libclocale_wide_string.h 2024-02-23 03:03:28.000000000 +0000 @@ -1,22 +1,22 @@ /* * Wide character string functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCLOCALE_WIDE_STRING_H ) diff -Nru libbde-20190102/libcnotify/Makefile.am libbde-20240223/libcnotify/Makefile.am --- libbde-20190102/libcnotify/Makefile.am 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/Makefile.am 2024-02-23 03:03:29.000000000 +0000 @@ -2,7 +2,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ + @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libcnotify.la @@ -21,9 +21,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcnotify ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcnotify_la_SOURCES) diff -Nru libbde-20190102/libcnotify/Makefile.in libbde-20240223/libcnotify/Makefile.in --- libbde-20190102/libcnotify/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcnotify/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcnotify ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -181,6 +181,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -198,8 +199,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -216,6 +215,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -227,8 +232,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -246,7 +253,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -264,7 +270,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -318,8 +323,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -338,6 +341,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -348,8 +352,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -372,26 +376,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -400,7 +384,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -419,6 +402,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -461,9 +445,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -532,8 +513,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -556,11 +535,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -572,7 +548,7 @@ @HAVE_LOCAL_LIBCNOTIFY_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCNOTIFY_TRUE@ -I$(top_srcdir)/common \ -@HAVE_LOCAL_LIBCNOTIFY_TRUE@ @LIBCERROR_CPPFLAGS@ +@HAVE_LOCAL_LIBCNOTIFY_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCNOTIFY_TRUE@noinst_LTLIBRARIES = libcnotify.la @HAVE_LOCAL_LIBCNOTIFY_TRUE@libcnotify_la_SOURCES = \ @@ -679,6 +655,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -731,7 +709,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -869,6 +846,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -885,15 +870,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcnotify ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcnotify_la_SOURCES) diff -Nru libbde-20190102/libcnotify/libcnotify_definitions.h libbde-20240223/libcnotify/libcnotify_definitions.h --- libbde-20190102/libcnotify/libcnotify_definitions.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_definitions.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCNOTIFY_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCNOTIFY_VERSION 20180102 +#define LIBCNOTIFY_VERSION 20240108 /* The libcnotify version string */ -#define LIBCNOTIFY_VERSION_STRING "20180102" +#define LIBCNOTIFY_VERSION_STRING "20240108" /* The print data flags */ @@ -50,5 +50,5 @@ #endif /* !defined( HAVE_LOCAL_LIBCNOTIFY ) */ -#endif +#endif /* !defined( LIBCNOTIFY_INTERNAL_DEFINITIONS_H ) */ diff -Nru libbde-20190102/libcnotify/libcnotify_extern.h libbde-20240223/libcnotify/libcnotify_extern.h --- libbde-20190102/libcnotify/libcnotify_extern.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_extern.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCNOTIFY_INTERNAL_EXTERN_H ) @@ -28,17 +28,17 @@ */ #if !defined( HAVE_LOCAL_LIBCNOTIFY ) -/* If libtool DLL support is enabled set LIBCNOTIFY_DLL_EXPORT - * before including libcnotify/extern.h - */ -#if defined( _WIN32 ) && defined( DLL_EXPORT ) -#define LIBCNOTIFY_DLL_EXPORT -#endif - #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCNOTIFY_EXTERN_VARIABLE extern +#else +#define LIBCNOTIFY_EXTERN_VARIABLE LIBCNOTIFY_EXTERN +#endif + #else -#define LIBCNOTIFY_EXTERN /* extern */ +#define LIBCNOTIFY_EXTERN /* extern */ +#define LIBCNOTIFY_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCNOTIFY ) */ diff -Nru libbde-20190102/libcnotify/libcnotify_libcerror.h libbde-20240223/libcnotify/libcnotify_libcerror.h --- libbde-20190102/libcnotify/libcnotify_libcerror.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_libcerror.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcerror header * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCNOTIFY_LIBCERROR_H ) diff -Nru libbde-20190102/libcnotify/libcnotify_print.c libbde-20240223/libcnotify/libcnotify_print.c --- libbde-20190102/libcnotify/libcnotify_print.c 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_print.c 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification print functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -267,9 +267,12 @@ { return( 0 ); } - if( data == NULL ) + if( data_size > 0 ) { - return( -1 ); + if( data == NULL ) + { + return( -1 ); + } } if( data_size > (size_t) SSIZE_MAX ) { diff -Nru libbde-20190102/libcnotify/libcnotify_print.h libbde-20240223/libcnotify/libcnotify_print.h --- libbde-20190102/libcnotify/libcnotify_print.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_print.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification print functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCNOTIFY_PRINT_H ) diff -Nru libbde-20190102/libcnotify/libcnotify_stream.c libbde-20240223/libcnotify/libcnotify_stream.c --- libbde-20190102/libcnotify/libcnotify_stream.c 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_stream.c 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcnotify/libcnotify_stream.h libbde-20240223/libcnotify/libcnotify_stream.h --- libbde-20190102/libcnotify/libcnotify_stream.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_stream.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notification stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCNOTIFY_STREAM_H ) diff -Nru libbde-20190102/libcnotify/libcnotify_support.c libbde-20240223/libcnotify/libcnotify_support.c --- libbde-20190102/libcnotify/libcnotify_support.c 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_support.c 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcnotify/libcnotify_support.h libbde-20240223/libcnotify/libcnotify_support.h --- libbde-20190102/libcnotify/libcnotify_support.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_support.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCNOTIFY_SUPPORT_H ) diff -Nru libbde-20190102/libcnotify/libcnotify_unused.h libbde-20240223/libcnotify/libcnotify_unused.h --- libbde-20190102/libcnotify/libcnotify_unused.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_unused.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCNOTIFY_INTERNAL_UNUSED_H ) -#define _LIBCNOTIFY_INTERNAL_UNUSED_H +#if !defined( _LIBCNOTIFY_UNUSED_H ) +#define _LIBCNOTIFY_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCNOTIFY_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCNOTIFY_UNUSED_H ) */ diff -Nru libbde-20190102/libcnotify/libcnotify_verbose.c libbde-20240223/libcnotify/libcnotify_verbose.c --- libbde-20190102/libcnotify/libcnotify_verbose.c 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_verbose.c 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Verbose functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcnotify/libcnotify_verbose.h libbde-20240223/libcnotify/libcnotify_verbose.h --- libbde-20190102/libcnotify/libcnotify_verbose.h 2019-01-02 15:57:12.000000000 +0000 +++ libbde-20240223/libcnotify/libcnotify_verbose.h 2024-02-23 03:03:29.000000000 +0000 @@ -1,22 +1,22 @@ /* * Verbose functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCNOTIFY_VERBOSE_H ) @@ -31,9 +31,10 @@ extern "C" { #endif -#if !defined( __CYGWIN__ ) -extern int libcnotify_verbose; +#if defined( __CYGWIN__ ) && ( __GNUC__ < 10 ) +int libcnotify_verbose; #else +LIBCNOTIFY_EXTERN_VARIABLE \ int libcnotify_verbose; #endif diff -Nru libbde-20190102/libcpath/Makefile.am libbde-20240223/libcpath/Makefile.am --- libbde-20190102/libcpath/Makefile.am 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/Makefile.am 2024-02-23 03:03:30.000000000 +0000 @@ -27,9 +27,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcpath ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcpath_la_SOURCES) diff -Nru libbde-20190102/libcpath/Makefile.in libbde-20240223/libcpath/Makefile.in --- libbde-20190102/libcpath/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcpath/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcpath ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -179,6 +179,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -196,8 +197,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -214,6 +213,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -225,8 +230,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -244,7 +251,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -262,7 +268,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -316,8 +321,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -336,6 +339,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -346,8 +350,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -370,26 +374,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -398,7 +382,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -417,6 +400,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -459,9 +443,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -530,8 +511,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -554,11 +533,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -683,6 +659,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -735,7 +713,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -873,6 +850,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -889,15 +874,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcpath ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcpath_la_SOURCES) diff -Nru libbde-20190102/libcpath/libcpath_definitions.h libbde-20240223/libcpath/libcpath_definitions.h --- libbde-20190102/libcpath/libcpath_definitions.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_definitions.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCPATH_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCPATH_VERSION 20181228 +#define LIBCPATH_VERSION 20240109 /* The libcpath version string */ -#define LIBCPATH_VERSION_STRING "20181228" +#define LIBCPATH_VERSION_STRING "20240109" #if defined( WINAPI ) #define LIBCPATH_SEPARATOR '\\' diff -Nru libbde-20190102/libcpath/libcpath_error.c libbde-20240223/libcpath/libcpath_error.c --- libbde-20190102/libcpath/libcpath_error.c 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_error.c 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcpath/libcpath_error.h libbde-20240223/libcpath/libcpath_error.h --- libbde-20190102/libcpath/libcpath_error.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_error.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcpath/libcpath_extern.h libbde-20240223/libcpath/libcpath_extern.h --- libbde-20190102/libcpath/libcpath_extern.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_extern.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCPATH_EXTERN_VARIABLE extern +#else #define LIBCPATH_EXTERN_VARIABLE LIBCPATH_EXTERN +#endif #else #define LIBCPATH_EXTERN /* extern */ diff -Nru libbde-20190102/libcpath/libcpath_libcerror.h libbde-20240223/libcpath/libcpath_libcerror.h --- libbde-20190102/libcpath/libcpath_libcerror.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_libcerror.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_LIBCERROR_H ) diff -Nru libbde-20190102/libcpath/libcpath_libclocale.h libbde-20240223/libcpath/libcpath_libclocale.h --- libbde-20190102/libcpath/libcpath_libclocale.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_libclocale.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libclocale header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_LIBCLOCALE_H ) diff -Nru libbde-20190102/libcpath/libcpath_libcsplit.h libbde-20240223/libcpath/libcpath_libcsplit.h --- libbde-20190102/libcpath/libcpath_libcsplit.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_libcsplit.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcsplit header * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_LIBCSPLIT_H ) @@ -46,7 +46,7 @@ #include -#endif +#endif /* defined( HAVE_LOCAL_LIBCSPLIT ) */ -#endif +#endif /* !defined( _LIBCPATH_LIBCSPLIT_H ) */ diff -Nru libbde-20190102/libcpath/libcpath_libuna.h libbde-20240223/libcpath/libcpath_libuna.h --- libbde-20190102/libcpath/libcpath_libuna.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_libuna.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_LIBUNA_H ) diff -Nru libbde-20190102/libcpath/libcpath_path.c libbde-20240223/libcpath/libcpath_path.c --- libbde-20190102/libcpath/libcpath_path.c 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_path.c 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * Path functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -3377,7 +3377,7 @@ if( *path != NULL ) { memory_free( - path ); + *path ); *path = NULL; } @@ -6943,7 +6943,7 @@ if( *path != NULL ) { memory_free( - path ); + *path ); *path = NULL; } diff -Nru libbde-20190102/libcpath/libcpath_path.h libbde-20240223/libcpath/libcpath_path.h --- libbde-20190102/libcpath/libcpath_path.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_path.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * Path functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_PATH_H ) diff -Nru libbde-20190102/libcpath/libcpath_support.c libbde-20240223/libcpath/libcpath_support.c --- libbde-20190102/libcpath/libcpath_support.c 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_support.c 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcpath/libcpath_support.h libbde-20240223/libcpath/libcpath_support.h --- libbde-20190102/libcpath/libcpath_support.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_support.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_SUPPORT_H ) diff -Nru libbde-20190102/libcpath/libcpath_system_string.c libbde-20240223/libcpath/libcpath_system_string.c --- libbde-20190102/libcpath/libcpath_system_string.c 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_system_string.c 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * System string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcpath/libcpath_system_string.h libbde-20240223/libcpath/libcpath_system_string.h --- libbde-20190102/libcpath/libcpath_system_string.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_system_string.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,22 +1,22 @@ /* * System string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCPATH_SYSTEM_STRING_H ) diff -Nru libbde-20190102/libcpath/libcpath_unused.h libbde-20240223/libcpath/libcpath_unused.h --- libbde-20190102/libcpath/libcpath_unused.h 2019-01-02 15:57:14.000000000 +0000 +++ libbde-20240223/libcpath/libcpath_unused.h 2024-02-23 03:03:30.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCPATH_INTERNAL_UNUSED_H ) -#define _LIBCPATH_INTERNAL_UNUSED_H +#if !defined( _LIBCPATH_UNUSED_H ) +#define _LIBCPATH_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCPATH_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCPATH_UNUSED_H ) */ diff -Nru libbde-20190102/libcsplit/Makefile.am libbde-20240223/libcsplit/Makefile.am --- libbde-20190102/libcsplit/Makefile.am 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/Makefile.am 2024-02-23 03:03:31.000000000 +0000 @@ -2,7 +2,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ + @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libcsplit.la @@ -24,9 +24,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcsplit ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcsplit_la_SOURCES) diff -Nru libbde-20190102/libcsplit/Makefile.in libbde-20240223/libcsplit/Makefile.in --- libbde-20190102/libcsplit/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcsplit/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcsplit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -189,6 +189,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -206,8 +207,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -224,6 +223,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -235,8 +240,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -254,7 +261,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -272,7 +278,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -326,8 +331,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -346,6 +349,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -356,8 +360,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -380,26 +384,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -408,7 +392,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -427,6 +410,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -469,9 +453,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -540,8 +521,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -564,11 +543,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -580,7 +556,7 @@ @HAVE_LOCAL_LIBCSPLIT_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCSPLIT_TRUE@ -I$(top_srcdir)/common \ -@HAVE_LOCAL_LIBCSPLIT_TRUE@ @LIBCERROR_CPPFLAGS@ +@HAVE_LOCAL_LIBCSPLIT_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBCSPLIT_TRUE@noinst_LTLIBRARIES = libcsplit.la @HAVE_LOCAL_LIBCSPLIT_TRUE@libcsplit_la_SOURCES = \ @@ -692,6 +668,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -744,7 +722,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -884,6 +861,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -900,15 +885,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcsplit ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcsplit_la_SOURCES) diff -Nru libbde-20190102/libcsplit/libcsplit_definitions.h libbde-20240223/libcsplit/libcsplit_definitions.h --- libbde-20190102/libcsplit/libcsplit_definitions.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_definitions.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCSPLIT_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCSPLIT_VERSION 20180103 +#define LIBCSPLIT_VERSION 20240110 /* The libcsplit version string */ -#define LIBCSPLIT_VERSION_STRING "20180103" +#define LIBCSPLIT_VERSION_STRING "20240110" #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ diff -Nru libbde-20190102/libcsplit/libcsplit_error.c libbde-20240223/libcsplit/libcsplit_error.c --- libbde-20190102/libcsplit/libcsplit_error.c 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_error.c 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcsplit/libcsplit_error.h libbde-20240223/libcsplit/libcsplit_error.h --- libbde-20190102/libcsplit/libcsplit_error.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_error.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_extern.h libbde-20240223/libcsplit/libcsplit_extern.h --- libbde-20190102/libcsplit/libcsplit_extern.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_extern.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_INTERNAL_EXTERN_H ) @@ -28,17 +28,17 @@ */ #if !defined( HAVE_LOCAL_LIBCSPLIT ) -/* If libtool DLL support is enabled set LIBCSPLIT_DLL_EXPORT - * before including libcsplit/extern.h - */ -#if defined( _WIN32 ) && defined( DLL_EXPORT ) -#define LIBCSPLIT_DLL_EXPORT -#endif - #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCSPLIT_EXTERN_VARIABLE extern +#else +#define LIBCSPLIT_EXTERN_VARIABLE LIBCSPLIT_EXTERN +#endif + #else -#define LIBCSPLIT_EXTERN /* extern */ +#define LIBCSPLIT_EXTERN /* extern */ +#define LIBCSPLIT_EXTERN_VARIABLE extern #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ diff -Nru libbde-20190102/libcsplit/libcsplit_libcerror.h libbde-20240223/libcsplit/libcsplit_libcerror.h --- libbde-20190102/libcsplit/libcsplit_libcerror.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_libcerror.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* - * The internal libcerror header + * The libcerror header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_LIBCERROR_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_narrow_split_string.c libbde-20240223/libcsplit/libcsplit_narrow_split_string.c --- libbde-20190102/libcsplit/libcsplit_narrow_split_string.c 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_narrow_split_string.c 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split narrow string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcsplit/libcsplit_narrow_split_string.h libbde-20240223/libcsplit/libcsplit_narrow_split_string.h --- libbde-20190102/libcsplit/libcsplit_narrow_split_string.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_narrow_split_string.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split narrow string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_INTERNAL_NARROW_SPLIT_STRING_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_narrow_string.c libbde-20240223/libcsplit/libcsplit_narrow_string.c --- libbde-20190102/libcsplit/libcsplit_narrow_string.c 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_narrow_string.c 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Narrow character string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -156,7 +156,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize split string.", + "%s: unable to initialize split string.", function ); goto on_error; diff -Nru libbde-20190102/libcsplit/libcsplit_narrow_string.h libbde-20240223/libcsplit/libcsplit_narrow_string.h --- libbde-20190102/libcsplit/libcsplit_narrow_string.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_narrow_string.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Narrow character string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_NARROW_STRING_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_support.c libbde-20240223/libcsplit/libcsplit_support.c --- libbde-20190102/libcsplit/libcsplit_support.c 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_support.c 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcsplit/libcsplit_support.h libbde-20240223/libcsplit/libcsplit_support.h --- libbde-20190102/libcsplit/libcsplit_support.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_support.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_SUPPORT_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_types.h libbde-20240223/libcsplit/libcsplit_types.h --- libbde-20190102/libcsplit/libcsplit_types.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_types.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_unused.h libbde-20240223/libcsplit/libcsplit_unused.h --- libbde-20190102/libcsplit/libcsplit_unused.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_unused.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCSPLIT_INTERNAL_UNUSED_H ) -#define _LIBCSPLIT_INTERNAL_UNUSED_H +#if !defined( _LIBCSPLIT_UNUSED_H ) +#define _LIBCSPLIT_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCSPLIT_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCSPLIT_UNUSED_H ) */ diff -Nru libbde-20190102/libcsplit/libcsplit_wide_split_string.c libbde-20240223/libcsplit/libcsplit_wide_split_string.c --- libbde-20190102/libcsplit/libcsplit_wide_split_string.c 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_wide_split_string.c 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split wide string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcsplit/libcsplit_wide_split_string.h libbde-20240223/libcsplit/libcsplit_wide_split_string.h --- libbde-20190102/libcsplit/libcsplit_wide_split_string.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_wide_split_string.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split wide string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H ) diff -Nru libbde-20190102/libcsplit/libcsplit_wide_string.c libbde-20240223/libcsplit/libcsplit_wide_string.c --- libbde-20190102/libcsplit/libcsplit_wide_string.c 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_wide_string.c 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Wide character string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -158,7 +158,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize split string.", + "%s: unable to initialize split string.", function ); goto on_error; diff -Nru libbde-20190102/libcsplit/libcsplit_wide_string.h libbde-20240223/libcsplit/libcsplit_wide_string.h --- libbde-20190102/libcsplit/libcsplit_wide_string.h 2019-01-02 15:57:16.000000000 +0000 +++ libbde-20240223/libcsplit/libcsplit_wide_string.h 2024-02-23 03:03:31.000000000 +0000 @@ -1,22 +1,22 @@ /* * Wide character string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCSPLIT_WIDE_STRING_H ) diff -Nru libbde-20190102/libcthreads/Makefile.am libbde-20240223/libcthreads/Makefile.am --- libbde-20190102/libcthreads/Makefile.am 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/Makefile.am 2024-02-23 03:03:33.000000000 +0000 @@ -3,7 +3,7 @@ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @LIBCERROR_CPPFLAGS@ \ - @PTHREAD_CPPFLAGS@ + @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libcthreads.la @@ -30,9 +30,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libcthreads ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcthreads_la_SOURCES) diff -Nru libbde-20190102/libcthreads/Makefile.in libbde-20240223/libcthreads/Makefile.in --- libbde-20190102/libcthreads/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libcthreads/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libcthreads ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -203,6 +203,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -220,8 +221,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -238,6 +237,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -249,8 +254,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -268,7 +275,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -286,7 +292,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -340,8 +345,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -360,6 +363,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -370,8 +374,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -394,26 +398,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -422,7 +406,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -441,6 +424,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -483,9 +467,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -554,8 +535,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -578,11 +557,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -595,7 +571,7 @@ @HAVE_LOCAL_LIBCTHREADS_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ -I$(top_srcdir)/common \ @HAVE_LOCAL_LIBCTHREADS_TRUE@ @LIBCERROR_CPPFLAGS@ \ -@HAVE_LOCAL_LIBCTHREADS_TRUE@ @PTHREAD_CPPFLAGS@ +@HAVE_LOCAL_LIBCTHREADS_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBCTHREADS_TRUE@noinst_LTLIBRARIES = libcthreads.la @HAVE_LOCAL_LIBCTHREADS_TRUE@libcthreads_la_SOURCES = \ @@ -717,6 +693,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -769,7 +747,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -914,6 +891,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -930,15 +915,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libcthreads ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libcthreads_la_SOURCES) diff -Nru libbde-20190102/libcthreads/libcthreads_condition.c libbde-20240223/libcthreads/libcthreads_condition.c --- libbde-20190102/libcthreads/libcthreads_condition.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_condition.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Condition functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif @@ -162,7 +162,7 @@ #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_cond_init( - &( internal_condition->condition ), + &( internal_condition->condition ), NULL ); switch( pthread_result ) @@ -559,11 +559,12 @@ #if defined( WINAPI ) DWORD error_code = 0; - DWORD wait_status = 0; #if ( WINVER >= 0x0600 ) BOOL result = 0; -#else + +#elif ( WINVER >= 0x0400 ) + DWORD wait_status = 0; int is_last_waiting_thread = 0; #endif @@ -603,7 +604,7 @@ &( internal_mutex->critical_section ), INFINITE ); - if( wait_status == WAIT_FAILED ) + if( result == 0 ) { error_code = GetLastError(); @@ -686,8 +687,8 @@ else { wait_status = WaitForSingleObject( - internal_mutex->mutex_handle, - INFINITE ); + internal_mutex->mutex_handle, + INFINITE ); if( wait_status == WAIT_FAILED ) { diff -Nru libbde-20190102/libcthreads/libcthreads_condition.h libbde-20240223/libcthreads/libcthreads_condition.h --- libbde-20190102/libcthreads/libcthreads_condition.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_condition.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Condition functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_CONDITION_H ) @@ -25,7 +25,7 @@ #include #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif diff -Nru libbde-20190102/libcthreads/libcthreads_definitions.h libbde-20240223/libcthreads/libcthreads_definitions.h --- libbde-20190102/libcthreads/libcthreads_definitions.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_definitions.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBCTHREADS_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ */ #else -#define LIBCTHREADS_VERSION 20180724 +#define LIBCTHREADS_VERSION 20240102 /* The libcthreads version string */ -#define LIBCTHREADS_VERSION_STRING "20180724" +#define LIBCTHREADS_VERSION_STRING "20240102" /* The comparison function definitions */ diff -Nru libbde-20190102/libcthreads/libcthreads_error.c libbde-20240223/libcthreads/libcthreads_error.c --- libbde-20190102/libcthreads/libcthreads_error.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_error.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcthreads/libcthreads_error.h libbde-20240223/libcthreads/libcthreads_error.h --- libbde-20190102/libcthreads/libcthreads_error.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_error.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_extern.h libbde-20240223/libcthreads/libcthreads_extern.h --- libbde-20190102/libcthreads/libcthreads_extern.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_extern.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_EXTERN_H ) @@ -28,16 +28,13 @@ */ #if !defined( HAVE_LOCAL_LIBCTHREADS ) -/* If libtool DLL support is enabled set LIBCTHREADS_DLL_EXPORT - * before including libcthreads/extern.h - */ -#if defined( _WIN32 ) && defined( DLL_EXPORT ) -#define LIBCTHREADS_DLL_EXPORT -#endif - #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBCTHREADS_EXTERN_VARIABLE extern +#else #define LIBCTHREADS_EXTERN_VARIABLE LIBCTHREADS_EXTERN +#endif #else #define LIBCTHREADS_EXTERN /* extern */ diff -Nru libbde-20190102/libcthreads/libcthreads_libcerror.h libbde-20240223/libcthreads/libcthreads_libcerror.h --- libbde-20190102/libcthreads/libcthreads_libcerror.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_libcerror.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_LIBCERROR_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_lock.c libbde-20240223/libcthreads/libcthreads_lock.c --- libbde-20190102/libcthreads/libcthreads_lock.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_lock.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Lock functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -357,7 +357,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to lock mutex with error: Maximum number of locks exceeded.", + "%s: unable to unlock mutex with error: Maximum number of locks exceeded.", function ); return( -1 ); diff -Nru libbde-20190102/libcthreads/libcthreads_lock.h libbde-20240223/libcthreads/libcthreads_lock.h --- libbde-20190102/libcthreads/libcthreads_lock.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_lock.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Lock functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_LOCK_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_mutex.c libbde-20240223/libcthreads/libcthreads_mutex.c --- libbde-20190102/libcthreads/libcthreads_mutex.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_mutex.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mutex functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif @@ -140,17 +140,31 @@ &( internal_mutex->mutex ), NULL ); - if( pthread_result != 0 ) + switch( pthread_result ) { - libcerror_system_set_error( - error, - pthread_result, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize mutex.", - function ); + case 0: + break; - goto on_error; + case EAGAIN: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to initialize mutex with error: Insufficient resources.", + function ); + + goto on_error; + + default: + libcerror_system_set_error( + error, + pthread_result, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to initialize mutex.", + function ); + + goto on_error; } #endif *mutex = (libcthreads_mutex_t *) internal_mutex; @@ -225,32 +239,44 @@ pthread_result = pthread_mutex_destroy( &( internal_mutex->mutex ) ); - if( pthread_result != 0 ) + switch( pthread_result ) { - switch( pthread_result ) - { - case EBUSY: - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to destroy mutex with error: Resource busy.", - function ); - - break; - - default: - libcerror_system_set_error( - error, - pthread_result, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to destroy mutex.", - function ); + case 0: + break; - break; - } - result = -1; + case EAGAIN: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to destroy mutex with error: Insufficient resources.", + function ); + + result = -1; + break; + + case EBUSY: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to destroy mutex with error: Resource busy.", + function ); + + result = -1; + break; + + default: + libcerror_system_set_error( + error, + pthread_result, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to destroy mutex.", + function ); + + result = -1; + break; } #endif memory_free( @@ -318,17 +344,41 @@ pthread_result = pthread_mutex_lock( &( internal_mutex->mutex ) ); - if( pthread_result != 0 ) + switch( pthread_result ) { - libcerror_system_set_error( - error, - pthread_result, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to lock mutex.", - function ); + case 0: + break; - return( -1 ); + case EAGAIN: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to lock mutex with error: Maximum number of locks exceeded.", + function ); + + return( -1 ); + + case EDEADLK: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to lock mutex with error: Deadlock condition detected.", + function ); + + return( -1 ); + + default: + libcerror_system_set_error( + error, + pthread_result, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to lock mutex.", + function ); + + return( -1 ); } #endif return( 1 ); @@ -405,21 +455,45 @@ pthread_result = pthread_mutex_trylock( &( internal_mutex->mutex ) ); - if( pthread_result == EBUSY ) - { - result = 0; - } - else if( pthread_result != 0 ) + switch( pthread_result ) { - libcerror_system_set_error( - error, - pthread_result, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to lock mutex.", - function ); + case 0: + break; - return( -1 ); + case EBUSY: + result = 0; + break; + + case EAGAIN: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to try lock mutex with error: Maximum number of locks exceeded.", + function ); + + return( -1 ); + + case EDEADLK: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to try lock mutex with error: Deadlock condition detected.", + function ); + + return( -1 ); + + default: + libcerror_system_set_error( + error, + pthread_result, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to try lock mutex.", + function ); + + return( -1 ); } #endif return( result ); @@ -483,17 +557,41 @@ pthread_result = pthread_mutex_unlock( &( internal_mutex->mutex ) ); - if( pthread_result != 0 ) + switch( pthread_result ) { - libcerror_system_set_error( - error, - pthread_result, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to unlock mutex.", - function ); + case 0: + break; - return( -1 ); + case EAGAIN: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to unlock mutex with error: Maximum number of locks exceeded.", + function ); + + return( -1 ); + + case EDEADLK: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to unlock mutex with error: Deadlock condition detected.", + function ); + + return( -1 ); + + default: + libcerror_system_set_error( + error, + pthread_result, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to unlock mutex.", + function ); + + return( -1 ); } #endif return( 1 ); diff -Nru libbde-20190102/libcthreads/libcthreads_mutex.h libbde-20240223/libcthreads/libcthreads_mutex.h --- libbde-20190102/libcthreads/libcthreads_mutex.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_mutex.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Mutex functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_MUTEX_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_queue.c libbde-20240223/libcthreads/libcthreads_queue.c --- libbde-20190102/libcthreads/libcthreads_queue.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_queue.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Queue functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -1026,9 +1026,9 @@ value_index++ ) { compare_result = value_compare_function( - value, - internal_queue->values_array[ pop_index ], - error ); + value, + internal_queue->values_array[ pop_index ], + error ); if( compare_result == -1 ) { diff -Nru libbde-20190102/libcthreads/libcthreads_queue.h libbde-20240223/libcthreads/libcthreads_queue.h --- libbde-20190102/libcthreads/libcthreads_queue.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_queue.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Queue functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_QUEUE_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_read_write_lock.c libbde-20240223/libcthreads/libcthreads_read_write_lock.c --- libbde-20190102/libcthreads/libcthreads_read_write_lock.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_read_write_lock.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Read/Write lock functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif @@ -121,7 +121,7 @@ InitializeCriticalSection( &( internal_read_write_lock->read_critical_section ) ); - internal_read_write_lock->no_read_event_handle = CreateEvent( + internal_read_write_lock->no_read_event_handle = CreateEvent( NULL, TRUE, TRUE, @@ -147,7 +147,7 @@ #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_init( - &( internal_read_write_lock->read_write_lock ), + &( internal_read_write_lock->read_write_lock ), NULL ); switch( pthread_result ) diff -Nru libbde-20190102/libcthreads/libcthreads_read_write_lock.h libbde-20240223/libcthreads/libcthreads_read_write_lock.h --- libbde-20190102/libcthreads/libcthreads_read_write_lock.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_read_write_lock.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Read/Write lock functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_READ_WRITE_LOCK_H ) @@ -25,7 +25,7 @@ #include #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif diff -Nru libbde-20190102/libcthreads/libcthreads_repeating_thread.c libbde-20240223/libcthreads/libcthreads_repeating_thread.c --- libbde-20190102/libcthreads/libcthreads_repeating_thread.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_repeating_thread.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Repeating thread functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #include #endif @@ -123,7 +123,7 @@ internal_repeating_thread = (libcthreads_internal_repeating_thread_t *) arguments; if( ( internal_repeating_thread != NULL ) - && ( internal_repeating_thread->start_function != NULL ) ) + && ( internal_repeating_thread->start_function != NULL ) ) { internal_repeating_thread->start_function_result = 1; @@ -319,7 +319,7 @@ attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->attributes ); } pthread_result = pthread_create( - &( internal_repeating_thread->thread ), + &( internal_repeating_thread->thread ), attributes, &libcthreads_repeating_thread_start_function_helper, (void *) internal_repeating_thread ); diff -Nru libbde-20190102/libcthreads/libcthreads_repeating_thread.h libbde-20240223/libcthreads/libcthreads_repeating_thread.h --- libbde-20190102/libcthreads/libcthreads_repeating_thread.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_repeating_thread.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Repeating thread functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_REPEATING_THREAD_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_support.c libbde-20240223/libcthreads/libcthreads_support.c --- libbde-20190102/libcthreads/libcthreads_support.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_support.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcthreads/libcthreads_support.h libbde-20240223/libcthreads/libcthreads_support.h --- libbde-20190102/libcthreads/libcthreads_support.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_support.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_SUPPORT_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_thread.c libbde-20240223/libcthreads/libcthreads_thread.c --- libbde-20190102/libcthreads/libcthreads_thread.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_thread.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Thread functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #include #endif @@ -86,7 +86,7 @@ internal_thread = (libcthreads_internal_thread_t *) arguments; if( ( internal_thread != NULL ) - && ( internal_thread->callback_function != NULL ) ) + && ( internal_thread->callback_function != NULL ) ) { result = (int *) memory_allocate( sizeof( int ) ); @@ -233,7 +233,7 @@ attributes = &( ( (libcthreads_internal_thread_attributes_t *) thread_attributes )->attributes ); } pthread_result = pthread_create( - &( internal_thread->thread ), + &( internal_thread->thread ), attributes, &libcthreads_thread_callback_function_helper, (void *) internal_thread ); diff -Nru libbde-20190102/libcthreads/libcthreads_thread.h libbde-20240223/libcthreads/libcthreads_thread.h --- libbde-20190102/libcthreads/libcthreads_thread.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_thread.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Thread functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_THREAD_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_thread_attributes.c libbde-20240223/libcthreads/libcthreads_thread_attributes.c --- libbde-20190102/libcthreads/libcthreads_thread_attributes.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_thread_attributes.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Thread attributes functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libcthreads/libcthreads_thread_attributes.h libbde-20240223/libcthreads/libcthreads_thread_attributes.h --- libbde-20190102/libcthreads/libcthreads_thread_attributes.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_thread_attributes.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Thread attributes functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_THREAD_ATTRIBUTES_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_thread_pool.c libbde-20240223/libcthreads/libcthreads_thread_pool.c --- libbde-20190102/libcthreads/libcthreads_thread_pool.c 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_thread_pool.c 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Thread pool functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -25,7 +25,7 @@ #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif @@ -70,9 +70,9 @@ return; } pop_result = libcthreads_internal_thread_pool_pop( - internal_thread_pool, - &value, - &error ); + internal_thread_pool, + &value, + &error ); if( pop_result == -1 ) { @@ -133,9 +133,9 @@ do { pop_result = libcthreads_internal_thread_pool_pop( - internal_thread_pool, - &value, - &error ); + internal_thread_pool, + &value, + &error ); if( pop_result == -1 ) { @@ -144,8 +144,8 @@ else if( pop_result != 0 ) { callback_function_result = internal_thread_pool->callback_function( - value, - internal_thread_pool->callback_function_arguments ); + value, + internal_thread_pool->callback_function_arguments ); if( ( callback_function_result != 1 ) && ( result == 1 ) ) @@ -224,8 +224,8 @@ else if( pop_result != 0 ) { callback_function_result = internal_thread_pool->callback_function( - value, - internal_thread_pool->callback_function_arguments ); + value, + internal_thread_pool->callback_function_arguments ); if( ( callback_function_result != 1 ) && ( *result == 1 ) ) @@ -769,10 +769,10 @@ thread_index++ ) { pthread_result = pthread_create( - &( internal_thread_pool->threads_array[ thread_index ] ), - attributes, - &libcthreads_thread_pool_callback_function_helper, - (void *) internal_thread_pool ); + &( internal_thread_pool->threads_array[ thread_index ] ), + attributes, + &libcthreads_thread_pool_callback_function_helper, + (void *) internal_thread_pool ); switch( pthread_result ) { @@ -1298,9 +1298,9 @@ value_index++ ) { compare_result = value_compare_function( - value, - internal_thread_pool->values_array[ pop_index ], - error ); + value, + internal_thread_pool->values_array[ pop_index ], + error ); if( compare_result == -1 ) { @@ -1579,8 +1579,8 @@ thread_index++ ) { wait_status = WaitForSingleObject( - internal_thread_pool->thread_handles_array[ thread_index ], - INFINITE ); + internal_thread_pool->thread_handles_array[ thread_index ], + INFINITE ); if( wait_status == WAIT_FAILED ) { diff -Nru libbde-20190102/libcthreads/libcthreads_thread_pool.h libbde-20240223/libcthreads/libcthreads_thread_pool.h --- libbde-20190102/libcthreads/libcthreads_thread_pool.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_thread_pool.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * Thread pool functions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_THREAD_POOL_H ) @@ -25,7 +25,7 @@ #include #include -#if defined( WINAPI ) && ( WINVER >= 0x0602 ) +#if defined( _MSC_VER ) && defined( WINAPI ) && ( WINVER >= 0x0602 ) #include #endif diff -Nru libbde-20190102/libcthreads/libcthreads_types.h libbde-20240223/libcthreads/libcthreads_types.h --- libbde-20190102/libcthreads/libcthreads_types.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_types.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBCTHREADS_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libcthreads/libcthreads_unused.h libbde-20240223/libcthreads/libcthreads_unused.h --- libbde-20190102/libcthreads/libcthreads_unused.h 2019-01-02 15:57:18.000000000 +0000 +++ libbde-20240223/libcthreads/libcthreads_unused.h 2024-02-23 03:03:33.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2012-2018, Joachim Metz + * Copyright (C) 2012-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBCTHREADS_INTERNAL_UNUSED_H ) -#define _LIBCTHREADS_INTERNAL_UNUSED_H +#if !defined( _LIBCTHREADS_UNUSED_H ) +#define _LIBCTHREADS_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBCTHREADS_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBCTHREADS_UNUSED_H ) */ diff -Nru libbde-20190102/libfcache/Makefile.am libbde-20240223/libfcache/Makefile.am --- libbde-20190102/libfcache/Makefile.am 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/Makefile.am 2024-02-23 03:03:34.000000000 +0000 @@ -27,9 +27,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libfcache ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfcache_la_SOURCES) diff -Nru libbde-20190102/libfcache/Makefile.in libbde-20240223/libfcache/Makefile.in --- libbde-20190102/libfcache/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libfcache/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libfcache ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -185,6 +185,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -202,8 +203,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -220,6 +219,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -231,8 +236,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -250,7 +257,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -268,7 +274,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -322,8 +327,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -342,6 +345,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -352,8 +356,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -376,26 +380,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -404,7 +388,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -423,6 +406,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -465,9 +449,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -536,8 +517,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -560,11 +539,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -690,6 +666,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -742,7 +720,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -881,6 +858,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -897,15 +882,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libfcache ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfcache_la_SOURCES) diff -Nru libbde-20190102/libfcache/libfcache_cache.c libbde-20240223/libfcache/libfcache_cache.c --- libbde-20190102/libfcache/libfcache_cache.c 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_cache.c 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The cache functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -463,6 +463,63 @@ function ); return( -1 ); + } + return( 1 ); +} + +/* Clears the cache value for the specific index + * Returns 1 if successful or -1 on error + */ +int libfcache_cache_clear_value_by_index( + libfcache_cache_t *cache, + int cache_entry_index, + libcerror_error_t **error ) +{ + libfcache_cache_value_t *cache_value = NULL; + libfcache_internal_cache_t *internal_cache = NULL; + static char *function = "libfcache_cache_clear_value_by_index"; + + if( cache == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid cache.", + function ); + + return( -1 ); + } + internal_cache = (libfcache_internal_cache_t *) cache; + + if( libcdata_array_get_entry_by_index( + internal_cache->entries_array, + cache_entry_index, + (intptr_t **) &cache_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to retrieve cache value: %d from entries array.", + function, + cache_entry_index ); + + return( -1 ); + } + if( libfcache_cache_value_clear( + cache_value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to clear cache value.", + function ); + + return( -1 ); } return( 1 ); } diff -Nru libbde-20190102/libfcache/libfcache_cache.h libbde-20240223/libfcache/libfcache_cache.h --- libbde-20190102/libfcache/libfcache_cache.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_cache.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The cache functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_CACHE_H ) @@ -93,6 +93,12 @@ libcerror_error_t **error ); LIBFCACHE_EXTERN \ +int libfcache_cache_clear_value_by_index( + libfcache_cache_t *cache, + int cache_entry_index, + libcerror_error_t **error ); + +LIBFCACHE_EXTERN \ int libfcache_cache_get_value_by_identifier( libfcache_cache_t *cache, int file_index, diff -Nru libbde-20190102/libfcache/libfcache_cache_value.c libbde-20240223/libfcache/libfcache_cache_value.c --- libbde-20190102/libfcache/libfcache_cache_value.c 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_cache_value.c 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Cache value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -448,16 +448,19 @@ } internal_cache_value = (libfcache_internal_cache_value_t *) cache_value; - if( value_free_function == NULL ) + if( ( flags & LIBFCACHE_CACHE_VALUE_FLAG_MANAGED ) != 0 ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid value free function.", - function ); + if( value_free_function == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value free function.", + function ); - return( -1 ); + return( -1 ); + } } if( ( internal_cache_value->flags & LIBFCACHE_CACHE_VALUE_FLAG_MANAGED ) != 0 ) { diff -Nru libbde-20190102/libfcache/libfcache_cache_value.h libbde-20240223/libfcache/libfcache_cache_value.h --- libbde-20190102/libfcache/libfcache_cache_value.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_cache_value.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Cache value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_CACHE_VALUE_H ) diff -Nru libbde-20190102/libfcache/libfcache_date_time.c libbde-20240223/libfcache/libfcache_date_time.c --- libbde-20190102/libfcache/libfcache_date_time.c 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_date_time.c 2024-02-23 03:03:34.000000000 +0000 @@ -1,35 +1,32 @@ /* * Date and time functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include -#if defined( TIME_WITH_SYS_TIME ) +#if defined( HAVE_SYS_TIME_H ) #include -#include -#elif defined( HAVE_SYS_TIME_H ) -#include -#else -#include #endif +#include + #include "libfcache_date_time.h" #include "libfcache_libcerror.h" #include "libfcache_types.h" diff -Nru libbde-20190102/libfcache/libfcache_date_time.h libbde-20240223/libfcache/libfcache_date_time.h --- libbde-20190102/libfcache/libfcache_date_time.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_date_time.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Date and time functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_DATE_TIME_H ) diff -Nru libbde-20190102/libfcache/libfcache_definitions.h libbde-20240223/libfcache/libfcache_definitions.h --- libbde-20190102/libfcache/libfcache_definitions.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_definitions.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_INTERNAL_DEFINITIONS_H ) @@ -33,11 +33,11 @@ * for local use of libfcache */ #else -#define LIBFCACHE_VERSION 20181011 +#define LIBFCACHE_VERSION 20240112 /* The libfcache version string */ -#define LIBFCACHE_VERSION_STRING "20181011" +#define LIBFCACHE_VERSION_STRING "20240112" /* The cache value flags definitions */ @@ -52,7 +52,7 @@ LIBFCACHE_CACHE_VALUE_FLAG_MANAGED = 0x01 }; -#endif +#endif /* !defined( HAVE_LOCAL_LIBFCACHE ) */ -#endif +#endif /* !defined( _LIBFCACHE_INTERNAL_DEFINITIONS_H ) */ diff -Nru libbde-20190102/libfcache/libfcache_error.c libbde-20240223/libfcache/libfcache_error.c --- libbde-20190102/libfcache/libfcache_error.c 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_error.c 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfcache/libfcache_error.h libbde-20240223/libfcache/libfcache_error.h --- libbde-20190102/libfcache/libfcache_error.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_error.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libfcache/libfcache_extern.h libbde-20240223/libfcache/libfcache_extern.h --- libbde-20190102/libfcache/libfcache_extern.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_extern.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBFCACHE_EXTERN_VARIABLE extern +#else #define LIBFCACHE_EXTERN_VARIABLE LIBFCACHE_EXTERN +#endif #else #define LIBFCACHE_EXTERN /* extern */ diff -Nru libbde-20190102/libfcache/libfcache_libcdata.h libbde-20240223/libfcache/libfcache_libcdata.h --- libbde-20190102/libfcache/libfcache_libcdata.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_libcdata.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcdata header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_LIBCDATA_H ) diff -Nru libbde-20190102/libfcache/libfcache_libcerror.h libbde-20240223/libfcache/libfcache_libcerror.h --- libbde-20190102/libfcache/libfcache_libcerror.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_libcerror.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_LIBCERROR_H ) diff -Nru libbde-20190102/libfcache/libfcache_support.c libbde-20240223/libfcache/libfcache_support.c --- libbde-20190102/libfcache/libfcache_support.c 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_support.c 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfcache/libfcache_support.h libbde-20240223/libfcache/libfcache_support.h --- libbde-20190102/libfcache/libfcache_support.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_support.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_SUPPORT_H ) diff -Nru libbde-20190102/libfcache/libfcache_types.h libbde-20240223/libfcache/libfcache_types.h --- libbde-20190102/libfcache/libfcache_types.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_types.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFCACHE_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libfcache/libfcache_unused.h libbde-20240223/libfcache/libfcache_unused.h --- libbde-20190102/libfcache/libfcache_unused.h 2019-01-02 15:57:20.000000000 +0000 +++ libbde-20240223/libfcache/libfcache_unused.h 2024-02-23 03:03:34.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBFCACHE_INTERNAL_UNUSED_H ) -#define _LIBFCACHE_INTERNAL_UNUSED_H +#if !defined( _LIBFCACHE_UNUSED_H ) +#define _LIBFCACHE_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBFCACHE_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBFCACHE_UNUSED_H ) */ diff -Nru libbde-20190102/libfdata/Makefile.am libbde-20240223/libfdata/Makefile.am --- libbde-20190102/libfdata/Makefile.am 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -if HAVE_LOCAL_LIBFDATA -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ \ - @LIBCTHREADS_CPPFLAGS@ \ - @LIBCDATA_CPPFLAGS@ \ - @LIBCNOTIFY_CPPFLAGS@ \ - @LIBFCACHE_CPPFLAGS@ \ - @PTHREAD_CPPFLAGS@ - -noinst_LTLIBRARIES = libfdata.la - -libfdata_la_SOURCES = \ - libfdata_area.c libfdata_area.h \ - libfdata_btree.c libfdata_btree.h \ - libfdata_btree_node.c libfdata_btree_node.h \ - libfdata_btree_range.c libfdata_btree_range.h \ - libfdata_cache.c libfdata_cache.h \ - libfdata_definitions.h \ - libfdata_error.c libfdata_error.h \ - libfdata_extern.h \ - libfdata_inline.h \ - libfdata_libcdata.h \ - libfdata_libcerror.h \ - libfdata_libcnotify.h \ - libfdata_libfcache.h \ - libfdata_list.c libfdata_list.h \ - libfdata_list_element.c libfdata_list_element.h \ - libfdata_mapped_range.c libfdata_mapped_range.h \ - libfdata_notify.c libfdata_notify.h \ - libfdata_range.c libfdata_range.h \ - libfdata_range_list.c libfdata_range_list.h \ - libfdata_segments_array.c libfdata_segments_array.h \ - libfdata_stream.c libfdata_stream.h \ - libfdata_support.c libfdata_support.h \ - libfdata_tree.c libfdata_tree.h \ - libfdata_tree_node.c libfdata_tree_node.h \ - libfdata_types.h \ - libfdata_unused.h \ - libfdata_vector.c libfdata_vector.h -endif - -MAINTAINERCLEANFILES = \ - Makefile.in - -distclean: clean - /bin/rm -f Makefile - -splint: - @echo "Running splint on libfdata ..." - -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdata_la_SOURCES) - diff -Nru libbde-20190102/libfdata/Makefile.in libbde-20240223/libfdata/Makefile.in --- libbde-20190102/libfdata/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libfdata/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,987 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = libfdata -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ - $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ - $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/pthread.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/tests.m4 \ - $(top_srcdir)/m4/types.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/common/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libfdata_la_LIBADD = -am__libfdata_la_SOURCES_DIST = libfdata_area.c libfdata_area.h \ - libfdata_btree.c libfdata_btree.h libfdata_btree_node.c \ - libfdata_btree_node.h libfdata_btree_range.c \ - libfdata_btree_range.h libfdata_cache.c libfdata_cache.h \ - libfdata_definitions.h libfdata_error.c libfdata_error.h \ - libfdata_extern.h libfdata_inline.h libfdata_libcdata.h \ - libfdata_libcerror.h libfdata_libcnotify.h \ - libfdata_libfcache.h libfdata_list.c libfdata_list.h \ - libfdata_list_element.c libfdata_list_element.h \ - libfdata_mapped_range.c libfdata_mapped_range.h \ - libfdata_notify.c libfdata_notify.h libfdata_range.c \ - libfdata_range.h libfdata_range_list.c libfdata_range_list.h \ - libfdata_segments_array.c libfdata_segments_array.h \ - libfdata_stream.c libfdata_stream.h libfdata_support.c \ - libfdata_support.h libfdata_tree.c libfdata_tree.h \ - libfdata_tree_node.c libfdata_tree_node.h libfdata_types.h \ - libfdata_unused.h libfdata_vector.c libfdata_vector.h -@HAVE_LOCAL_LIBFDATA_TRUE@am_libfdata_la_OBJECTS = libfdata_area.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_node.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_range.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_cache.lo libfdata_error.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list_element.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_mapped_range.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_notify.lo libfdata_range.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_range_list.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_segments_array.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_stream.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_support.lo libfdata_tree.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_tree_node.lo \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_vector.lo -libfdata_la_OBJECTS = $(am_libfdata_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -@HAVE_LOCAL_LIBFDATA_TRUE@am_libfdata_la_rpath = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/libfdata_area.Plo \ - ./$(DEPDIR)/libfdata_btree.Plo \ - ./$(DEPDIR)/libfdata_btree_node.Plo \ - ./$(DEPDIR)/libfdata_btree_range.Plo \ - ./$(DEPDIR)/libfdata_cache.Plo ./$(DEPDIR)/libfdata_error.Plo \ - ./$(DEPDIR)/libfdata_list.Plo \ - ./$(DEPDIR)/libfdata_list_element.Plo \ - ./$(DEPDIR)/libfdata_mapped_range.Plo \ - ./$(DEPDIR)/libfdata_notify.Plo ./$(DEPDIR)/libfdata_range.Plo \ - ./$(DEPDIR)/libfdata_range_list.Plo \ - ./$(DEPDIR)/libfdata_segments_array.Plo \ - ./$(DEPDIR)/libfdata_stream.Plo \ - ./$(DEPDIR)/libfdata_support.Plo ./$(DEPDIR)/libfdata_tree.Plo \ - ./$(DEPDIR)/libfdata_tree_node.Plo \ - ./$(DEPDIR)/libfdata_vector.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libfdata_la_SOURCES) -DIST_SOURCES = $(am__libfdata_la_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DPKG_DATE = @DPKG_DATE@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GREP = @GREP@ -HAVE_DLLMAIN = @HAVE_DLLMAIN@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_LIBBFIO = @HAVE_LIBBFIO@ -HAVE_LIBCAES = @HAVE_LIBCAES@ -HAVE_LIBCDATA = @HAVE_LIBCDATA@ -HAVE_LIBCERROR = @HAVE_LIBCERROR@ -HAVE_LIBCFILE = @HAVE_LIBCFILE@ -HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ -HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ -HAVE_LIBCPATH = @HAVE_LIBCPATH@ -HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ -HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ -HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ -HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ -HAVE_LIBFGUID = @HAVE_LIBFGUID@ -HAVE_LIBFUSE = @HAVE_LIBFUSE@ -HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ -HAVE_LIBHMAC = @HAVE_LIBHMAC@ -HAVE_LIBUNA = @HAVE_LIBUNA@ -HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ -HAVE_LOCAL_LIBCAES = @HAVE_LOCAL_LIBCAES@ -HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ -HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ -HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ -HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ -HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ -HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ -HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ -HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ -HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ -HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ -HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ -HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ -HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ -HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ -HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ -HAVE_OFF64_T = @HAVE_OFF64_T@ -HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ -HAVE_PTHREAD = @HAVE_PTHREAD@ -HAVE_SIZE32_T = @HAVE_SIZE32_T@ -HAVE_SIZE64_T = @HAVE_SIZE64_T@ -HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ -HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBBDE_DLL_EXPORT = @LIBBDE_DLL_EXPORT@ -LIBBDE_DLL_IMPORT = @LIBBDE_DLL_IMPORT@ -LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ -LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ -LIBCAES_CPPFLAGS = @LIBCAES_CPPFLAGS@ -LIBCAES_LIBADD = @LIBCAES_LIBADD@ -LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ -LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ -LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ -LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ -LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ -LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ -LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ -LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ -LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ -LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ -LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ -LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ -LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ -LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ -LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ -LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ -LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ -LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ -LIBDL_LIBADD = @LIBDL_LIBADD@ -LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ -LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ -LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ -LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ -LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ -LIBFGUID_LIBADD = @LIBFGUID_LIBADD@ -LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ -LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ -LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ -LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ -LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ -LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ -LIBUNA_LIBADD = @LIBUNA_LIBADD@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGCONFIG = @PKGCONFIG@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -POSUB = @POSUB@ -PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ -PTHREAD_LIBADD = @PTHREAD_LIBADD@ -PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ -PYTHON_CONFIG = @PYTHON_CONFIG@ -PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ -PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ -PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SPEC_DATE = @SPEC_DATE@ -STATIC_LDFLAGS = @STATIC_LDFLAGS@ -STRIP = @STRIP@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ -ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ -ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ -ax_libcaes_pc_libs_private = @ax_libcaes_pc_libs_private@ -ax_libcaes_spec_build_requires = @ax_libcaes_spec_build_requires@ -ax_libcaes_spec_requires = @ax_libcaes_spec_requires@ -ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ -ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ -ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ -ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ -ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ -ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ -ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ -ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ -ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ -ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ -ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ -ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ -ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ -ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ -ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ -ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ -ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ -ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ -ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ -ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ -ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ -ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ -ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ -ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ -ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ -ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ -ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ -ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ -ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ -ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ -ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ -ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ -ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ -ax_libfguid_pc_libs_private = @ax_libfguid_pc_libs_private@ -ax_libfguid_spec_build_requires = @ax_libfguid_spec_build_requires@ -ax_libfguid_spec_requires = @ax_libfguid_spec_requires@ -ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ -ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ -ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ -ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ -ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ -ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ -ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ -ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ -ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ -ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ -ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ -ax_libuna_spec_requires = @ax_libuna_spec_requires@ -ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -fuse_CFLAGS = @fuse_CFLAGS@ -fuse_LIBS = @fuse_LIBS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libbde_spec_requires = @libbde_spec_requires@ -libbde_spec_tools_build_requires = @libbde_spec_tools_build_requires@ -libbfio_CFLAGS = @libbfio_CFLAGS@ -libbfio_LIBS = @libbfio_LIBS@ -libcaes_CFLAGS = @libcaes_CFLAGS@ -libcaes_LIBS = @libcaes_LIBS@ -libcdata_CFLAGS = @libcdata_CFLAGS@ -libcdata_LIBS = @libcdata_LIBS@ -libcerror_CFLAGS = @libcerror_CFLAGS@ -libcerror_LIBS = @libcerror_LIBS@ -libcfile_CFLAGS = @libcfile_CFLAGS@ -libcfile_LIBS = @libcfile_LIBS@ -libclocale_CFLAGS = @libclocale_CFLAGS@ -libclocale_LIBS = @libclocale_LIBS@ -libcnotify_CFLAGS = @libcnotify_CFLAGS@ -libcnotify_LIBS = @libcnotify_LIBS@ -libcpath_CFLAGS = @libcpath_CFLAGS@ -libcpath_LIBS = @libcpath_LIBS@ -libcsplit_CFLAGS = @libcsplit_CFLAGS@ -libcsplit_LIBS = @libcsplit_LIBS@ -libcthreads_CFLAGS = @libcthreads_CFLAGS@ -libcthreads_LIBS = @libcthreads_LIBS@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libfcache_CFLAGS = @libfcache_CFLAGS@ -libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ -libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ -libfdatetime_LIBS = @libfdatetime_LIBS@ -libfguid_CFLAGS = @libfguid_CFLAGS@ -libfguid_LIBS = @libfguid_LIBS@ -libfvalue_CFLAGS = @libfvalue_CFLAGS@ -libfvalue_LIBS = @libfvalue_LIBS@ -libhmac_CFLAGS = @libhmac_CFLAGS@ -libhmac_LIBS = @libhmac_LIBS@ -libuna_CFLAGS = @libuna_CFLAGS@ -libuna_LIBS = @libuna_LIBS@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -openssl_CFLAGS = @openssl_CFLAGS@ -openssl_LIBS = @openssl_LIBS@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ -pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -@HAVE_LOCAL_LIBFDATA_TRUE@AM_CPPFLAGS = \ -@HAVE_LOCAL_LIBFDATA_TRUE@ -I$(top_srcdir)/include \ -@HAVE_LOCAL_LIBFDATA_TRUE@ -I$(top_srcdir)/common \ -@HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCERROR_CPPFLAGS@ \ -@HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCTHREADS_CPPFLAGS@ \ -@HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCDATA_CPPFLAGS@ \ -@HAVE_LOCAL_LIBFDATA_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ -@HAVE_LOCAL_LIBFDATA_TRUE@ @LIBFCACHE_CPPFLAGS@ \ -@HAVE_LOCAL_LIBFDATA_TRUE@ @PTHREAD_CPPFLAGS@ - -@HAVE_LOCAL_LIBFDATA_TRUE@noinst_LTLIBRARIES = libfdata.la -@HAVE_LOCAL_LIBFDATA_TRUE@libfdata_la_SOURCES = \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_area.c libfdata_area.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree.c libfdata_btree.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_node.c libfdata_btree_node.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_btree_range.c libfdata_btree_range.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_cache.c libfdata_cache.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_definitions.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_error.c libfdata_error.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_extern.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_inline.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libcdata.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libcerror.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libcnotify.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_libfcache.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list.c libfdata_list.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_list_element.c libfdata_list_element.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_mapped_range.c libfdata_mapped_range.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_notify.c libfdata_notify.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_range.c libfdata_range.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_range_list.c libfdata_range_list.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_segments_array.c libfdata_segments_array.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_stream.c libfdata_stream.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_support.c libfdata_support.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_tree.c libfdata_tree.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_tree_node.c libfdata_tree_node.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_types.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_unused.h \ -@HAVE_LOCAL_LIBFDATA_TRUE@ libfdata_vector.c libfdata_vector.h - -MAINTAINERCLEANFILES = \ - Makefile.in - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libfdata/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu libfdata/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libfdata.la: $(libfdata_la_OBJECTS) $(libfdata_la_DEPENDENCIES) $(EXTRA_libfdata_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libfdata_la_rpath) $(libfdata_la_OBJECTS) $(libfdata_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_area.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_btree.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_btree_node.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_btree_range.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_cache.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_error.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_list.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_list_element.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_mapped_range.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_notify.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_range.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_range_list.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_segments_array.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_stream.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_support.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_tree.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_tree_node.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfdata_vector.Plo@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/libfdata_area.Plo - -rm -f ./$(DEPDIR)/libfdata_btree.Plo - -rm -f ./$(DEPDIR)/libfdata_btree_node.Plo - -rm -f ./$(DEPDIR)/libfdata_btree_range.Plo - -rm -f ./$(DEPDIR)/libfdata_cache.Plo - -rm -f ./$(DEPDIR)/libfdata_error.Plo - -rm -f ./$(DEPDIR)/libfdata_list.Plo - -rm -f ./$(DEPDIR)/libfdata_list_element.Plo - -rm -f ./$(DEPDIR)/libfdata_mapped_range.Plo - -rm -f ./$(DEPDIR)/libfdata_notify.Plo - -rm -f ./$(DEPDIR)/libfdata_range.Plo - -rm -f ./$(DEPDIR)/libfdata_range_list.Plo - -rm -f ./$(DEPDIR)/libfdata_segments_array.Plo - -rm -f ./$(DEPDIR)/libfdata_stream.Plo - -rm -f ./$(DEPDIR)/libfdata_support.Plo - -rm -f ./$(DEPDIR)/libfdata_tree.Plo - -rm -f ./$(DEPDIR)/libfdata_tree_node.Plo - -rm -f ./$(DEPDIR)/libfdata_vector.Plo - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libtool clean-noinstLTLIBRARIES \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -distclean: clean - /bin/rm -f Makefile - -splint: - @echo "Running splint on libfdata ..." - -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdata_la_SOURCES) - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru libbde-20190102/libfdata/libfdata_area.c libbde-20240223/libfdata/libfdata_area.c --- libbde-20190102/libfdata/libfdata_area.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_area.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1482 +0,0 @@ -/* - * The area functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_area.h" -#include "libfdata_definitions.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_mapped_range.h" -#include "libfdata_range.h" -#include "libfdata_segments_array.h" -#include "libfdata_types.h" -#include "libfdata_unused.h" - -/* Creates an area - * Make sure the value area is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the area - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_area_initialize( - libfdata_area_t **area, - size64_t element_data_size, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_area_t *area, - libfdata_cache_t *cache, - off64_t element_value_offset, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_area_t *area, - libfdata_cache_t *cache, - off64_t element_value_offset, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_initialize"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - if( *area != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid area value already set.", - function ); - - return( -1 ); - } - if( element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, - "%s: invalid element data size value zero or less.", - function ); - - return( -1 ); - } - internal_area = memory_allocate_structure( - libfdata_internal_area_t ); - - if( internal_area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create area.", - function ); - - goto on_error; - } - if( memory_set( - internal_area, - 0, - sizeof( libfdata_internal_area_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear area.", - function ); - - memory_free( - internal_area ); - - return( -1 ); - } - if( libcdata_array_initialize( - &( internal_area->segments_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segments array.", - function ); - - goto on_error; - } - if( libcdata_array_initialize( - &( internal_area->mapped_ranges_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped ranges array.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_area->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - goto on_error; - } - internal_area->element_data_size = element_data_size; - internal_area->flags |= flags; - internal_area->data_handle = data_handle; - internal_area->free_data_handle = free_data_handle; - internal_area->clone_data_handle = clone_data_handle; - internal_area->read_element_data = read_element_data; - internal_area->write_element_data = write_element_data; - - *area = (libfdata_area_t *) internal_area; - - return( 1 ); - -on_error: - if( internal_area != NULL ) - { - if( internal_area->segments_array != NULL ) - { - libcdata_array_free( - &( internal_area->segments_array ), - NULL, - NULL ); - } - memory_free( - internal_area ); - } - return( -1 ); -} - -/* Frees an area - * Returns 1 if successful or -1 on error - */ -int libfdata_area_free( - libfdata_area_t **area, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_free"; - int result = 1; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - if( *area != NULL ) - { - internal_area = (libfdata_internal_area_t *) *area; - *area = NULL; - - if( libcdata_array_free( - &( internal_area->segments_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free segments array.", - function ); - - result = -1; - } - if( libcdata_array_free( - &( internal_area->mapped_ranges_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free mapped ranges array.", - function ); - - result = -1; - } - if( ( internal_area->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_area->data_handle != NULL ) - { - if( internal_area->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid area - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_area->free_data_handle( - &( internal_area->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_area ); - } - return( result ); -} - -/* Clones (duplicates) the area - * Returns 1 if successful or -1 on error - */ -int libfdata_area_clone( - libfdata_area_t **destination_area, - libfdata_area_t *source_area, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_destination_area = NULL; - libfdata_internal_area_t *internal_source_area = NULL; - static char *function = "libfdata_area_clone"; - - if( destination_area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination area.", - function ); - - return( -1 ); - } - if( *destination_area != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination area value already set.", - function ); - - return( -1 ); - } - if( source_area == NULL ) - { - *destination_area = source_area; - - return( 1 ); - } - internal_source_area = (libfdata_internal_area_t *) source_area; - -/* TODO refactor to use libfdata_area_initialize this requires libcdata_array_copy_elements function */ - internal_destination_area = memory_allocate_structure( - libfdata_internal_area_t ); - - if( internal_destination_area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination area.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_area, - 0, - sizeof( libfdata_internal_area_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination area.", - function ); - - memory_free( - internal_destination_area ); - - return( -1 ); - } - if( internal_source_area->data_handle != NULL ) - { - if( internal_source_area->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source area - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_area->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source area - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_area->clone_data_handle( - &( internal_destination_area->data_handle ), - internal_source_area->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination data handle.", - function ); - - goto on_error; - } - } - if( libcdata_array_clone( - &( internal_destination_area->segments_array ), - internal_source_area->segments_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination segments array.", - function ); - - goto on_error; - } - if( libcdata_array_clone( - &( internal_destination_area->mapped_ranges_array ), - internal_source_area->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination mapped ranges array.", - function ); - - goto on_error; - } - internal_destination_area->element_data_size = internal_source_area->element_data_size; - internal_destination_area->timestamp = internal_source_area->timestamp; - internal_destination_area->flags = internal_source_area->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; - internal_destination_area->data_handle = internal_source_area->data_handle; - internal_destination_area->free_data_handle = internal_source_area->free_data_handle; - internal_destination_area->clone_data_handle = internal_source_area->clone_data_handle; - internal_destination_area->read_element_data = internal_source_area->read_element_data; - internal_destination_area->write_element_data = internal_source_area->write_element_data; - - *destination_area = (libfdata_area_t *) internal_destination_area; - - return( 1 ); - -on_error: - if( internal_destination_area != NULL ) - { - if( internal_destination_area->segments_array != NULL ) - { - libcdata_array_free( - &( internal_destination_area->segments_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - NULL ); - } - if( ( internal_destination_area->data_handle != NULL ) - && ( internal_source_area->free_data_handle != NULL ) ) - { - internal_source_area->free_data_handle( - &( internal_destination_area->data_handle ), - NULL ); - } - memory_free( - internal_destination_area ); - } - return( -1 ); -} - -/* Segment functions - */ - -/* Empties the area - * Returns 1 if successful or -1 on error - */ -int libfdata_area_empty( - libfdata_area_t *area, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_empty"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libcdata_array_empty( - internal_area->segments_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty segments array.", - function ); - - return( -1 ); - } - if( libcdata_array_empty( - internal_area->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty mapped ranges array.", - function ); - - return( -1 ); - } - internal_area->size = 0; - - return( 1 ); -} - -/* Resizes the area - * Returns 1 if successful or -1 on error - */ -int libfdata_area_resize( - libfdata_area_t *area, - int number_of_segments, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_resize"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libcdata_array_resize( - internal_area->segments_array, - number_of_segments, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize segments array.", - function ); - - return( -1 ); - } - if( libcdata_array_resize( - internal_area->mapped_ranges_array, - number_of_segments, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize mapped ranges array.", - function ); - - return( -1 ); - } - internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Retrieves the number of segments of the area - * Returns 1 if successful or -1 on error - */ -int libfdata_area_get_number_of_segments( - libfdata_area_t *area, - int *number_of_segments, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_get_number_of_segments"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libcdata_array_get_number_of_entries( - internal_area->segments_array, - number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from segments array.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the offset and size of a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_area_get_segment_by_index( - libfdata_area_t *area, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_get_segment_by_index"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libfdata_segments_array_get_segment_by_index( - internal_area->segments_array, - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d.", - function, - segment_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the offset and size of a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_area_set_segment_by_index( - libfdata_area_t *area, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_set_segment_by_index"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libfdata_segments_array_set_segment_by_index( - internal_area->segments_array, - internal_area->mapped_ranges_array, - &( internal_area->size ), - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set segment: %d.", - function, - segment_index ); - - return( -1 ); - } - internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Prepends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_area_prepend_segment( - libfdata_area_t *area, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_prepend_segment"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libfdata_segments_array_prepend_segment( - internal_area->segments_array, - internal_area->mapped_ranges_array, - &( internal_area->size ), - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to prepend segment.", - function ); - - return( -1 ); - } - internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Appends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_area_append_segment( - libfdata_area_t *area, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_append_segment"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( libfdata_segments_array_append_segment( - internal_area->segments_array, - internal_area->mapped_ranges_array, - &( internal_area->size ), - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append segment.", - function ); - - return( -1 ); - } - internal_area->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Area element functions - */ - -/* Retrieves the element data size of the area - * Returns 1 if successful or -1 on error - */ -int libfdata_area_get_element_data_size( - libfdata_area_t *area, - size64_t *element_data_size, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_get_element_data_size"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( element_data_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element data size.", - function ); - - return( -1 ); - } - *element_data_size = internal_area->element_data_size; - - return( 1 ); -} - -/* Area element value functions - */ - -/* Retrieves the value an element at a specific offset - * Returns 1 if successful or -1 on error - */ -int libfdata_area_get_element_value_at_offset( - libfdata_area_t *area, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t element_value_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_value_t *cache_value = NULL; - libfdata_internal_area_t *internal_area = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_area_get_element_value_at_offset"; - off64_t cache_value_offset = (off64_t) -1; - off64_t element_data_offset = (off64_t) -1; - int64_t cache_value_timestamp = 0; - uint32_t element_data_flags = 0; - int cache_entry_index = -1; - int cache_value_file_index = -1; - int element_data_file_index = -1; - int element_index = -1; - int number_of_cache_entries = 0; - int result = 0; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( internal_area->read_element_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid area - missing read element data function.", - function ); - - return( -1 ); - } - if( internal_area->element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid area - element data size value out of bounds.", - function ); - - return( -1 ); - } - if( ( internal_area->size == 0 ) - || ( internal_area->size > (off64_t) INT64_MAX ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid area - size value out of bounds.", - function ); - - return( -1 ); - } - if( ( (size64_t) element_value_offset > internal_area->size ) - || ( (size64_t) element_value_offset > ( internal_area->size - internal_area->element_data_size ) ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element value offset value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_segments_array_get_data_range_at_offset( - internal_area->segments_array, - element_value_offset, - &element_data_offset, - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", - function, - element_value_offset ); - - return( -1 ); - } - if( segment_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing segment data range.", - function ); - - return( -1 ); - } - element_data_file_index = segment_data_range->file_index; - element_data_offset += segment_data_range->offset; - element_data_flags = segment_data_range->flags; - - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } - element_index = (int) ( element_value_offset / internal_area->element_data_size ); - - if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) - { - if( internal_area->calculate_cache_entry_index == NULL ) - { - cache_entry_index = element_index % number_of_cache_entries; - } - else - { - cache_entry_index = internal_area->calculate_cache_entry_index( - element_index, - element_data_file_index, - element_data_offset, - internal_area->element_data_size, - element_data_flags, - number_of_cache_entries ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( element_data_file_index == cache_value_file_index ) - && ( element_data_offset == cache_value_offset ) - && ( internal_area->timestamp == cache_value_timestamp ) ) - { - result = 1; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( result == 0 ) - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " miss (%d out of %d)\n", - function, - (intptr_t) cache, - cache_entry_index, - number_of_cache_entries ); - } - else - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " hit (%d out of %d)\n", - function, - (intptr_t) cache, - cache_entry_index, - number_of_cache_entries ); - } - } -#endif - } - if( result == 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading element data at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", - function, - element_data_offset, - element_data_offset, - internal_area->element_data_size ); - } -#endif - if( internal_area->read_element_data( - internal_area->data_handle, - file_io_handle, - area, - cache, - element_value_offset, - element_data_file_index, - element_data_offset, - internal_area->element_data_size, - element_data_flags, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read element data at offset: 0x%08" PRIx64 ".", - function, - element_data_offset ); - - return( -1 ); - } - if( internal_area->calculate_cache_entry_index == NULL ) - { - cache_entry_index = element_index % number_of_cache_entries; - } - else - { - cache_entry_index = internal_area->calculate_cache_entry_index( - element_index, - element_data_file_index, - element_data_offset, - internal_area->element_data_size, - element_data_flags, - number_of_cache_entries ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( element_data_file_index != cache_value_file_index ) - || ( element_data_offset != cache_value_offset ) - || ( internal_area->timestamp != cache_value_timestamp ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing cache value.", - function ); - - return( -1 ); - } - } - if( libfcache_cache_value_get_value( - cache_value, - element_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the value of a specific element - * - * If the flag LIBFDATA_AREA_ELEMENT_VALUE_FLAG_MANAGED is set the area - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_area_set_element_value_at_offset( - libfdata_area_t *area, - intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, - libfdata_cache_t *cache, - off64_t element_value_offset, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_area_set_element_value_at_offset"; - off64_t element_data_offset = (off64_t) -1; - uint32_t element_data_flags = 0; - int cache_entry_index = -1; - int element_data_file_index = -1; - int element_index = -1; - int number_of_cache_entries = 0; - - LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( internal_area->element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid area - element data size value out of bounds.", - function ); - - return( -1 ); - } - if( ( internal_area->size == 0 ) - || ( internal_area->size > (off64_t) INT64_MAX ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid area - size value out of bounds.", - function ); - - return( -1 ); - } - if( ( (size64_t) element_value_offset > internal_area->size ) - || ( (size64_t) element_value_offset > ( internal_area->size - internal_area->element_data_size ) ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element value offset value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_segments_array_get_data_range_at_offset( - internal_area->segments_array, - element_value_offset, - &element_data_offset, - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", - function, - element_value_offset ); - - return( -1 ); - } - if( segment_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing segment data range.", - function ); - - return( -1 ); - } - element_data_file_index = segment_data_range->file_index; - element_data_offset += segment_data_range->offset; - element_data_flags = segment_data_range->flags; - - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } - element_index = (int) ( element_value_offset / internal_area->element_data_size ); - - if( internal_area->calculate_cache_entry_index == NULL ) - { - cache_entry_index = element_index % number_of_cache_entries; - } - else - { - cache_entry_index = internal_area->calculate_cache_entry_index( - element_index, - element_data_file_index, - element_data_offset, - internal_area->element_data_size, - element_data_flags, - number_of_cache_entries ); - } - if( libfcache_cache_set_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - element_data_file_index, - element_data_offset, - internal_area->timestamp, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value in cache entry: %d.", - function, - cache_entry_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the size - * Returns 1 if successful or -1 on error - */ -int libfdata_area_get_size( - libfdata_area_t *area, - size64_t *size, - libcerror_error_t **error ) -{ - libfdata_internal_area_t *internal_area = NULL; - static char *function = "libfdata_area_get_size"; - - if( area == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid area.", - function ); - - return( -1 ); - } - internal_area = (libfdata_internal_area_t *) area; - - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - if( ( internal_area->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_segments_array_calculate_mapped_ranges( - internal_area->segments_array, - internal_area->mapped_ranges_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - return( -1 ); - } - internal_area->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - *size = internal_area->size; - - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_area.h libbde-20240223/libfdata/libfdata_area.h --- libbde-20190102/libfdata/libfdata_area.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_area.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,278 +0,0 @@ -/* - * The area functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_AREA_H ) -#define _LIBFDATA_INTERNAL_AREA_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_area libfdata_internal_area_t; - -struct libfdata_internal_area -{ - /* The element data size - */ - size64_t element_data_size; - - /* The (area) size - */ - size64_t size; - - /* The segments array - */ - libcdata_array_t *segments_array; - - /* The mapped ranges array - */ - libcdata_array_t *mapped_ranges_array; - - /* The timestamp - */ - int64_t timestamp; - - /* The flags - */ - uint8_t flags; - - /* The calculate cache entry index value - */ - int (*calculate_cache_entry_index)( - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - int number_of_cache_entries ); - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The read element data function - */ - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_area_t *area, - libfdata_cache_t *cache, - off64_t element_value_offset, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The write element data function - */ - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_area_t *area, - libfdata_cache_t *cache, - off64_t element_value_offset, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_area_initialize( - libfdata_area_t **area, - size64_t element_data_size, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_area_t *area, - libfdata_cache_t *cache, - off64_t element_value_offset, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_area_t *area, - libfdata_cache_t *cache, - off64_t element_value_offset, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_free( - libfdata_area_t **area, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_clone( - libfdata_area_t **destination_area, - libfdata_area_t *source_area, - libcerror_error_t **error ); - -/* Segment functions - */ -LIBFDATA_EXTERN \ -int libfdata_area_empty( - libfdata_area_t *area, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_resize( - libfdata_area_t *area, - int number_of_segments, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_get_number_of_segments( - libfdata_area_t *area, - int *number_of_segments, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_get_segment_by_index( - libfdata_area_t *area, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_set_segment_by_index( - libfdata_area_t *area, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_prepend_segment( - libfdata_area_t *area, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_append_segment( - libfdata_area_t *area, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -/* Area element functions - */ -LIBFDATA_EXTERN \ -int libfdata_area_get_element_data_size( - libfdata_area_t *area, - size64_t *element_data_size, - libcerror_error_t **error ); - -/* Area element value functions - */ -LIBFDATA_EXTERN \ -int libfdata_area_get_element_value_at_offset( - libfdata_area_t *area, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t element_value_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_area_set_element_value_at_offset( - libfdata_area_t *area, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t element_value_offset, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -/* IO functions - */ -LIBFDATA_EXTERN \ -int libfdata_area_get_size( - libfdata_area_t *area, - size64_t *size, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_AREA_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_btree.c libbde-20240223/libfdata/libfdata_btree.c --- libbde-20190102/libfdata/libfdata_btree.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_btree.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,3108 +0,0 @@ -/* - * The balanced tree functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_btree.h" -#include "libfdata_btree_node.h" -#include "libfdata_btree_range.h" -#include "libfdata_definitions.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_types.h" -#include "libfdata_unused.h" - -/* Creates a tree - * Make sure the value tree is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the tree - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_initialize( - libfdata_btree_t **tree, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_node)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_btree_node_t *node, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - intptr_t *key_value, - uint8_t read_flags, - libcerror_error_t **error ), - int (*read_leaf_value)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - uint8_t read_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_t *internal_tree = NULL; - static char *function = "libfdata_btree_initialize"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( *tree != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid tree value already set.", - function ); - - return( -1 ); - } - internal_tree = memory_allocate_structure( - libfdata_internal_btree_t ); - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create tree.", - function ); - - goto on_error; - } - if( memory_set( - internal_tree, - 0, - sizeof( libfdata_internal_btree_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear tree.", - function ); - - goto on_error; - } - if( libfdata_btree_range_initialize( - &( internal_tree->root_node_data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create root node data range.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_tree->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - goto on_error; - } - internal_tree->flags |= flags; - internal_tree->calculate_node_cache_entry_index = &libfdata_btree_calculate_node_cache_entry_index; - internal_tree->calculate_leaf_value_cache_entry_index = &libfdata_btree_calculate_leaf_value_cache_entry_index; - internal_tree->data_handle = data_handle; - internal_tree->free_data_handle = free_data_handle; - internal_tree->clone_data_handle = clone_data_handle; - internal_tree->read_node = read_node; - internal_tree->read_leaf_value = read_leaf_value; - - *tree = (libfdata_btree_t *) internal_tree; - - return( 1 ); - -on_error: - if( internal_tree != NULL ) - { - if( internal_tree->root_node_data_range != NULL ) - { - libfdata_btree_range_free( - &( internal_tree->root_node_data_range ), - NULL ); - } - memory_free( - internal_tree ); - } - return( -1 ); -} - -/* Frees a tree - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_free( - libfdata_btree_t **tree, - libcerror_error_t **error ) -{ - libfdata_internal_btree_t *internal_tree = NULL; - static char *function = "libfdata_btree_free"; - int result = 1; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( *tree != NULL ) - { - internal_tree = (libfdata_internal_btree_t *) *tree; - *tree = NULL; - - if( libfdata_btree_range_free( - &( internal_tree->root_node_data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free root node data range.", - function ); - - result = -1; - } - if( ( internal_tree->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_tree->data_handle != NULL ) - { - if( internal_tree->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_tree->free_data_handle( - &( internal_tree->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_tree ); - } - return( result ); -} - -/* Clones (duplicates) the tree - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_clone( - libfdata_btree_t **destination_tree, - libfdata_btree_t *source_tree, - libcerror_error_t **error ) -{ - libfdata_internal_btree_t *internal_destination_tree = NULL; - libfdata_internal_btree_t *internal_source_tree = NULL; - intptr_t *destination_data_handle = NULL; - static char *function = "libfdata_btree_clone"; - - if( destination_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination tree.", - function ); - - return( -1 ); - } - if( *destination_tree != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination tree value already set.", - function ); - - return( -1 ); - } - if( source_tree == NULL ) - { - *destination_tree = NULL; - - return( 1 ); - } - internal_source_tree = (libfdata_internal_btree_t *) source_tree; - - if( internal_source_tree->data_handle != NULL ) - { - if( internal_source_tree->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source tree - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_tree->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source tree - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_tree->clone_data_handle( - &destination_data_handle, - internal_source_tree->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to clone data handle.", - function ); - - goto on_error; - } - } - internal_destination_tree = memory_allocate_structure( - libfdata_internal_btree_t ); - - if( internal_destination_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination tree.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_tree, - 0, - sizeof( libfdata_internal_btree_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination tree.", - function ); - - memory_free( - internal_destination_tree ); - - return( -1 ); - } - if( internal_source_tree->data_handle != NULL ) - { - if( internal_source_tree->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source tree - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_tree->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source tree - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_tree->clone_data_handle( - &( internal_destination_tree->data_handle ), - internal_source_tree->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to clone data handle.", - function ); - - goto on_error; - } - } - if( libfdata_btree_range_clone( - &( internal_destination_tree->root_node_data_range ), - internal_source_tree->root_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination root node data range.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_destination_tree->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve destination timestamp.", - function ); - - goto on_error; - } - *destination_tree = (libfdata_btree_t *) internal_destination_tree; - - return( 1 ); - -on_error: - if( internal_destination_tree != NULL ) - { - if( internal_destination_tree->root_node_data_range != NULL ) - { - libfdata_btree_range_free( - &( internal_destination_tree->root_node_data_range ), - NULL ); - } - if( ( internal_destination_tree->data_handle != NULL ) - && ( internal_source_tree->free_data_handle != NULL ) ) - { - internal_source_tree->free_data_handle( - &( internal_destination_tree->data_handle ), - NULL ); - } - memory_free( - internal_destination_tree ); - } - return( -1 ); -} - -/* Cache entry functions - */ - -/* Calculated the node cache entry index - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_calculate_node_cache_entry_index( - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int level LIBFDATA_ATTRIBUTE_UNUSED, - int node_data_file_index LIBFDATA_ATTRIBUTE_UNUSED, - off64_t node_data_offset, - size64_t node_data_size LIBFDATA_ATTRIBUTE_UNUSED, - uint32_t node_data_flags LIBFDATA_ATTRIBUTE_UNUSED, - int *cache_entry_index, - libcerror_error_t **error ) -{ - static char *function = "libfdata_btree_calculate_node_cache_entry_index"; - int number_of_cache_entries = 0; - - LIBFDATA_UNREFERENCED_PARAMETER( level ); - LIBFDATA_UNREFERENCED_PARAMETER( node_data_file_index ); - LIBFDATA_UNREFERENCED_PARAMETER( node_data_size ); - LIBFDATA_UNREFERENCED_PARAMETER( node_data_flags ); - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( cache_entry_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid cache entry index.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } -/* TODO improve cache entry index calculation */ - if( number_of_cache_entries <= 4 ) - { - *cache_entry_index = node_data_offset % number_of_cache_entries; - } - else if( level == 0 ) - { - *cache_entry_index = 0; - } - else - { - *cache_entry_index = 1; - - /* Use 3/4 of the cache for the nodes - */ - number_of_cache_entries = ( ( number_of_cache_entries - 1 ) / 4 ) * 3; - - *cache_entry_index += node_data_offset % number_of_cache_entries; - } - return( 1 ); -} - -/* Calculated the leaf value cache entry index - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_calculate_leaf_value_cache_entry_index( - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int leaf_value_index LIBFDATA_ATTRIBUTE_UNUSED, - int leaf_value_data_file_index LIBFDATA_ATTRIBUTE_UNUSED, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size LIBFDATA_ATTRIBUTE_UNUSED, - uint32_t leaf_value_data_flags LIBFDATA_ATTRIBUTE_UNUSED, - int *cache_entry_index, - libcerror_error_t **error ) -{ - static char *function = "libfdata_btree_calculate_leaf_value_cache_entry_index"; - int number_of_cache_entries = 0; - - LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_index ); - LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_data_file_index ); - LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_data_size ); - LIBFDATA_UNREFERENCED_PARAMETER( leaf_value_data_flags ); - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( cache_entry_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid cache entry index.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } -/* TODO improve cache entry index calculation */ - if( number_of_cache_entries <= 4 ) - { - *cache_entry_index = leaf_value_data_offset % number_of_cache_entries; - } - else - { - /* Use 1/4 of the cache for the leaf values - */ - *cache_entry_index = ( ( number_of_cache_entries - 1 ) / 4 ) * 3; - number_of_cache_entries = ( number_of_cache_entries - 1 ) / 4; - - *cache_entry_index += leaf_value_data_offset % number_of_cache_entries; - } - return( 1 ); -} - -/* Root node functions - */ - -/* Retrieves the root node - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_get_root_node( - libfdata_btree_t *tree, - int *node_data_file_index, - off64_t *node_data_offset, - size64_t *node_data_size, - uint32_t *node_data_flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_t *internal_tree = NULL; - static char *function = "libfdata_btree_get_root_node"; - intptr_t *key_value = NULL; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_btree_t *) tree; - - if( libfdata_btree_range_get( - internal_tree->root_node_data_range, - node_data_file_index, - node_data_offset, - node_data_size, - node_data_flags, - &key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve root node data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the root node - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_set_root_node( - libfdata_btree_t *tree, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_t *internal_tree = NULL; - intptr_t *key_value = NULL; - static char *function = "libfdata_btree_set_root_node"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_btree_t *) tree; - - if( node_data_file_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid node data file index less than zero.", - function ); - - return( -1 ); - } - if( node_data_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid node data offset value less than zero.", - function ); - - return( -1 ); - } - if( node_data_size > (size64_t) INT64_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid node data size value exceeds maximum.", - function ); - - return( -1 ); - } - if( libfdata_btree_range_set( - internal_tree->root_node_data_range, - node_data_file_index, - node_data_offset, - node_data_size, - node_data_flags, - key_value, - NULL, - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set root node data range.", - function ); - - return( -1 ); - } - if( libfcache_date_time_get_timestamp( - &( internal_tree->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Leaf value functions - */ - -/* Reads the leaf value identified by the data range - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_read_leaf_value( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *leaf_value_data_range, - intptr_t **leaf_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_value_t *cache_value = NULL; - intptr_t *key_value = NULL; - static char *function = "libfdata_btree_read_leaf_value"; - size64_t leaf_value_data_size = 0; - off64_t cache_value_offset = 0; - off64_t leaf_value_data_offset = 0; - int64_t cache_value_timestamp = 0; - uint32_t leaf_value_data_flags = 0; - int cache_entry_index = -1; - int cache_value_file_index = -1; - int leaf_value_data_file_index = -1; - int leaf_value_index = -1; - int result = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( internal_tree->read_leaf_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing read leaf value function.", - function ); - - return( -1 ); - } - if( leaf_value_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree leaf value data range.", - function ); - - return( -1 ); - } - leaf_value_index = leaf_value_data_range->mapped_first_leaf_value_index; - - if( libfdata_btree_range_get( - leaf_value_data_range, - &leaf_value_data_file_index, - &leaf_value_data_offset, - &leaf_value_data_size, - &leaf_value_data_flags, - &key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range values.", - function ); - - return( -1 ); - } - if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) - { - if( internal_tree->calculate_leaf_value_cache_entry_index( - (libfdata_btree_t *) internal_tree, - cache, - leaf_value_index, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - &cache_entry_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate cache entry index.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( leaf_value_data_file_index == cache_value_file_index ) - && ( leaf_value_data_offset == cache_value_offset ) - && ( internal_tree->timestamp == cache_value_timestamp ) ) - { - result = 1; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( result == 0 ) - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " miss (entry: %d, want: %" PRIi64 ", got: %" PRIi64 ")\n", - function, - (intptr_t) cache, - cache_entry_index, - leaf_value_data_offset, - cache_value_offset ); - } - else - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " hit (entry: %d)\n", - function, - (intptr_t) cache, - cache_entry_index ); - } - } -#endif - } - if( result == 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading leaf value at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", - function, - leaf_value_data_offset, - leaf_value_data_offset, - leaf_value_data_size ); - } -#endif - if( internal_tree->read_leaf_value( - internal_tree->data_handle, - file_io_handle, - (libfdata_btree_t *) internal_tree, - cache, - leaf_value_index, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - key_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read leaf value at offset: %" PRIi64 ".", - function, - leaf_value_data_offset ); - - return( -1 ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( leaf_value_data_file_index != cache_value_file_index ) - || ( leaf_value_data_offset != cache_value_offset ) - || ( internal_tree->timestamp != cache_value_timestamp ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing cache value.", - function ); - - return( -1 ); - } - } - if( libfcache_cache_value_get_value( - cache_value, - leaf_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Reads the node identified by the data range - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_read_node( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int level, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_value_t *cache_value = NULL; - intptr_t *key_value = NULL; - static char *function = "libfdata_btree_read_node"; - size64_t node_data_size = 0; - off64_t cache_value_offset = 0; - off64_t node_data_offset = 0; - int64_t cache_value_timestamp = 0; - uint32_t node_data_flags = 0; - int cache_entry_index = -1; - int cache_value_file_index = -1; - int node_data_file_index = -1; - int result = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( internal_tree->read_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing read node function.", - function ); - - return( -1 ); - } - if( node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree node data range.", - function ); - - return( -1 ); - } - if( level < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid level value out of bounds.", - function ); - - return( -1 ); - } - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - *node = NULL; - - if( libfdata_btree_range_get( - node_data_range, - &node_data_file_index, - &node_data_offset, - &node_data_size, - &node_data_flags, - &key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node data range values.", - function ); - - goto on_error; - } - if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) - { - if( internal_tree->calculate_node_cache_entry_index( - (libfdata_btree_t *) internal_tree, - cache, - level, - node_data_file_index, - node_data_offset, - node_data_size, - node_data_flags, - &cache_entry_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate cache entry index.", - function ); - - goto on_error; - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - goto on_error; - } - if( cache_value != NULL ) - { - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - goto on_error; - } - } - if( ( node_data_file_index == cache_value_file_index ) - && ( node_data_offset == cache_value_offset ) - && ( internal_tree->timestamp == cache_value_timestamp ) ) - { - result = 1; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( result == 0 ) - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " miss (entry: %d, want: %" PRIi64 ", got: %" PRIi64 ")\n", - function, - (intptr_t) cache, - cache_entry_index, - node_data_offset, - cache_value_offset ); - } - else - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " hit (entry: %d)\n", - function, - (intptr_t) cache, - cache_entry_index ); - } - } -#endif - } - if( result == 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading node at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", - function, - node_data_offset, - node_data_offset, - node_data_size ); - } -#endif - if( libfdata_btree_node_initialize( - node, - level, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create node at level: %d.", - function, - level ); - - goto on_error; - } - if( internal_tree->read_node( - internal_tree->data_handle, - file_io_handle, - *node, - node_data_file_index, - node_data_offset, - node_data_size, - node_data_flags, - key_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read node at offset: %" PRIi64 ".", - function, - node_data_offset ); - - goto on_error; - } - if( ( read_flags & LIBFDATA_READ_FLAG_NO_CACHE ) == 0 ) - { - if( internal_tree->calculate_node_cache_entry_index( - (libfdata_btree_t *) internal_tree, - cache, - level, - node_data_file_index, - node_data_offset, - node_data_size, - node_data_flags, - &cache_entry_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate cache entry index.", - function ); - - goto on_error; - } - if( libfcache_cache_set_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - node_data_file_index, - node_data_offset, - internal_tree->timestamp, - (intptr_t *) *node, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_btree_node_free, - LIBFCACHE_CACHE_VALUE_FLAG_MANAGED, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set node in cache entry: %d.", - function, - cache_entry_index ); - - goto on_error; - } - } - } - else - { - if( libfcache_cache_value_get_value( - cache_value, - (intptr_t **) node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value from cache.", - function ); - - *node = NULL; - - goto on_error; - } - if( ( read_flags & LIBFDATA_READ_FLAG_NO_CACHE ) != 0 ) - { - /* Remove the node from the cache - */ - if( libfcache_cache_value_clear( - cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to clear cache entry.", - function ); - - *node = NULL; - - goto on_error; - } - } - } - return( 1 ); - -on_error: - if( *node != NULL ) - { - libfdata_btree_node_free( - node, - NULL ); - } - return( -1 ); -} - -/* Reads the sub tree - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_read_sub_tree( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int level, - int mapped_first_leaf_value_index, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_range_t *leaf_value_data_range = NULL; - libfdata_btree_range_t *sub_node_data_range = NULL; - libfdata_btree_node_t *sub_node = NULL; - intptr_t *key_value = NULL; - static char *function = "libfdata_btree_read_sub_tree"; - off64_t node_data_offset = 0; - size64_t node_data_size = 0; - uint32_t node_data_flags = 0; - int branch_number_of_leaf_values = 0; - int cache_entry_index = -1; - int leaf_value_index = 0; - int node_data_file_index = -1; - int number_of_leaf_values = 0; - int number_of_sub_nodes = 0; - int result = 0; - int sub_node_index = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( level < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid level value out of bounds.", - function ); - - return( -1 ); - } - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - /* Note that the node data range can be cached out later in the function. - */ - if( libfdata_btree_range_get( - node_data_range, - &node_data_file_index, - &node_data_offset, - &node_data_size, - &node_data_flags, - &key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from tree node.", - function ); - - goto on_error; - } - /* Make sure to not have the node cached here to prevent it from - * being freed during recursing the sub tree. - */ - if( libfdata_btree_read_node( - internal_tree, - file_io_handle, - cache, - node_data_range, - level, - node, - read_flags | LIBFDATA_READ_FLAG_NO_CACHE, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read node.", - function ); - - goto on_error; - } - if( *node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - goto on_error; - } - if( ( ( (libfdata_internal_btree_node_t *) *node )->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - result = libfdata_btree_node_is_leaf( - *node, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if node is a leaf node.", - function, - sub_node_index ); - - goto on_error; - } - else if( result != 0 ) - { - if( libfdata_btree_node_get_number_of_leaf_values( - *node, - &number_of_leaf_values, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf values.", - function ); - - goto on_error; - } - for( leaf_value_index = 0; - leaf_value_index < number_of_leaf_values; - leaf_value_index++ ) - { - if( libfdata_btree_node_get_leaf_value_data_range_by_index( - *node, - leaf_value_index, - &leaf_value_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value: %d data range.", - function, - leaf_value_index ); - - goto on_error; - } - if( leaf_value_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing leaf value: %d data range.", - function, - leaf_value_index ); - - goto on_error; - } - leaf_value_data_range->mapped_first_leaf_value_index = mapped_first_leaf_value_index; - leaf_value_data_range->mapped_last_leaf_value_index = -1; - leaf_value_data_range->mapped_number_of_leaf_values = 1; - - mapped_first_leaf_value_index++; - } - branch_number_of_leaf_values = number_of_leaf_values; - -/* TODO*/ - level++; - } - else - { - if( libfdata_btree_node_get_number_of_sub_nodes( - *node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - goto on_error; - } - level++; - - for( sub_node_index = 0; - sub_node_index < number_of_sub_nodes; - sub_node_index++ ) - { - if( libfdata_btree_node_get_sub_node_data_range_by_index( - *node, - sub_node_index, - &sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node: %d data range.", - function, - sub_node_index ); - - goto on_error; - } - if( sub_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sub node: %d data range.", - function, - sub_node_index ); - - goto on_error; - } - if( libfdata_btree_read_sub_tree( - internal_tree, - file_io_handle, - cache, - sub_node_data_range, - level, - mapped_first_leaf_value_index, - &sub_node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sub node: %d sub tree.", - function, - sub_node_index ); - - goto on_error; - } - if( libfdata_btree_node_get_number_of_leaf_values_in_branch( - sub_node, - &number_of_leaf_values, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf values in branch.", - function ); - - goto on_error; - } - sub_node_data_range->mapped_first_leaf_value_index = mapped_first_leaf_value_index; - mapped_first_leaf_value_index += number_of_leaf_values; - sub_node_data_range->mapped_last_leaf_value_index = mapped_first_leaf_value_index - 1; - sub_node_data_range->mapped_number_of_leaf_values = number_of_leaf_values; - branch_number_of_leaf_values += number_of_leaf_values; - } - } - ( (libfdata_internal_btree_node_t *) *node )->branch_number_of_leaf_values = branch_number_of_leaf_values; - ( (libfdata_internal_btree_node_t *) *node )->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - if( internal_tree->calculate_node_cache_entry_index( - (libfdata_btree_t *) internal_tree, - cache, - level, - node_data_file_index, - node_data_offset, - node_data_size, - node_data_flags, - &cache_entry_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate cache entry index.", - function ); - - goto on_error; - } - if( libfcache_cache_set_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - node_data_file_index, - node_data_offset, - internal_tree->timestamp, - (intptr_t *) *node, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_btree_node_free, - LIBFCACHE_CACHE_VALUE_FLAG_MANAGED, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set node in cache entry: %d.", - function, - cache_entry_index ); - - goto on_error; - } - return( 1 ); - -on_error: - if( *node != NULL ) - { - libfdata_btree_node_free( - node, - NULL ); - } - return( -1 ); -} - -/* Retrieves a leaf node the contains a specific leaf value index - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_get_leaf_node_by_index( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int level, - int leaf_value_index, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_range_t *sub_node_data_range = NULL; - static char *function = "libfdata_btree_get_leaf_node_by_index"; - int result = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node data range.", - function ); - - return( -1 ); - } - if( level < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid level value out of bounds.", - function ); - - return( -1 ); - } - if( leaf_value_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid leaf value index value out of bounds.", - function ); - - return( -1 ); - } - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - if( libfdata_btree_read_sub_tree( - internal_tree, - file_io_handle, - cache, - node_data_range, - level, - node_data_range->mapped_first_leaf_value_index, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read node sub tree.", - function ); - - return( -1 ); - } - if( *node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - result = libfdata_btree_node_is_leaf( - *node, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if node is a leaf node.", - function ); - - return( -1 ); - } - else if( result != 0 ) - { - return( 1 ); - } - if( libfdata_btree_node_get_sub_node_data_range_by_mapped_index( - *node, - leaf_value_index, - &sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node data range for leaf value: %d..", - function, - leaf_value_index ); - - return( -1 ); - } - *node = NULL; - - if( libfdata_btree_get_leaf_node_by_index( - internal_tree, - file_io_handle, - cache, - sub_node_data_range, - level + 1, - leaf_value_index, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node for leaf value: %d.", - function, - leaf_value_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf node for a specific key value - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, - * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_get_leaf_node_by_key( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int maximum_node_level, - int current_node_level, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *node_index, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_range_t *sub_node_data_range = NULL; - static char *function = "libfdata_btree_get_leaf_node_by_key"; - int result = 0; - int sub_node_index = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node data range.", - function ); - - return( -1 ); - } - if( maximum_node_level < -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid maximum node level value out of bounds.", - function ); - - return( -1 ); - } - if( current_node_level < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid current node level value out of bounds.", - function ); - - return( -1 ); - } - if( node_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node index.", - function ); - - return( -1 ); - } - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - if( libfdata_btree_read_sub_tree( - internal_tree, - file_io_handle, - cache, - node_data_range, - current_node_level, - node_data_range->mapped_first_leaf_value_index, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read node sub tree.", - function ); - - return( -1 ); - } - if( *node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - result = libfdata_btree_node_is_leaf( - *node, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if node is a leaf node.", - function ); - - return( -1 ); - } - else if( result != 0 ) - { - return( 1 ); - } - if( ( maximum_node_level != LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED ) - && ( current_node_level >= maximum_node_level ) ) - { - return( 1 ); - } - result = libfdata_btree_node_get_sub_node_data_range_by_key( - *node, - key_value, - key_value_compare_function, - &sub_node_index, - &sub_node_data_range, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node data range by key.", - function ); - - return( -1 ); - } - else if( result == 0 ) - { - return( 0 ); - } - *node_index = sub_node_index; - *node = NULL; - - result = libfdata_btree_get_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - sub_node_data_range, - maximum_node_level, - current_node_level + 1, - key_value, - key_value_compare_function, - node_index, - node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node by key.", - function ); - - return( -1 ); - } - return( result ); -} - -/* Retrieves the next leaf node for a specific key value - * - * This function will try to determine the next node based - * on the node_index and node values. - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, - * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_get_next_leaf_node_by_key( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int node_index, - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *next_node_index, - libfdata_btree_node_t **next_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_node_t *branch_node = NULL; - libfdata_btree_range_t *sub_node_data_range = NULL; - static char *function = "libfdata_btree_get_next_leaf_node_by_key"; - int branch_node_index = 0; - int branch_node_level = 0; - int node_level = 0; - int number_of_sub_nodes = 0; - int result = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( node_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid node index value out of bounds.", - function ); - - return( -1 ); - } - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - if( libfdata_btree_node_get_level( - node, - &node_level, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node level.", - function ); - - return( -1 ); - } - if( node_level == 0 ) - { - return( 0 ); - } - branch_node_level = node_level; - - while( branch_node_level > 0 ) - { - branch_node_level--; - - result = libfdata_btree_get_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - node_data_range, - branch_node_level, - 0, - key_value, - key_value_compare_function, - &branch_node_index, - &branch_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve branch node at level: %d.", - function, - branch_node_level ); - - return( -1 ); - } - else if( result == 0 ) - { - return( 0 ); - } - if( libfdata_btree_node_get_number_of_sub_nodes( - branch_node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - if( ( node_index < 0 ) - || ( node_index >= number_of_sub_nodes ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid node index value out of bounds.", - function ); - - return( -1 ); - } - node_index++; - - if( node_index < number_of_sub_nodes ) - { - if( libfdata_btree_node_get_sub_node_data_range_by_index( - branch_node, - node_index, - &sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next sub node: %d data range.", - function, - node_index ); - - return( -1 ); - } - result = libfdata_btree_get_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - sub_node_data_range, - LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED, - branch_node_level + 1, - key_value, - key_value_compare_function, - next_node_index, - next_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve branch node at level: %d.", - function, - branch_node_level ); - - return( -1 ); - } - return( result ); - } - /* If no next leaf node is available try the next branch - */ - node_index = branch_node_index; - } - return( 0 ); -} - -/* Retrieves the previous leaf node for a specific key value - * - * This function will try to determine the previous node based - * on the node_index and node values. - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, - * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_get_previous_leaf_node_by_key( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int node_index, - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *previous_node_index, - libfdata_btree_node_t **previous_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_node_t *branch_node = NULL; - libfdata_btree_range_t *sub_node_data_range = NULL; - static char *function = "libfdata_btree_get_previous_leaf_node_by_key"; - int branch_node_index = 0; - int branch_node_level = 0; - int node_level = 0; - int number_of_sub_nodes = 0; - int result = 0; - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( node_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid node index value out of bounds.", - function ); - - return( -1 ); - } - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing node.", - function ); - - return( -1 ); - } - if( libfdata_btree_node_get_level( - node, - &node_level, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node level.", - function ); - - return( -1 ); - } - if( node_level == 0 ) - { - return( 0 ); - } - branch_node_level = node_level; - - while( branch_node_level > 0 ) - { - branch_node_level--; - - result = libfdata_btree_get_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - node_data_range, - branch_node_level, - 0, - key_value, - key_value_compare_function, - &branch_node_index, - &branch_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve branch node at level: %d.", - function, - branch_node_level ); - - return( -1 ); - } - else if( result == 0 ) - { - return( 0 ); - } - if( libfdata_btree_node_get_number_of_sub_nodes( - branch_node, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of sub nodes.", - function ); - - return( -1 ); - } - if( ( node_index < 0 ) - || ( node_index >= number_of_sub_nodes ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid node index value out of bounds.", - function ); - - return( -1 ); - } - node_index--; - - if( node_index >= 0 ) - { - if( libfdata_btree_node_get_sub_node_data_range_by_index( - branch_node, - node_index, - &sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous sub node: %d data range.", - function, - node_index ); - - return( -1 ); - } - result = libfdata_btree_get_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - sub_node_data_range, - LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED, - branch_node_level + 1, - key_value, - key_value_compare_function, - previous_node_index, - previous_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve branch node at level: %d.", - function, - branch_node_level ); - - return( -1 ); - } - return( result ); - } - /* If no previous leaf node is available try the previous branch - */ - node_index = branch_node_index; - } - return( 0 ); -} - -/* Retrieves the number of leaf values in the tree - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_get_number_of_leaf_values( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_values, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_node_t *root_node = NULL; - libfdata_internal_btree_t *internal_tree = NULL; - static char *function = "libfdata_btree_get_number_of_leaf_values"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_btree_t *) tree; - - if( internal_tree->root_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing root node data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_read_sub_tree( - internal_tree, - file_io_handle, - cache, - internal_tree->root_node_data_range, - 0, - 0, - &root_node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read root node sub tree.", - function ); - - return( -1 ); - } - if( libfdata_btree_node_get_number_of_leaf_values_in_branch( - root_node, - number_of_values, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf values in branch.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf value at a specific index - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_get_leaf_value_by_index( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_value_index, - intptr_t **value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_node_t *node = NULL; - libfdata_btree_range_t *leaf_value_data_range = NULL; - libfdata_internal_btree_t *internal_tree = NULL; - static char *function = "libfdata_btree_get_leaf_value_by_index"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_btree_t *) tree; - - if( internal_tree->root_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing root node data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_get_leaf_node_by_index( - internal_tree, - file_io_handle, - cache, - internal_tree->root_node_data_range, - 0, - leaf_value_index, - &node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node.", - function ); - - return( -1 ); - } - if( libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( - node, - leaf_value_index, - &leaf_value_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_read_leaf_value( - internal_tree, - file_io_handle, - cache, - leaf_value_data_range, - value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read leaf value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets a specific leaf value - * - * If the flag LIBFDATA_BTREE_LEAF_VALUE_FLAG_MANAGED is set the vector - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_set_leaf_value_by_index( - libfdata_btree_t *tree, - intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, - libfdata_cache_t *cache, - int leaf_value_index, - intptr_t *leaf_value, - int (*free_leaf_value)( - intptr_t **leaf_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_btree_node_t *node = NULL; - libfdata_btree_range_t *leaf_value_data_range = NULL; - libfdata_internal_btree_t *internal_tree = NULL; - intptr_t *key_value = NULL; - static char *function = "libfdata_btree_set_leaf_value_by_index"; - off64_t leaf_value_data_offset = 0; - size64_t leaf_value_data_size = 0; - uint32_t leaf_value_data_flags = 0; - int cache_entry_index = -1; - int leaf_value_data_file_index = -1; - - LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_btree_t *) tree; - - if( internal_tree->root_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing root node data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_get_leaf_node_by_index( - internal_tree, - file_io_handle, - cache, - internal_tree->root_node_data_range, - 0, - leaf_value_index, - &node, - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node.", - function ); - - return( -1 ); - } - if( libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( - node, - leaf_value_index, - &leaf_value_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_range_get( - leaf_value_data_range, - &leaf_value_data_file_index, - &leaf_value_data_offset, - &leaf_value_data_size, - &leaf_value_data_flags, - &key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range values.", - function ); - - return( -1 ); - } - if( internal_tree->calculate_leaf_value_cache_entry_index( - (libfdata_btree_t *) internal_tree, - cache, - leaf_value_index, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - &cache_entry_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate cache entry index.", - function ); - - return( -1 ); - } - if( libfcache_cache_set_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - leaf_value_data_file_index, - leaf_value_data_offset, - internal_tree->timestamp, - leaf_value, - free_leaf_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set leaf value in cache entry: %d.", - function, - cache_entry_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf value for a specific key value - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, - * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_get_leaf_value_by_key( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - uint8_t search_flags, - intptr_t **value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_btree_node_t *leaf_node = NULL; - libfdata_btree_range_t *leaf_value_data_range = NULL; - libfdata_internal_btree_t *internal_tree = NULL; - static char *function = "libfdata_btree_get_leaf_value_by_key"; - int leaf_node_index = 0; - int leaf_node_level = 0; - int node_index = 0; - int result = 0; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_btree_t *) tree; - - if( internal_tree->root_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing root node data range.", - function ); - - return( -1 ); - } - if( ( search_flags & ~( LIBFDATA_BTREE_SEARCH_FLAG_SCAN_PREVIOUS_NODE | LIBFDATA_BTREE_SEARCH_FLAG_SCAN_NEXT_NODE ) ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported search flags.", - function ); - - return( -1 ); - } - result = libfdata_btree_get_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - internal_tree->root_node_data_range, - LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED, - 0, - key_value, - key_value_compare_function, - &node_index, - &leaf_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node.", - function ); - - return( -1 ); - } - else if( result == 0 ) - { - return( 0 ); - } - if( libfdata_btree_node_get_level( - leaf_node, - &leaf_node_level, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node level.", - function ); - - return( -1 ); - } - result = libfdata_btree_node_get_leaf_value_data_range_by_key( - leaf_node, - key_value, - key_value_compare_function, - &leaf_value_data_range, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range.", - function ); - - return( -1 ); - } - if( ( result == 0 ) - && ( ( search_flags & LIBFDATA_BTREE_SEARCH_FLAG_SCAN_PREVIOUS_NODE ) != 0 ) ) - { - result = libfdata_btree_get_previous_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - internal_tree->root_node_data_range, - node_index, - leaf_node, - key_value, - key_value_compare_function, - &leaf_node_index, - &leaf_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous leaf node.", - function ); - - return( -1 ); - } - else if( result != 0 ) - { - result = libfdata_btree_node_get_leaf_value_data_range_by_key( - leaf_node, - key_value, - key_value_compare_function, - &leaf_value_data_range, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve previous leaf value data range.", - function ); - - return( -1 ); - } - } - } - if( ( result == 0 ) - && ( ( search_flags & LIBFDATA_BTREE_SEARCH_FLAG_SCAN_NEXT_NODE ) != 0 ) ) - { - result = libfdata_btree_get_next_leaf_node_by_key( - internal_tree, - file_io_handle, - cache, - internal_tree->root_node_data_range, - node_index, - leaf_node, - key_value, - key_value_compare_function, - &leaf_node_index, - &leaf_node, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next leaf node.", - function ); - - return( -1 ); - } - else if( result != 0 ) - { - result = libfdata_btree_node_get_leaf_value_data_range_by_key( - leaf_node, - key_value, - key_value_compare_function, - &leaf_value_data_range, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next leaf value data range.", - function ); - - return( -1 ); - } - } - } - if( result != 0 ) - { - if( libfdata_btree_read_leaf_value( - internal_tree, - file_io_handle, - cache, - leaf_value_data_range, - value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read leaf value.", - function ); - - return( -1 ); - } - } - return( result ); -} - diff -Nru libbde-20190102/libfdata/libfdata_btree.h libbde-20240223/libfdata/libfdata_btree.h --- libbde-20190102/libfdata/libfdata_btree.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_btree.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,368 +0,0 @@ -/* - * The balanced tree functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_BTREE_H ) -#define _LIBFDATA_INTERNAL_BTREE_H - -#include -#include - -#include "libfdata_btree_node.h" -#include "libfdata_btree_range.h" -#include "libfdata_extern.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_btree libfdata_internal_btree_t; - -struct libfdata_internal_btree -{ - /* The root node data range - */ - libfdata_btree_range_t *root_node_data_range; - - /* The timestamp - */ - int64_t timestamp; - - /* The flags - */ - uint8_t flags; - - /* The calculate node cache entry index value - */ - int (*calculate_node_cache_entry_index)( - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int level, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - int *cache_entry_index, - libcerror_error_t **error ); - - /* The calculate leaf value cache entry index value - */ - int (*calculate_leaf_value_cache_entry_index)( - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - int *cache_entry_index, - libcerror_error_t **error ); - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The read node function - */ - int (*read_node)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_btree_node_t *node, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - intptr_t *key_value, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The read leaf value function - */ - int (*read_leaf_value)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - uint8_t read_flags, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_btree_initialize( - libfdata_btree_t **tree, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_node)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_btree_node_t *node, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - intptr_t *key_value, - uint8_t read_flags, - libcerror_error_t **error ), - int (*read_leaf_value)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - uint8_t read_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_free( - libfdata_btree_t **tree, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_clone( - libfdata_btree_t **destination_tree, - libfdata_btree_t *source_tree, - libcerror_error_t **error ); - -/* Cache entry functions - */ -int libfdata_btree_calculate_node_cache_entry_index( - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int level, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - int *cache_entry_index, - libcerror_error_t **error ); - -int libfdata_btree_calculate_leaf_value_cache_entry_index( - libfdata_btree_t *tree, - libfdata_cache_t *cache, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - int *cache_entry_index, - libcerror_error_t **error ); - -/* Root node functions - */ -LIBFDATA_EXTERN \ -int libfdata_btree_get_root_node( - libfdata_btree_t *tree, - int *node_data_file_index, - off64_t *node_data_offset, - size64_t *node_data_size, - uint32_t *node_data_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_set_root_node( - libfdata_btree_t *tree, - int node_data_file_index, - off64_t node_data_offset, - size64_t node_data_size, - uint32_t node_data_flags, - libcerror_error_t **error ); - -/* Leaf value functions - */ -int libfdata_btree_read_leaf_value( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *leaf_value_data_range, - intptr_t **leaf_value, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_btree_read_node( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int level, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_btree_read_sub_tree( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int level, - int mapped_first_leaf_value_index, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_btree_get_leaf_node_by_index( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int level, - int leaf_value_index, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_btree_get_leaf_node_by_key( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int maximum_node_level, - int current_node_level, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *node_index, - libfdata_btree_node_t **node, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_btree_get_next_leaf_node_by_key( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int node_index, - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *next_node_index, - libfdata_btree_node_t **next_node, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_btree_get_previous_leaf_node_by_key( - libfdata_internal_btree_t *internal_tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_btree_range_t *node_data_range, - int node_index, - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *previous_node_index, - libfdata_btree_node_t **previous_node, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_get_number_of_leaf_values( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_values, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_get_leaf_value_by_index( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_value_index, - intptr_t **value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_set_leaf_value_by_index( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_value_index, - intptr_t *leaf_value, - int (*free_leaf_value)( - intptr_t **leaf_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_get_leaf_value_by_key( - libfdata_btree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - uint8_t search_flags, - intptr_t **value, - uint8_t read_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_BTREE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_btree_node.c libbde-20240223/libfdata/libfdata_btree_node.c --- libbde-20190102/libfdata/libfdata_btree_node.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_btree_node.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1788 +0,0 @@ -/* - * The balanced tree node functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_btree_node.h" -#include "libfdata_btree_range.h" -#include "libfdata_definitions.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_types.h" - -/* Creates a node - * Make sure the value node is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_initialize( - libfdata_btree_node_t **node, - int level, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_initialize"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( *node != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid node value already set.", - function ); - - return( -1 ); - } - if( level < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid level value less than zero.", - function ); - - return( -1 ); - } - internal_tree_node = memory_allocate_structure( - libfdata_internal_btree_node_t ); - - if( internal_tree_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create node.", - function ); - - goto on_error; - } - if( memory_set( - internal_tree_node, - 0, - sizeof( libfdata_internal_btree_node_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear node.", - function ); - - memory_free( - internal_tree_node ); - - return( -1 ); - } - internal_tree_node->level = level; - internal_tree_node->flags = LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - *node = (libfdata_btree_node_t *) internal_tree_node; - - return( 1 ); - -on_error: - if( internal_tree_node != NULL ) - { - memory_free( - internal_tree_node ); - } - return( -1 ); -} - -/* Frees a node - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_free( - libfdata_btree_node_t **node, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_free"; - int result = 1; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( *node != NULL ) - { - internal_tree_node = (libfdata_internal_btree_node_t *) *node; - *node = NULL; - - if( internal_tree_node->sub_node_ranges_array != NULL ) - { - if( libcdata_array_free( - &( internal_tree_node->sub_node_ranges_array ), - (int (*)(intptr_t **, libcerror_error_t **error)) &libfdata_btree_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the sub node ranges array.", - function ); - - result = -1; - } - } - if( internal_tree_node->leaf_value_ranges_array != NULL ) - { - if( libcdata_array_free( - &( internal_tree_node->leaf_value_ranges_array ), - (int (*)(intptr_t **, libcerror_error_t **error)) &libfdata_btree_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the leaf value ranges array.", - function ); - - result = -1; - } - } - memory_free( - internal_tree_node ); - } - return( result ); -} - -/* Node functions - */ - -/* Retrieves the level - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_level( - libfdata_btree_node_t *node, - int *level, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_level"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( level == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid level.", - function ); - - return( -1 ); - } - *level = internal_tree_node->level; - - return( 1 ); -} - -/* Determines if the node is a branch node - * Returns 1 if a branch node, 0 if not or -1 on error - */ -int libfdata_btree_node_is_branch( - libfdata_btree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_is_branch"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH ) != 0 ) - { - return( 1 ); - } - return( 0 ); -} - -/* Determines if the node is a leaf node - * Returns 1 if a leaf node, 0 if not or -1 on error - */ -int libfdata_btree_node_is_leaf( - libfdata_btree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_is_leaf"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_LEAF ) != 0 ) - { - return( 1 ); - } - return( 0 ); -} - -/* Determines if the node is a root node - * Returns 1 if a root node, 0 if not or -1 on error - */ -int libfdata_btree_node_is_root( - libfdata_btree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_is_root"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->level == 0 ) - { - return( 1 ); - } - return( 0 ); -} - -/* Sub node data range functions - */ - -/* Retrieves the number of sub nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_number_of_sub_nodes( - libfdata_btree_node_t *node, - int *number_of_sub_nodes, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_number_of_sub_nodes"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->sub_node_ranges_array == NULL ) - { - if( number_of_sub_nodes == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid number of sub nodes.", - function ); - - return( -1 ); - } - *number_of_sub_nodes = 0; - } - else - { - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_node_ranges_array, - number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub node ranges array.", - function ); - - return( -1 ); - } - } - return( 1 ); -} - -/* Retrieves a specific sub node data range - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_sub_node_data_range_by_index( - libfdata_btree_node_t *node, - int sub_node_index, - libfdata_btree_range_t **sub_node_data_range, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_sub_node_data_range_by_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->sub_node_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing sub node ranges array.", - function ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_node_ranges_array, - sub_node_index, - (intptr_t **) sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub node ranges array.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a sub node data range for a specific mapped index - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_sub_node_data_range_by_mapped_index( - libfdata_btree_node_t *node, - int mapped_index, - libfdata_btree_range_t **sub_node_data_range, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_sub_node_data_range_by_mapped_index"; - int number_of_sub_nodes = 0; - int sub_node_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->sub_node_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing sub node ranges array.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - unsupported flags calculate mapped ranges is set.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested index: %d\n", - function, - mapped_index ); - } -#endif - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_node_ranges_array, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub node ranges array.", - function ); - - return( -1 ); - } - for( sub_node_index = 0; - sub_node_index < number_of_sub_nodes; - sub_node_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_node_ranges_array, - sub_node_index, - (intptr_t **) sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub node ranges array.", - function, - sub_node_index ); - - return( -1 ); - } - if( *sub_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sub node: %d data range.", - function, - sub_node_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped range: %d - %d\n", - function, - ( *sub_node_data_range )->mapped_first_leaf_value_index, - ( *sub_node_data_range )->mapped_last_leaf_value_index ); - } -#endif - if( ( mapped_index >= ( *sub_node_data_range )->mapped_first_leaf_value_index ) - && ( mapped_index <= ( *sub_node_data_range )->mapped_last_leaf_value_index ) ) - { - break; - } - } - if( sub_node_index >= number_of_sub_nodes ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a sub node data range for a specific key - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_LESS_EQUAL, LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER, - * LIBFDATA_COMPARE_GREATER_EQUAL if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_node_get_sub_node_data_range_by_key( - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *sub_node_index, - libfdata_btree_range_t **sub_node_data_range, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_sub_node_data_range_by_key"; - int number_of_sub_nodes = 0; - int result = 0; - int search_node_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->sub_node_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing sub node ranges array.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - unsupported flags calculate mapped ranges is set.", - function ); - - return( -1 ); - } - if( sub_node_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid sub node index.", - function ); - - return( -1 ); - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_node_ranges_array, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub node ranges array.", - function ); - - return( -1 ); - } - for( search_node_index = 0; - search_node_index < number_of_sub_nodes; - search_node_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_node_ranges_array, - search_node_index, - (intptr_t **) sub_node_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub node ranges array.", - function, - search_node_index ); - - return( -1 ); - } - if( *sub_node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sub node: %d data range.", - function, - search_node_index ); - - return( -1 ); - } - if( key_value_compare_function == NULL ) - { - if( key_value == ( *sub_node_data_range )->key_value ) - { - *sub_node_index = search_node_index; - - return( 1 ); - } - } - else - { - result = key_value_compare_function( - key_value, - ( *sub_node_data_range )->key_value, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare key value with sub node data range key value: %d.", - function, - search_node_index ); - - return( -1 ); - } - else if( ( result == LIBFDATA_COMPARE_EQUAL ) - || ( result == LIBFDATA_COMPARE_GREATER_EQUAL ) - || ( result == LIBFDATA_COMPARE_LESS_EQUAL ) ) - { - *sub_node_index = search_node_index; - - return( 1 ); - } - else if( result == LIBFDATA_COMPARE_LESS ) - { - break; - } - else if( result != LIBFDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported value compare function return value: %d.", - function, - result ); - - return( -1 ); - } - } - } - *sub_node_data_range = NULL; - - return( 0 ); -} - -/* Retrieves a specific sub node - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_sub_node_by_index( - libfdata_btree_node_t *node, - int sub_node_index, - int *sub_node_data_file_index, - off64_t *sub_node_data_offset, - size64_t *sub_node_data_size, - uint32_t *sub_node_data_flags, - intptr_t **key_value, - libcerror_error_t **error ) -{ - libfdata_btree_range_t *data_range = NULL; - static char *function = "libfdata_btree_node_get_sub_node_by_index"; - - if( libfdata_btree_node_get_sub_node_data_range_by_index( - node, - sub_node_index, - &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node: %d data range.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_btree_range_get( - data_range, - sub_node_data_file_index, - sub_node_data_offset, - sub_node_data_size, - sub_node_data_flags, - key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values from sub node: %d data range.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the offset and size of a specific sub node - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_set_sub_node_by_index( - libfdata_btree_node_t *node, - int sub_node_index, - int sub_node_data_file_index, - off64_t sub_node_data_offset, - size64_t sub_node_data_size, - uint32_t sub_node_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - libfdata_btree_range_t *data_range = NULL; - static char *function = "libfdata_btree_node_set_sub_node_by_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->sub_node_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid sub node index value out of bounds.", - function ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_node_ranges_array, - sub_node_index, - (intptr_t **) &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub node ranges array.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_btree_range_set( - data_range, - sub_node_data_file_index, - sub_node_data_offset, - sub_node_data_size, - sub_node_data_flags, - key_value, - free_key_value, - key_value_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub node: %d data range.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Appends a sub node offset and size - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_append_sub_node( - libfdata_btree_node_t *node, - int *sub_node_index, - int sub_node_data_file_index, - off64_t sub_node_data_offset, - size64_t sub_node_data_size, - uint32_t sub_node_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - libfdata_btree_range_t *data_range = NULL; - static char *function = "libfdata_btree_node_append_sub_node"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_LEAF ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - unsupported flags is leaf is set.", - function ); - - return( -1 ); - } - if( internal_tree_node->sub_node_ranges_array == NULL ) - { - if( libcdata_array_initialize( - &( internal_tree_node->sub_node_ranges_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sub node ranges array.", - function ); - - goto on_error; - } - } - if( libfdata_btree_range_initialize( - &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create data range.", - function ); - - goto on_error; - } - if( libfdata_btree_range_set( - data_range, - sub_node_data_file_index, - sub_node_data_offset, - sub_node_data_size, - sub_node_data_flags, - key_value, - free_key_value, - key_value_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_tree_node->sub_node_ranges_array, - sub_node_index, - (intptr_t *) data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append data range to sub node ranges array.", - function ); - - goto on_error; - } - internal_tree_node->flags |= LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH; - - return( 1 ); - -on_error: - if( data_range != NULL ) - { - libfdata_btree_range_free( - &data_range, - NULL ); - } - return( -1 ); -} - -/* Branch leaf values functions - */ - -/* Retrieves the number of leaf values in the branch - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_number_of_leaf_values_in_branch( - libfdata_btree_node_t *node, - int *number_of_leaf_values, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_number_of_leaf_values_in_branch"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( number_of_leaf_values == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid number of leaf values.", - function ); - - return( -1 ); - } - *number_of_leaf_values = internal_tree_node->branch_number_of_leaf_values; - - return( 1 ); -} - -/* Leaf value data range functions - */ - -/* Retrieves the number of leaf values - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_number_of_leaf_values( - libfdata_btree_node_t *node, - int *number_of_leaf_values, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_number_of_leaf_values"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->leaf_value_ranges_array == NULL ) - { - if( number_of_leaf_values == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid number of leaf values.", - function ); - - return( -1 ); - } - *number_of_leaf_values = 0; - } - else - { - if( libcdata_array_get_number_of_entries( - internal_tree_node->leaf_value_ranges_array, - number_of_leaf_values, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from leaf value ranges array.", - function ); - - return( -1 ); - } - } - return( 1 ); -} - -/* Retrieves a specific leaf value data range - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_leaf_value_data_range_by_index( - libfdata_btree_node_t *node, - int leaf_value_index, - libfdata_btree_range_t **leaf_value_data_range, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_leaf_value_data_range_by_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->leaf_value_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing leaf value ranges array.", - function ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - internal_tree_node->leaf_value_ranges_array, - leaf_value_index, - (intptr_t **) leaf_value_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from leaf value ranges array.", - function, - leaf_value_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf value data range for a specific mapped index - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( - libfdata_btree_node_t *node, - int mapped_index, - libfdata_btree_range_t **leaf_value_data_range, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_leaf_value_data_range_by_mapped_index"; - int number_of_leaf_values = 0; - int leaf_value_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->leaf_value_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing leaf value ranges array.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - unsupported flags calculate mapped ranges is set.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested index: %d\n", - function, - mapped_index ); - } -#endif - if( libcdata_array_get_number_of_entries( - internal_tree_node->leaf_value_ranges_array, - &number_of_leaf_values, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from leaf value ranges array.", - function ); - - return( -1 ); - } - for( leaf_value_index = 0; - leaf_value_index < number_of_leaf_values; - leaf_value_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->leaf_value_ranges_array, - leaf_value_index, - (intptr_t **) leaf_value_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from leaf value ranges array.", - function, - leaf_value_index ); - - return( -1 ); - } - if( *leaf_value_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing leaf value: %d data range.", - function, - leaf_value_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped range: %d\n", - function, - ( *leaf_value_data_range )->mapped_first_leaf_value_index ); - } -#endif - if( ( mapped_index == ( *leaf_value_data_range )->mapped_first_leaf_value_index ) - && ( ( *leaf_value_data_range )->mapped_number_of_leaf_values == 1 ) ) - { - break; - } - } - if( leaf_value_index >= number_of_leaf_values ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf value data range for a specific key - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_node_get_leaf_value_data_range_by_key( - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - libfdata_btree_range_t **leaf_value_data_range, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_btree_node_get_leaf_value_data_range_by_key"; - int number_of_leaf_values = 0; - int leaf_value_index = 0; - int result = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->leaf_value_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing leaf value ranges array.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - unsupported flags calculate mapped ranges is set.", - function ); - - return( -1 ); - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->leaf_value_ranges_array, - &number_of_leaf_values, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from leaf value ranges array.", - function ); - - return( -1 ); - } - for( leaf_value_index = 0; - leaf_value_index < number_of_leaf_values; - leaf_value_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->leaf_value_ranges_array, - leaf_value_index, - (intptr_t **) leaf_value_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from leaf value ranges array.", - function, - leaf_value_index ); - - return( -1 ); - } - if( *leaf_value_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing leaf value: %d data range.", - function, - leaf_value_index ); - - return( -1 ); - } - if( key_value_compare_function == NULL ) - { - if( key_value == ( *leaf_value_data_range )->key_value ) - { - return( 1 ); - } - } - else - { - result = key_value_compare_function( - key_value, - ( *leaf_value_data_range )->key_value, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare key value with leaf value data range key value: %d.", - function, - leaf_value_index ); - - return( -1 ); - } - else if( result == LIBFDATA_COMPARE_EQUAL ) - { - return( 1 ); - } - else if( result == LIBFDATA_COMPARE_LESS ) - { - return( 0 ); - } - else if( result != LIBFDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported value compare function return value: %d.", - function, - result ); - - return( -1 ); - } - } - } - return( 0 ); -} - -/* Retrieves a specific leaf value - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_get_leaf_value_by_index( - libfdata_btree_node_t *node, - int leaf_value_index, - int *leaf_value_data_file_index, - off64_t *leaf_value_data_offset, - size64_t *leaf_value_data_size, - uint32_t *leaf_value_data_flags, - intptr_t **key_value, - libcerror_error_t **error ) -{ - libfdata_btree_range_t *data_range = NULL; - static char *function = "libfdata_btree_node_get_leaf_value_by_index"; - - if( libfdata_btree_node_get_leaf_value_data_range_by_index( - node, - leaf_value_index, - &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_range_get( - data_range, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values from leaf value data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf value for a specific key - * - * Uses the key_value_compare_function to determine the similarity of the key values - * The key_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER if successful or -1 on error - * - * Returns 1 if successful, 0 if no such value or -1 on error - */ -int libfdata_btree_node_get_leaf_value_by_key( - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *leaf_value_data_file_index, - off64_t *leaf_value_data_offset, - size64_t *leaf_value_data_size, - uint32_t *leaf_value_data_flags, - libcerror_error_t **error ) -{ - libfdata_btree_range_t *data_range = NULL; - intptr_t *data_range_key_value = NULL; - static char *function = "libfdata_btree_node_get_leaf_value_by_key"; - - if( libfdata_btree_node_get_leaf_value_data_range_by_key( - node, - key_value, - key_value_compare_function, - &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf value data range.", - function ); - - return( -1 ); - } - if( libfdata_btree_range_get( - data_range, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - &data_range_key_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values from leaf value data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the offset and size of a specific leaf value - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_set_leaf_value_by_index( - libfdata_btree_node_t *node, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - libfdata_btree_range_t *data_range = NULL; - static char *function = "libfdata_btree_node_set_leaf_value_by_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( internal_tree_node->leaf_value_ranges_array == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid leaf value index value out of bounds.", - function ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - internal_tree_node->leaf_value_ranges_array, - leaf_value_index, - (intptr_t **) &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from leaf value ranges array.", - function, - leaf_value_index ); - - return( -1 ); - } - if( libfdata_btree_range_set( - data_range, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - key_value, - free_key_value, - key_value_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set leaf value: %d data range.", - function, - leaf_value_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Appends a leaf value offset and size - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_node_append_leaf_value( - libfdata_btree_node_t *node, - int *leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ) -{ - libfdata_internal_btree_node_t *internal_tree_node = NULL; - libfdata_btree_range_t *data_range = NULL; - static char *function = "libfdata_btree_node_append_leaf_value"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_btree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - unsupported flags is branch is set.", - function ); - - return( -1 ); - } - if( internal_tree_node->leaf_value_ranges_array == NULL ) - { - if( libcdata_array_initialize( - &( internal_tree_node->leaf_value_ranges_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create leaf value ranges array.", - function ); - - goto on_error; - } - } - if( libfdata_btree_range_initialize( - &data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create data range.", - function ); - - goto on_error; - } - if( libfdata_btree_range_set( - data_range, - leaf_value_data_file_index, - leaf_value_data_offset, - leaf_value_data_size, - leaf_value_data_flags, - key_value, - free_key_value, - key_value_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_tree_node->leaf_value_ranges_array, - leaf_value_index, - (intptr_t *) data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append data range to leaf value ranges array.", - function ); - - goto on_error; - } - internal_tree_node->flags |= LIBFDATA_BTREE_NODE_FLAG_IS_LEAF; - - return( 1 ); - -on_error: - if( data_range != NULL ) - { - libfdata_btree_range_free( - &data_range, - NULL ); - } - return( -1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_btree_node.h libbde-20240223/libfdata/libfdata_btree_node.h --- libbde-20190102/libfdata/libfdata_btree_node.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_btree_node.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,268 +0,0 @@ -/* - * The balanced tree node functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_BTREE_NODE_H ) -#define _LIBFDATA_INTERNAL_BTREE_NODE_H - -#include -#include - -#include "libfdata_btree_range.h" -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_btree_node libfdata_internal_btree_node_t; - -struct libfdata_internal_btree_node -{ - /* The (node) level - */ - int level; - - /* The sub node (data) ranges array - */ - libcdata_array_t *sub_node_ranges_array; - - /* The number of leaf values in the branch - */ - int branch_number_of_leaf_values; - - /* The leaf value (data) ranges array - */ - libcdata_array_t *leaf_value_ranges_array; - - /* The flags - */ - uint8_t flags; -}; - -int libfdata_btree_node_initialize( - libfdata_btree_node_t **node, - int level, - libcerror_error_t **error ); - -int libfdata_btree_node_free( - libfdata_btree_node_t **node, - libcerror_error_t **error ); - -/* Node functions - */ - -LIBFDATA_EXTERN \ -int libfdata_btree_node_get_level( - libfdata_btree_node_t *node, - int *level, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_is_branch( - libfdata_btree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_is_leaf( - libfdata_btree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_is_root( - libfdata_btree_node_t *node, - libcerror_error_t **error ); - -/* Sub node data range functions - */ - -LIBFDATA_EXTERN \ -int libfdata_btree_node_get_number_of_sub_nodes( - libfdata_btree_node_t *node, - int *number_of_sub_nodes, - libcerror_error_t **error ); - -int libfdata_btree_node_get_sub_node_data_range_by_index( - libfdata_btree_node_t *node, - int sub_node_index, - libfdata_btree_range_t **sub_node_data_range, - libcerror_error_t **error ); - -int libfdata_btree_node_get_sub_node_data_range_by_mapped_index( - libfdata_btree_node_t *node, - int mapped_index, - libfdata_btree_range_t **sub_node_data_range, - libcerror_error_t **error ); - -int libfdata_btree_node_get_sub_node_data_range_by_key( - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *sub_node_index, - libfdata_btree_range_t **sub_node_data_range, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_get_sub_node_by_index( - libfdata_btree_node_t *node, - int sub_node_index, - int *sub_node_data_file_index, - off64_t *sub_node_data_offset, - size64_t *sub_node_data_size, - uint32_t *sub_node_data_flags, - intptr_t **key_value, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_set_sub_node_by_index( - libfdata_btree_node_t *node, - int sub_node_index, - int sub_node_data_file_index, - off64_t sub_node_data_offset, - size64_t sub_node_data_size, - uint32_t sub_node_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_append_sub_node( - libfdata_btree_node_t *node, - int *sub_node_index, - int sub_node_data_file_index, - off64_t sub_node_data_offset, - size64_t sub_node_data_size, - uint32_t sub_node_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ); - -/* Branch leaf values functions - */ - -int libfdata_btree_node_get_number_of_leaf_values_in_branch( - libfdata_btree_node_t *node, - int *number_of_leaf_values, - libcerror_error_t **error ); - -/* Leaf value data range functions - */ - -LIBFDATA_EXTERN \ -int libfdata_btree_node_get_number_of_leaf_values( - libfdata_btree_node_t *node, - int *number_of_leaf_values, - libcerror_error_t **error ); - -int libfdata_btree_node_get_leaf_value_data_range_by_index( - libfdata_btree_node_t *node, - int leaf_value_index, - libfdata_btree_range_t **leaf_value_data_range, - libcerror_error_t **error ); - -int libfdata_btree_node_get_leaf_value_data_range_by_mapped_index( - libfdata_btree_node_t *node, - int mapped_index, - libfdata_btree_range_t **leaf_value_data_range, - libcerror_error_t **error ); - -int libfdata_btree_node_get_leaf_value_data_range_by_key( - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - libfdata_btree_range_t **leaf_value_data_range, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_get_leaf_value_by_index( - libfdata_btree_node_t *node, - int leaf_value_index, - int *leaf_value_data_file_index, - off64_t *leaf_value_data_offset, - size64_t *leaf_value_data_size, - uint32_t *leaf_value_data_flags, - intptr_t **key_value, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_get_leaf_value_by_key( - libfdata_btree_node_t *node, - intptr_t *key_value, - int (*key_value_compare_function)( - intptr_t *first_key_value, - intptr_t *second_key_value, - libcerror_error_t **error ), - int *leaf_value_data_file_index, - off64_t *leaf_value_data_offset, - size64_t *leaf_value_data_size, - uint32_t *leaf_value_data_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_set_leaf_value_by_index( - libfdata_btree_node_t *node, - int leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_btree_node_append_leaf_value( - libfdata_btree_node_t *node, - int *leaf_value_index, - int leaf_value_data_file_index, - off64_t leaf_value_data_offset, - size64_t leaf_value_data_size, - uint32_t leaf_value_data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_BTREE_NODE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_btree_range.c libbde-20240223/libfdata/libfdata_btree_range.c --- libbde-20190102/libfdata/libfdata_btree_range.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_btree_range.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,412 +0,0 @@ -/* - * The balanced tree range functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_btree_range.h" -#include "libfdata_definitions.h" -#include "libfdata_libcerror.h" -#include "libfdata_range.h" -#include "libfdata_types.h" - -/* Creates a tree range - * Make sure the value range is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_range_initialize( - libfdata_btree_range_t **range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_btree_range_initialize"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree range.", - function ); - - return( -1 ); - } - if( *range != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid tree range value already set.", - function ); - - return( -1 ); - } - *range = memory_allocate_structure( - libfdata_btree_range_t ); - - if( *range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create tree range.", - function ); - - goto on_error; - } - if( memory_set( - *range, - 0, - sizeof( libfdata_btree_range_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear tree range.", - function ); - - goto on_error; - } - ( *range )->file_index = -1; - ( *range )->offset = (off64_t) -1; - - return( 1 ); - -on_error: - if( *range != NULL ) - { - memory_free( - *range ); - - *range = NULL; - } - return( -1 ); -} - -/* Frees a tree range - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_range_free( - libfdata_btree_range_t **range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_btree_range_free"; - int result = 1; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree range.", - function ); - - return( -1 ); - } - if( *range != NULL ) - { - if( ( *range )->key_value != NULL ) - { - if( ( ( *range )->key_value_flags & LIBFDATA_KEY_VALUE_FLAG_MANAGED ) != 0 ) - { - if( ( *range )->free_key_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree range - missing free key value function.", - function ); - - result = -1; - } - else if( ( *range )->free_key_value( - &( ( *range )->key_value ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free key value.", - function ); - - result = -1; - } - } - } - memory_free( - *range ); - - *range = NULL; - } - return( result ); -} - -/* Clones (duplicates) the range - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_range_clone( - libfdata_btree_range_t **destination_range, - libfdata_btree_range_t *source_range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_btree_range_clone"; - - if( destination_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination range.", - function ); - - return( -1 ); - } - if( *destination_range != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination range value already set.", - function ); - - return( -1 ); - } - if( source_range == NULL ) - { - *destination_range = NULL; - - return( 1 ); - } - *destination_range = memory_allocate_structure( - libfdata_btree_range_t ); - - if( *destination_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination range.", - function ); - - goto on_error; - } - if( memory_copy( - *destination_range, - source_range, - sizeof( libfdata_btree_range_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy source to destination range.", - function ); - - goto on_error; - } - ( *destination_range )->key_value = NULL; - - return( 1 ); - -on_error: - if( *destination_range != NULL ) - { - memory_free( - *destination_range ); - - *destination_range = NULL; - } - return( -1 ); -} - -/* Retrieves the tree range values - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_range_get( - libfdata_btree_range_t *range, - int *data_file_index, - off64_t *data_offset, - size64_t *data_size, - uint32_t *data_flags, - intptr_t **key_value, - libcerror_error_t **error ) -{ - static char *function = "libfdata_btree_range_get"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree range.", - function ); - - return( -1 ); - } - if( data_file_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data file index.", - function ); - - return( -1 ); - } - if( data_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data offset.", - function ); - - return( -1 ); - } - if( data_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data size.", - function ); - - return( -1 ); - } - if( data_flags == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data flags.", - function ); - - return( -1 ); - } - if( key_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid key value.", - function ); - - return( -1 ); - } - *data_file_index = range->file_index; - *data_offset = range->offset; - *data_size = range->size; - *data_flags = range->flags; - *key_value = range->key_value; - - return( 1 ); -} - -/* Sets the tree range values - * Returns 1 if successful or -1 on error - */ -int libfdata_btree_range_set( - libfdata_btree_range_t *range, - int data_file_index, - off64_t data_offset, - size64_t data_size, - uint32_t data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_set"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree range.", - function ); - - return( -1 ); - } - if( free_key_value != NULL ) - { - if( ( range->key_value_flags & LIBFDATA_KEY_VALUE_FLAG_MANAGED ) != 0 ) - { - if( range->key_value != NULL ) - { - if( range->free_key_value == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing free key value function.", - function ); - - return( -1 ); - } - if( range->free_key_value( - &( range->key_value ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free key value.", - function ); - - return( -1 ); - } - } - range->key_value_flags &= ~( LIBFDATA_KEY_VALUE_FLAG_MANAGED ); - } - } - range->file_index = data_file_index; - range->offset = data_offset; - range->size = data_size; - range->flags = data_flags; - range->key_value = key_value; - range->free_key_value = free_key_value; - range->key_value_flags |= key_value_flags; - - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_btree_range.h libbde-20240223/libfdata/libfdata_btree_range.h --- libbde-20190102/libfdata/libfdata_btree_range.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_btree_range.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* - * The balanced tree range functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_BTREE_RANGE_H ) -#define _LIBFDATA_BTREE_RANGE_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcerror.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_btree_range libfdata_btree_range_t; - -struct libfdata_btree_range -{ - /* The file index - */ - int file_index; - - /* The offset - */ - off64_t offset; - - /* The size - */ - size64_t size; - - /* The flags - */ - uint32_t flags; - - /* The key value - */ - intptr_t *key_value; - - /* The free key value function - */ - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ); - - /* The key value flags - */ - uint8_t key_value_flags; - - /* The mapped first leaf value index - */ - int mapped_first_leaf_value_index; - - /* The mapped last leaf value index - */ - int mapped_last_leaf_value_index; - - /* The mapped number of leaf values - */ - int mapped_number_of_leaf_values; -}; - -int libfdata_btree_range_initialize( - libfdata_btree_range_t **range, - libcerror_error_t **error ); - -int libfdata_btree_range_free( - libfdata_btree_range_t **range, - libcerror_error_t **error ); - -int libfdata_btree_range_clone( - libfdata_btree_range_t **destination_range, - libfdata_btree_range_t *source_range, - libcerror_error_t **error ); - -int libfdata_btree_range_get( - libfdata_btree_range_t *range, - int *data_file_index, - off64_t *data_offset, - size64_t *data_size, - uint32_t *data_flags, - intptr_t **key_value, - libcerror_error_t **error ); - -int libfdata_btree_range_set( - libfdata_btree_range_t *range, - int data_file_index, - off64_t data_offset, - size64_t data_size, - uint32_t data_flags, - intptr_t *key_value, - int (*free_key_value)( - intptr_t **key_value, - libcerror_error_t **error ), - uint8_t key_value_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_BTREE_RANGE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_cache.c libbde-20240223/libfdata/libfdata_cache.c --- libbde-20190102/libfdata/libfdata_cache.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_cache.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* - * Cache functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include - -#include "libfdata_cache.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -/* Creates a cache - * Make sure the value cache is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_cache_initialize( - libfdata_cache_t **cache, - int maximum_cache_entries, - libcerror_error_t **error ) -{ - return( libfcache_cache_initialize( - (libfcache_cache_t **) cache, - maximum_cache_entries, - error ) ); -} - -/* Frees a cache - * Returns 1 if successful or -1 on error - */ -int libfdata_cache_free( - libfdata_cache_t **cache, - libcerror_error_t **error ) -{ - return( libfcache_cache_free( - (libfcache_cache_t **) cache, - error ) ); -} - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - diff -Nru libbde-20190102/libfdata/libfdata_cache.h libbde-20240223/libfdata/libfdata_cache.h --- libbde-20190102/libfdata/libfdata_cache.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_cache.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - * Cache functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_CACHE_H ) -#define _LIBFDATA_INTERNAL_CACHE_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcerror.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -LIBFDATA_EXTERN \ -int libfdata_cache_initialize( - libfdata_cache_t **cache, - int maximum_cache_entries, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_cache_free( - libfdata_cache_t **cache, - libcerror_error_t **error ); - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_CACHE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_definitions.h libbde-20240223/libfdata/libfdata_definitions.h --- libbde-20190102/libfdata/libfdata_definitions.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_definitions.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -/* - * The internal definitions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_DEFINITIONS_H ) -#define _LIBFDATA_INTERNAL_DEFINITIONS_H - -#include - -/* Define HAVE_LOCAL_LIBFDATA for local use of libfdata - */ -#if !defined( HAVE_LOCAL_LIBFDATA ) -#include - -/* The definitions in are copied here - * for local use of libfdata - */ -#else -#define LIBFDATA_VERSION 20181124 - -/* The libfdata version string - */ -#define LIBFDATA_VERSION_STRING "20181124" - -/* The library flag definitions - */ -enum LIBFDATA_FLAGS -{ - /* The data is not managed by the library - */ - LIBFDATA_FLAG_DATA_NON_MANAGED = 0x00, - - /* The data is managed by the library - */ - LIBFDATA_FLAG_DATA_MANAGED = 0x01, - - /* The mapped ranges need to be calculated - */ - LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES = 0x80 -}; - -/* The area element value flag definitions - */ -enum LIBFDATA_AREA_ELEMENT_VALUE_FLAGS -{ - LIBFDATA_AREA_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_AREA_ELEMENT_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The balanced tree leaf value flag definitions - */ -enum LIBFDATA_BTREE_LEAF_VALUE_FLAGS -{ - LIBFDATA_BTREE_LEAF_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_BTREE_LEAF_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The data handle flag definitions - */ -enum LIBFDATA_DATA_HANDLE_FLAGS -{ - LIBFDATA_DATA_HANDLE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_DATA_HANDLE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The key value flag definitions - */ -enum LIBFDATA_KEY_VALUE_FLAGS -{ - LIBFDATA_KEY_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_KEY_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The list element value flag definitions - */ -enum LIBFDATA_LIST_ELEMENT_VALUE_FLAGS -{ - LIBFDATA_LIST_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The range list value flag definitions - */ -enum LIBFDATA_RANGE_LIST_VALUE_FLAGS -{ - LIBFDATA_RANGE_LIST_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_RANGE_LIST_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The tree node value flag definitions - */ -enum LIBFDATA_TREE_NODE_VALUE_FLAGS -{ - LIBFDATA_TREE_NODE_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_TREE_NODE_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The vector element value flag definitions - */ -enum LIBFDATA_VECTOR_ELEMENT_VALUE_FLAGS -{ - LIBFDATA_VECTOR_ELEMENT_VALUE_FLAG_NON_MANAGED = LIBFDATA_FLAG_DATA_NON_MANAGED, - LIBFDATA_VECTOR_ELEMENT_VALUE_FLAG_MANAGED = LIBFDATA_FLAG_DATA_MANAGED -}; - -/* The comparison function definitions - */ -enum LIBFDATA_COMPARE_DEFINITIONS -{ - /* The first value is less than the second value - */ - LIBFDATA_COMPARE_LESS, - - /* The first value is less equal than the second value - */ - LIBFDATA_COMPARE_LESS_EQUAL, - - /* The first and second values are equal - */ - LIBFDATA_COMPARE_EQUAL, - - /* The first value is greater than the second value - */ - LIBFDATA_COMPARE_GREATER, - - /* The first value is greater equal than the second value - */ - LIBFDATA_COMPARE_GREATER_EQUAL -}; - -/* The range flag definitions - */ -enum LIBFDATA_RANGE_FLAGS -{ - /* The range is sparse - */ - LIBFDATA_RANGE_FLAG_IS_SPARSE = 0x00000001UL, - - /* The range is compressed - */ - LIBFDATA_RANGE_FLAG_IS_COMPRESSED = 0x00000002UL, - - /* User defined flags - */ - LIBFDATA_RANGE_FLAG_USER_DEFINED_1 = 0x00000100UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_2 = 0x00000200UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_3 = 0x00000400UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_4 = 0x00000800UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_5 = 0x00001000UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_6 = 0x00002000UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_7 = 0x00004000UL, - LIBFDATA_RANGE_FLAG_USER_DEFINED_8 = 0x00008000UL, -}; - -#define LIBFDATA_RANGE_FLAG_MAXIMUM \ - LIBFDATA_RANGE_FLAG_USER_DEFINED_8 - -/* The read flag definitions - */ -enum LIBFDATA_READ_FLAGS -{ - /* Flag to indicate cached data should be ignored - */ - LIBFDATA_READ_FLAG_IGNORE_CACHE = 0x01, - - /* Internal flag to indicate data should not be cached - */ - LIBFDATA_READ_FLAG_NO_CACHE = 0x80 -}; - -/* The btree search flag definitions - */ -enum LIBFDATA_BTREE_SEARCH_FLAGS -{ - /* Flag to additionally scan the previous node - */ - LIBFDATA_BTREE_SEARCH_FLAG_SCAN_PREVIOUS_NODE = 0x01, - - /* Flag to additionally scan the next node - */ - LIBFDATA_BTREE_SEARCH_FLAG_SCAN_NEXT_NODE = 0x02 -}; - -/* The tree node flag definitions - */ -enum LIBFDATA_TREE_NODE_FLAGS -{ - /* The node is a leaf - */ - LIBFDATA_TREE_NODE_FLAG_IS_LEAF = 0x02, - - /* The node is virtual - */ - LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL = 0x04, - - /* The node is deleted - */ - LIBFDATA_TREE_NODE_FLAG_IS_DELETED = 0x08, - - /* The sub nodes data range was set - */ - LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET = 0x10, - - /* The sub nodes have been read - */ - LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ = 0x20, - - /* The node data has been read (at least once) - */ - LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ = 0x40 -}; - -/* The tree node insert flag definitions - */ -enum LIBFDATA_TREE_NODE_INSERT_FLAGS -{ - /* Allow duplicate sub node values - */ - LIBFDATA_TREE_NODE_INSERT_FLAG_NON_UNIQUE_SUB_NODE_VALUES = 0x00, - - /* Only allow unique sub node values, no duplicates - */ - LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_SUB_NODE_VALUES = 0x01 -}; - -#endif - -/* The btree node flag definitions - */ -enum LIBFDATA_BTREE_NODE_FLAGS -{ - /* The node is a branch - */ - LIBFDATA_BTREE_NODE_FLAG_IS_BRANCH = 0x02, - - /* The node is a leaf - */ - LIBFDATA_BTREE_NODE_FLAG_IS_LEAF = 0x04 -}; - -#define LIBFDATA_BTREE_NODE_LEVEL_UNLIMITED -1 - -/* The list flag definitions - */ -enum LIBFDATA_LIST_FLAGS -{ - LIBFDATA_LIST_FLAG_HAS_MAPPED_OFFSET = 0x10 -}; - -/* The list element flag definitions - */ -enum LIBFDATA_LIST_ELEMENT_FLAGS -{ - LIBFDATA_LIST_ELEMENT_FLAG_HAS_MAPPED_SIZE = 0x10 -}; - -#endif - diff -Nru libbde-20190102/libfdata/libfdata_error.c libbde-20240223/libfdata/libfdata_error.c --- libbde-20190102/libfdata/libfdata_error.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_error.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - * Error functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_error.h" -#include "libfdata_libcerror.h" - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -/* Free an error and its elements - */ -void libfdata_error_free( - libfdata_error_t **error ) -{ - libcerror_error_free( - (libcerror_error_t **) error ); -} - -/* Prints a descriptive string of the error to the stream - * Returns the number of printed characters if successful or -1 on error - */ -int libfdata_error_fprint( - libfdata_error_t *error, - FILE *stream ) -{ - int print_count = 0; - - print_count = libcerror_error_fprint( - (libcerror_error_t *) error, - stream ); - - return( print_count ); -} - -/* Prints a descriptive string of the error to the string - * The end-of-string character is not included in the return value - * Returns the number of printed characters if successful or -1 on error - */ -int libfdata_error_sprint( - libfdata_error_t *error, - char *string, - size_t size ) -{ - int print_count = 0; - - print_count = libcerror_error_sprint( - (libcerror_error_t *) error, - string, - size ); - - return( print_count ); -} - -/* Prints a backtrace of the error to the stream - * Returns the number of printed characters if successful or -1 on error - */ -int libfdata_error_backtrace_fprint( - libfdata_error_t *error, - FILE *stream ) -{ - int print_count = 0; - - print_count = libcerror_error_backtrace_fprint( - (libcerror_error_t *) error, - stream ); - - return( print_count ); -} - -/* Prints a backtrace of the error to the string - * The end-of-string character is not included in the return value - * Returns the number of printed characters if successful or -1 on error - */ -int libfdata_error_backtrace_sprint( - libfdata_error_t *error, - char *string, - size_t size ) -{ - int print_count = 0; - - print_count = libcerror_error_backtrace_sprint( - (libcerror_error_t *) error, - string, - size ); - - return( print_count ); -} - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - diff -Nru libbde-20190102/libfdata/libfdata_error.h libbde-20240223/libfdata/libfdata_error.h --- libbde-20190102/libfdata/libfdata_error.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_error.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * Error functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_ERROR_H ) -#define _LIBFDATA_INTERNAL_ERROR_H - -#include -#include -#include - -#if !defined( HAVE_LOCAL_LIBFDATA ) -#include -#endif - -#include "libfdata_extern.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -LIBFDATA_EXTERN \ -void libfdata_error_free( - libfdata_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_error_fprint( - libfdata_error_t *error, - FILE *stream ); - -LIBFDATA_EXTERN \ -int libfdata_error_sprint( - libfdata_error_t *error, - char *string, - size_t size ); - -LIBFDATA_EXTERN \ -int libfdata_error_backtrace_fprint( - libfdata_error_t *error, - FILE *stream ); - -LIBFDATA_EXTERN \ -int libfdata_error_backtrace_sprint( - libfdata_error_t *error, - char *string, - size_t size ); - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_ERROR_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_extern.h libbde-20240223/libfdata/libfdata_extern.h --- libbde-20190102/libfdata/libfdata_extern.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_extern.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* - * The internal extern definition - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_EXTERN_H ) -#define _LIBFDATA_INTERNAL_EXTERN_H - -#include - -/* Define HAVE_LOCAL_LIBFDATA for local use of libfdata - */ -#if !defined( HAVE_LOCAL_LIBFDATA ) - -#include - -#define LIBFDATA_EXTERN_VARIABLE LIBFDATA_EXTERN - -#else -#define LIBFDATA_EXTERN /* extern */ -#define LIBFDATA_EXTERN_VARIABLE extern - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - -#endif /* !defined( _LIBFDATA_INTERNAL_EXTERN_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_inline.h libbde-20240223/libfdata/libfdata_inline.h --- libbde-20190102/libfdata/libfdata_inline.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_inline.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * The internal inline definition - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_INLINE_H ) -#define _LIBFDATA_INTERNAL_INLINE_H - -#include - -#if defined( _MSC_VER ) -#define LIBFDATA_INLINE _inline - -#elif defined( __BORLANDC__ ) -#define LIBFDATA_INLINE /* inline */ - -#else -#define LIBFDATA_INLINE inline - -#endif - -#endif - diff -Nru libbde-20190102/libfdata/libfdata_libcdata.h libbde-20240223/libfdata/libfdata_libcdata.h --- libbde-20190102/libfdata/libfdata_libcdata.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_libcdata.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - * The libcdata header wrapper - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_LIBCDATA_H ) -#define _LIBFDATA_LIBCDATA_H - -#include - -/* Define HAVE_LOCAL_LIBCDATA for local use of libcdata - */ -#if defined( HAVE_LOCAL_LIBCDATA ) - -#include -#include -#include -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCDATA_DLL_IMPORT - * before including libcdata.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCDATA_DLL_IMPORT -#endif - -#include - -#endif /* defined( HAVE_LOCAL_LIBCDATA ) */ - -#endif /* !defined( _LIBFDATA_LIBCDATA_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_libcerror.h libbde-20240223/libfdata/libfdata_libcerror.h --- libbde-20190102/libfdata/libfdata_libcerror.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_libcerror.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - * The libcerror header wrapper - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_LIBCERROR_H ) -#define _LIBFDATA_LIBCERROR_H - -#include - -/* Define HAVE_LOCAL_LIBCERROR for local use of libcerror - */ -#if defined( HAVE_LOCAL_LIBCERROR ) - -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT - * before including libcerror.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCERROR_DLL_IMPORT -#endif - -#include - -#endif /* defined( HAVE_LOCAL_LIBCERROR ) */ - -#endif /* !defined( _LIBFDATA_LIBCERROR_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_libcnotify.h libbde-20240223/libfdata/libfdata_libcnotify.h --- libbde-20190102/libfdata/libfdata_libcnotify.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_libcnotify.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - * The libcnotify header wrapper - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_LIBCNOTIFY_H ) -#define _LIBFDATA_LIBCNOTIFY_H - -#include - -/* Define HAVE_LOCAL_LIBCNOTIFY for local use of libcnotify - */ -#if defined( HAVE_LOCAL_LIBCNOTIFY ) - -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCNOTIFY_DLL_IMPORT - * before including libcnotify.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCNOTIFY_DLL_IMPORT -#endif - -#include - -#endif /* defined( HAVE_LOCAL_LIBCNOTIFY ) */ - -#endif /* !defined( _LIBFDATA_LIBCNOTIFY_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_libfcache.h libbde-20240223/libfdata/libfdata_libfcache.h --- libbde-20190102/libfdata/libfdata_libfcache.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_libfcache.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - * The libfcache header wrapper - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_LIBFCACHE_H ) -#define _LIBFDATA_LIBFCACHE_H - -#include - -/* Define HAVE_LOCAL_LIBFCACHE for local use of libfcache - */ -#if defined( HAVE_LOCAL_LIBFCACHE ) - -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBFCACHE_DLL_IMPORT - * before including libfcache.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBFCACHE_DLL_IMPORT -#endif - -#include - -#endif /* defined( HAVE_LOCAL_LIBFCACHE ) */ - -#endif /* !defined( _LIBFDATA_LIBFCACHE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_list.c libbde-20240223/libfdata/libfdata_list.c --- libbde-20190102/libfdata/libfdata_list.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_list.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,4477 +0,0 @@ -/* - * The list functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_definitions.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_list.h" -#include "libfdata_list_element.h" -#include "libfdata_mapped_range.h" -#include "libfdata_range.h" -#include "libfdata_types.h" -#include "libfdata_unused.h" - -/* Creates a list - * Make sure the value list is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the list - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_list_initialize( - libfdata_list_t **list, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_initialize"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - if( *list != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid list value already set.", - function ); - - return( -1 ); - } - if( ( flags & 0xfe ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported flags: 0x%02" PRIx8 ".", - function ); - - return( -1 ); - } - internal_list = memory_allocate_structure( - libfdata_internal_list_t ); - - if( internal_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create list.", - function ); - - goto on_error; - } - if( memory_set( - internal_list, - 0, - sizeof( libfdata_internal_list_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear list.", - function ); - - memory_free( - internal_list ); - - return( -1 ); - } - if( libcdata_array_initialize( - &( internal_list->elements_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create elements array.", - function ); - - goto on_error; - } - if( libcdata_array_initialize( - &( internal_list->mapped_ranges_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped ranges array.", - function ); - - goto on_error; - } - internal_list->flags |= flags; - internal_list->data_handle = data_handle; - internal_list->free_data_handle = free_data_handle; - internal_list->clone_data_handle = clone_data_handle; - internal_list->read_element_data = read_element_data; - internal_list->write_element_data = write_element_data; - - *list = (libfdata_list_t *) internal_list; - - return( 1 ); - -on_error: - if( internal_list != NULL ) - { - if( internal_list->elements_array != NULL ) - { - libcdata_array_free( - &( internal_list->elements_array ), - NULL, - NULL ); - } - memory_free( - internal_list ); - } - return( -1 ); -} - -/* Frees a list - * Returns 1 if successful or -1 on error - */ -int libfdata_list_free( - libfdata_list_t **list, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_free"; - int result = 1; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - if( *list != NULL ) - { - internal_list = (libfdata_internal_list_t *) *list; - *list = NULL; - - if( libcdata_array_free( - &( internal_list->elements_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the elements array.", - function ); - - result = -1; - } - if( libcdata_array_free( - &( internal_list->mapped_ranges_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the mapped ranges array.", - function ); - - result = -1; - } - if( ( internal_list->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_list->data_handle != NULL ) - { - if( internal_list->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_list->free_data_handle( - &( internal_list->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_list ); - } - return( result ); -} - -/* Clones (duplicates) the list - * Returns 1 if successful or -1 on error - */ -int libfdata_list_clone( - libfdata_list_t **destination_list, - libfdata_list_t *source_list, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_destination_list = NULL; - libfdata_internal_list_t *internal_source_list = NULL; - static char *function = "libfdata_list_clone"; - - if( destination_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination list.", - function ); - - return( -1 ); - } - if( *destination_list != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination list value already set.", - function ); - - return( -1 ); - } - if( source_list == NULL ) - { - *destination_list = NULL; - - return( 1 ); - } - internal_source_list = (libfdata_internal_list_t *) source_list; - - internal_destination_list = memory_allocate_structure( - libfdata_internal_list_t ); - - if( internal_destination_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination list.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_list, - 0, - sizeof( libfdata_internal_list_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination list.", - function ); - - memory_free( - internal_destination_list ); - - return( -1 ); - } - if( internal_source_list->data_handle != NULL ) - { - if( internal_source_list->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source list - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_list->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source list - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_list->clone_data_handle( - &( internal_destination_list->data_handle ), - internal_source_list->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to clone data handle.", - function ); - - goto on_error; - } - } -/* TODO set destination list in destination elements */ - if( libcdata_array_clone( - &( internal_destination_list->elements_array ), - internal_source_list->elements_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_list_element_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination elements array.", - function ); - - goto on_error; - } - if( libcdata_array_clone( - &( internal_destination_list->mapped_ranges_array ), - internal_source_list->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination mapped ranges array.", - function ); - - goto on_error; - } - internal_destination_list->flags = internal_source_list->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; - internal_destination_list->free_data_handle = internal_source_list->free_data_handle; - internal_destination_list->clone_data_handle = internal_source_list->clone_data_handle; - internal_destination_list->read_element_data = internal_source_list->read_element_data; - internal_destination_list->write_element_data = internal_source_list->write_element_data; - - *destination_list = (libfdata_list_t *) internal_destination_list; - - return( 1 ); - -on_error: - if( internal_destination_list != NULL ) - { - if( internal_destination_list->elements_array != NULL ) - { - libcdata_array_free( - &( internal_destination_list->elements_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, - NULL ); - } - if( ( internal_destination_list->data_handle != NULL ) - && ( internal_source_list->free_data_handle != NULL ) ) - { - internal_source_list->free_data_handle( - &( internal_destination_list->data_handle ), - NULL ); - } - memory_free( - internal_destination_list ); - } - return( -1 ); -} - -/* Sets the calculate mapped ranges flag - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_calculate_mapped_ranges_flag( - libfdata_list_t *list, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_set_calculate_mapped_ranges_flag"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* List elements functions - */ - -/* Empties the list - * Returns 1 if successful or -1 on error - */ -int libfdata_list_empty( - libfdata_list_t *list, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_empty"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_empty( - internal_list->elements_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to empty elements array.", - function ); - - return( -1 ); - } - if( libcdata_array_empty( - internal_list->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty mapped ranges array.", - function ); - - return( -1 ); - } - internal_list->size = 0; - - return( 1 ); -} - -/* Resizes the list - * Returns 1 if successful or -1 on error - */ -int libfdata_list_resize( - libfdata_list_t *list, - int number_of_elements, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_resize"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_resize( - internal_list->elements_array, - number_of_elements, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize elements array.", - function ); - - return( -1 ); - } - if( libcdata_array_resize( - internal_list->mapped_ranges_array, - number_of_elements, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize mapped ranges array.", - function ); - - return( -1 ); - } - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Reverses the order of the elements - * Returns 1 if successful or -1 on error - */ -int libfdata_list_reverse( - libfdata_list_t *list, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_reverse"; - int element_index = 0; - int number_of_elements = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_reverse( - internal_list->elements_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to reverse elements array.", - function ); - - return( -1 ); - } - if( libcdata_array_get_number_of_entries( - internal_list->elements_array, - &number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of elements from elements array.", - function ); - - return( -1 ); - } - for( element_index = 0; - element_index < number_of_elements; - element_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_element_set_element_index( - list_element, - element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set list element: %d index.", - function, - element_index ); - - return( -1 ); - } - } - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Retrieves the number of elements of the list - * Returns 1 if successful or -1 on error - */ -int libfdata_list_get_number_of_elements( - libfdata_list_t *list, - int *number_of_elements, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_get_number_of_elements"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_number_of_entries( - internal_list->elements_array, - number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of elements from elements array.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a specific list element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_get_list_element_by_index( - libfdata_list_t *list, - int element_index, - libfdata_list_element_t **element, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_get_list_element_by_index"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Retrieves the data range of a specific element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_get_element_by_index( - libfdata_list_t *list, - int element_index, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_element_by_index"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_element_get_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from list element: %d.", - function, - element_index ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Sets the data range of a specific element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_element_by_index( - libfdata_list_t *list, - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_set_element_by_index"; - off64_t previous_element_offset = 0; - size64_t mapped_size = 0; - size64_t previous_element_size = 0; - uint32_t previous_element_flags = 0; - int previous_element_file_index = 0; - int result = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - off64_t mapped_range_offset = 0; - size64_t mapped_range_size = 0; -#endif - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( list_element == NULL ) - { - if( libfdata_list_element_initialize( - &list_element, - list, - element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create list element.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t *) list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in elements array.", - function, - element_index ); - - libfdata_list_element_free( - &list_element, - NULL ); - - return( -1 ); - } - } - else - { - result = libfdata_list_element_get_mapped_size( - list_element, - &mapped_size, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve mapped size of list element: %d.", - function, - element_index ); - - return( -1 ); - } - else if( result == 0 ) - { - if( libfdata_list_element_get_data_range( - list_element, - &previous_element_file_index, - &previous_element_offset, - &previous_element_size, - &previous_element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range of list element: %d.", - function, - element_index ); - - return( -1 ); - } - } - } - if( libfdata_list_element_set_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range of list element: %d.", - function, - element_index ); - - return( -1 ); - } - /* Make sure the list has a mapped range entry for every element - */ - if( libcdata_array_get_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - element_index ); - - return( -1 ); - } - if( mapped_range == NULL ) - { - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in mapped ranges array.", - function, - element_index ); - - libfdata_mapped_range_free( - &mapped_range, - NULL ); - - return( -1 ); - } - internal_list->size += element_size; - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - } - /* If the size of the element is mapped or if the element size did not change - * there is no need to recalculate the mapped range - */ - else if( ( mapped_size == 0 ) - && ( previous_element_size != element_size ) ) - { - internal_list->size -= previous_element_size; - internal_list->size += element_size; - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_index, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - - if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) == 0 ) - { - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - element_index ); - - return( -1 ); - } - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_index, - mapped_range_offset, - mapped_range_offset + mapped_range_size, - mapped_range_size ); - } - libcnotify_printf( - "\n" ); - } -#endif - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Prepends an element data range - * Returns 1 if successful or -1 on error - */ -int libfdata_list_prepend_element( - libfdata_list_t *list, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_prepend_element"; - off64_t mapped_offset = 0; - int element_index = 0; - int mapped_range_index = -1; - int number_of_elements = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - goto on_error; - } - mapped_offset = internal_list->mapped_offset + (off64_t) internal_list->size; - - if( libfdata_mapped_range_set( - mapped_range, - mapped_offset, - element_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range values.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_list->mapped_ranges_array, - &mapped_range_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append mapped range to array.", - function ); - - goto on_error; - } - if( libfdata_list_element_initialize( - &list_element, - list, - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create list element.", - function ); - - goto on_error; - } - if( libfdata_list_element_set_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range of list element.", - function ); - - goto on_error; - } - if( libcdata_array_prepend_entry( - internal_list->elements_array, - (intptr_t *) list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to prepend list element to elements array.", - function ); - - goto on_error; - } - mapped_range_index = -1; - mapped_range = NULL; - - if( libcdata_array_get_number_of_entries( - internal_list->elements_array, - &number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from elements array.", - function ); - - goto on_error; - } - for( element_index = 0; - element_index < number_of_elements; - element_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - list_element = NULL; - - goto on_error; - } - if( libfdata_list_element_set_element_index( - list_element, - element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set list element: %d index.", - function, - element_index ); - - list_element = NULL; - - goto on_error; - } - } - internal_list->current_element_index = 0; - internal_list->size += element_size; - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); - -on_error: - if( list_element != NULL ) - { - libfdata_list_element_free( - &list_element, - NULL ); - } - if( mapped_range_index != -1 ) - { - libcdata_array_set_entry_by_index( - internal_list->mapped_ranges_array, - mapped_range_index, - NULL, - NULL ); - } - if( mapped_range != NULL ) - { - libfdata_mapped_range_free( - &mapped_range, - NULL ); - } - return( -1 ); -} - -/* Appends an element data range - * Returns 1 if successful or -1 on error - */ -int libfdata_list_append_element( - libfdata_list_t *list, - int *element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_append_element"; - off64_t mapped_offset = 0; - int mapped_range_index = -1; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - goto on_error; - } - mapped_offset = internal_list->mapped_offset + (off64_t) internal_list->size; - - if( libfdata_mapped_range_set( - mapped_range, - mapped_offset, - element_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range values.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_list->mapped_ranges_array, - &mapped_range_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append mapped range to array.", - function ); - - goto on_error; - } - if( libfdata_list_element_initialize( - &list_element, - list, - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create list element.", - function ); - - goto on_error; - } - if( libfdata_list_element_set_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range of list element.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_list->elements_array, - element_index, - (intptr_t *) list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append list element to elements array.", - function ); - - goto on_error; - } - mapped_range_index = -1; - mapped_range = NULL; - - if( libfdata_list_element_set_element_index( - list_element, - *element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set list element index.", - function ); - - list_element = NULL; - - goto on_error; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - *element_index, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - *element_index, - mapped_offset, - mapped_offset + element_size, - element_size ); - - libcnotify_printf( - "\n" ); - } -#endif - internal_list->current_element_index = *element_index; - internal_list->size += element_size; - - return( 1 ); - -on_error: - if( list_element != NULL ) - { - libfdata_list_element_free( - &list_element, - NULL ); - } - if( mapped_range_index != -1 ) - { - libcdata_array_set_entry_by_index( - internal_list->mapped_ranges_array, - mapped_range_index, - NULL, - NULL ); - } - if( mapped_range != NULL ) - { - libfdata_mapped_range_free( - &mapped_range, - NULL ); - } - return( -1 ); -} - -/* Appends the element of the source list to the list - * The source list is emptied if successful - * Returns 1 if successful or -1 on error - */ -int libfdata_list_append_list( - libfdata_list_t *list, - libfdata_list_t *source_list, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_internal_list_t *internal_source_list = NULL; - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_append_list"; - off64_t mapped_range_offset = 0; - size64_t mapped_range_size = 0; - int element_index = 0; - int new_number_of_elements = 0; - int number_of_elements = 0; - int result = 1; - int source_element_index = 0; - int source_number_of_elements = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( source_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source list.", - function ); - - return( -1 ); - } - internal_source_list = (libfdata_internal_list_t *) source_list; - - if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_list_calculate_mapped_ranges( - internal_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - goto on_error; - } - } - if( ( internal_source_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_list_calculate_mapped_ranges( - internal_source_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges of source list.", - function ); - - goto on_error; - } - } - if( ( internal_list->mapped_offset != 0 ) - || ( internal_source_list->mapped_offset != 0 ) ) - { - if( ( (size64_t) internal_list->mapped_offset + internal_list->size ) != (size64_t) internal_source_list->mapped_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid source mapped offset value out of bounds.", - function ); - - goto on_error; - } - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: appending source list with mapped offset: %" PRIi64 " and size: %" PRIu64 " to list with mapped offset: %" PRIi64 " and size: %" PRIu64 "\n", - function, - internal_source_list->mapped_offset, - internal_source_list->size, - internal_list->mapped_offset, - internal_list->size ); - } -#endif - if( libcdata_array_get_number_of_entries( - internal_list->elements_array, - &number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of elements from elements array.", - function ); - - goto on_error; - } - if( libcdata_array_get_number_of_entries( - internal_source_list->elements_array, - &source_number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of elements from source list elements array.", - function ); - - goto on_error; - } - element_index = number_of_elements; - new_number_of_elements = number_of_elements + source_number_of_elements; - - if( libcdata_array_resize( - internal_list->elements_array, - new_number_of_elements, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_element_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize elements array.", - function ); - - goto on_error; - } - if( libcdata_array_resize( - internal_list->mapped_ranges_array, - new_number_of_elements, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize mapped ranges array.", - function ); - - goto on_error; - } - for( source_element_index = 0; - source_element_index < source_number_of_elements; - source_element_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_source_list->elements_array, - source_element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from source list elements array.", - function, - source_element_index ); - - goto on_error; - } - if( libcdata_array_set_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t *) list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in elements array.", - function, - element_index ); - - goto on_error; - } - if( libcdata_array_get_entry_by_index( - internal_source_list->mapped_ranges_array, - source_element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from source list mapped ranges array.", - function, - source_element_index ); - - goto on_error; - } - if( libcdata_array_set_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in mapped ranges array.", - function, - element_index ); - - goto on_error; - } - element_index++; - } - element_index = number_of_elements; - number_of_elements = new_number_of_elements; - new_number_of_elements = 0; - - if( libcdata_array_empty( - internal_source_list->elements_array, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to empty source list elements array.", - function ); - - result = -1; - } - if( libcdata_array_empty( - internal_source_list->mapped_ranges_array, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to empty source list mapped ranges array.", - function ); - - result = -1; - } - internal_source_list->size = 0; - - while( element_index < number_of_elements ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - goto on_error; - } - ( (libfdata_internal_list_element_t *) list_element )->list = list; - ( (libfdata_internal_list_element_t *) list_element )->element_index = element_index; - - if( libcdata_array_get_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - element_index ); - - goto on_error; - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - element_index ); - - goto on_error; - } - if( libfdata_mapped_range_set( - mapped_range, - internal_list->size, - mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set values of mapped range: %d.", - function, - element_index ); - - goto on_error; - } - internal_list->size += mapped_range_size; - - element_index++; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); - -on_error: - if( new_number_of_elements != 0 ) - { - libcdata_array_resize( - internal_list->mapped_ranges_array, - number_of_elements, - NULL, - NULL ); - - libcdata_array_resize( - internal_list->elements_array, - number_of_elements, - NULL, - NULL ); - } - return( -1 ); -} - -/* Determines if a specific element is set - * Returns 1 if element is set, 0 if not or -1 on error - */ -int libfdata_list_is_element_set( - libfdata_list_t *list, - int element_index, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_is_element_set"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( list_element == NULL ) - { - return( 0 ); - } - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Mapped range functions - */ - -/* Retrieves the mapped offset - * Returns 1 if successful, 0 if not set or -1 on error - */ -int libfdata_list_get_mapped_offset( - libfdata_list_t *list, - off64_t *mapped_offset, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_get_mapped_offset"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( mapped_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid mapped offset.", - function ); - - return( -1 ); - } - if( ( internal_list->flags & LIBFDATA_LIST_FLAG_HAS_MAPPED_OFFSET ) == 0 ) - { - return( 0 ); - } - *mapped_offset = internal_list->mapped_offset; - - return( 1 ); -} - -/* Sets the mapped offset - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_mapped_offset( - libfdata_list_t *list, - off64_t mapped_offset, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_set_mapped_offset"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( mapped_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid offset value out of bounds.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped offset: %" PRIi64 "\n", - function, - mapped_offset ); - - libcnotify_printf( - "\n" ); - } -#endif - internal_list->mapped_offset = mapped_offset; - internal_list->flags |= LIBFDATA_LIST_FLAG_HAS_MAPPED_OFFSET | LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Retrieves the mapped size of a specific element - * Returns 1 if successful, 0 if not set or -1 on error - */ -int libfdata_list_get_mapped_size_by_index( - libfdata_list_t *list, - int element_index, - size64_t *mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_mapped_size_by_index"; - int result = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - result = libfdata_list_element_get_mapped_size( - list_element, - mapped_size, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve mapped size of element: %d.", - function, - element_index ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( result ); -} - -/* Sets the mapped size of a specific element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_mapped_size_by_index( - libfdata_list_t *list, - int element_index, - size64_t mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_set_mapped_size_by_index"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_element_set_mapped_size( - list_element, - mapped_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped size of element: %d.", - function, - element_index ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Retrieves the data range with its mapped size of a specific element - * Returns 1 if successful, 0 if the element has no mapped size or -1 on error - */ -int libfdata_list_get_element_by_index_with_mapped_size( - libfdata_list_t *list, - int element_index, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - size64_t *mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_element_by_index_with_mapped_size"; - int result = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_element_get_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from list element: %d.", - function, - element_index ); - - return( -1 ); - } - result = libfdata_list_element_get_mapped_size( - list_element, - mapped_size, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve mapped size of list element: %d.", - function, - element_index ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( result ); -} - -/* Sets the data range of a specific element with its mapped size - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_element_by_index_with_mapped_size( - libfdata_list_t *list, - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - size64_t mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_set_element_by_index_with_mapped_size"; - off64_t previous_element_offset = 0; - size64_t previous_element_size = 0; - size64_t previous_mapped_size = 0; - uint32_t previous_element_flags = 0; - int previous_element_file_index = 0; - int result = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - off64_t mapped_range_offset = 0; - size64_t mapped_range_size = 0; -#endif - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( list_element == NULL ) - { - if( libfdata_list_element_initialize( - &list_element, - list, - element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create list element.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t *) list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in elements array.", - function, - element_index ); - - libfdata_list_element_free( - &list_element, - NULL ); - - return( -1 ); - } - } - else - { - result = libfdata_list_element_get_mapped_size( - list_element, - &previous_mapped_size, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve mapped size of list element: %d.", - function, - element_index ); - - return( -1 ); - } - else if( result == 0 ) - { - if( libfdata_list_element_get_data_range( - list_element, - &previous_element_file_index, - &previous_element_offset, - &previous_element_size, - &previous_element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range of list element: %d.", - function, - element_index ); - - return( -1 ); - } - } - } - if( libfdata_list_element_set_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range of list element: %d.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_element_set_mapped_size( - list_element, - mapped_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped size of list element.", - function ); - - return( -1 ); - } - /* Make sure the list has a mapped range entry for every element - */ - if( libcdata_array_get_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - element_index ); - - return( -1 ); - } - if( mapped_range == NULL ) - { - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in mapped ranges array.", - function, - element_index ); - - libfdata_mapped_range_free( - &mapped_range, - NULL ); - - return( -1 ); - } - internal_list->size += mapped_size; - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - } - else if( previous_mapped_size != mapped_size ) - { - if( previous_mapped_size != 0 ) - { - internal_list->size -= previous_mapped_size; - } - else - { - internal_list->size -= previous_element_size; - } - if( mapped_size != 0 ) - { - internal_list->size += mapped_size; - } - else - { - internal_list->size += element_size; - } - internal_list->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_index, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - - if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) == 0 ) - { - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - element_index ); - - return( -1 ); - } - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_index, - mapped_range_offset, - mapped_range_offset + mapped_range_size, - mapped_range_size ); - } - libcnotify_printf( - "\n" ); - } -#endif - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Appends an element data range with its mapped size - * Returns 1 if successful or -1 on error - */ -int libfdata_list_append_element_with_mapped_size( - libfdata_list_t *list, - int *element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - size64_t mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_append_element_with_mapped_size"; - off64_t mapped_offset = 0; - int mapped_range_index = -1; - uint8_t list_flags = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - goto on_error; - } - mapped_offset = internal_list->mapped_offset + (off64_t) internal_list->size; - - if( libfdata_mapped_range_set( - mapped_range, - mapped_offset, - mapped_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range values.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_list->mapped_ranges_array, - &mapped_range_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append mapped range to array.", - function ); - - goto on_error; - } - if( libfdata_list_element_initialize( - &list_element, - list, - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create list element.", - function ); - - goto on_error; - } - if( libfdata_list_element_set_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range of list element.", - function ); - - goto on_error; - } - list_flags = internal_list->flags; - - if( libfdata_list_element_set_mapped_size( - list_element, - mapped_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped size of list element.", - function ); - - goto on_error; - } - /* Setting the mapped size in the list element will set the calculate mapped ranges flag in the list - * Reset the flag if it was not set before setting the mapped size in the list element - */ - if( ( list_flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) == 0 ) - { - internal_list->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - if( libcdata_array_append_entry( - internal_list->elements_array, - element_index, - (intptr_t *) list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append list element to elements array.", - function ); - - goto on_error; - } - mapped_range_index = -1; - mapped_range = NULL; - - if( libfdata_list_element_set_element_index( - list_element, - *element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set list element index.", - function ); - - list_element = NULL; - - goto on_error; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - *element_index, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - *element_index, - mapped_offset, - mapped_offset + mapped_size, - mapped_size ); - - libcnotify_printf( - "\n" ); - } -#endif - internal_list->current_element_index = *element_index; - internal_list->size += mapped_size; - - return( 1 ); - -on_error: - if( list_element != NULL ) - { - libfdata_list_element_free( - &list_element, - NULL ); - } - if( mapped_range_index != -1 ) - { - libcdata_array_set_entry_by_index( - internal_list->mapped_ranges_array, - mapped_range_index, - NULL, - NULL ); - } - if( mapped_range != NULL ) - { - libfdata_mapped_range_free( - &mapped_range, - NULL ); - } - return( -1 ); -} - -/* Calculates the mapped ranges - * Returns 1 if successful or -1 on error - */ -int libfdata_list_calculate_mapped_ranges( - libfdata_internal_list_t *internal_list, - libcerror_error_t **error ) -{ - libfdata_list_element_t *list_element = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_calculate_mapped_ranges"; - off64_t mapped_offset = 0; - off64_t element_offset = 0; - size64_t element_size = 0; - size64_t mapped_size = 0; - uint32_t element_flags = 0; - int element_file_index = -1; - int element_index = -1; - int number_of_elements = 0; - int result = 0; - - if( internal_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - if( libcdata_array_get_number_of_entries( - internal_list->elements_array, - &number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of elements from elements array.", - function ); - - return( -1 ); - } - mapped_offset = internal_list->mapped_offset; - - for( element_index = 0; - element_index < number_of_elements; - element_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - internal_list->mapped_ranges_array, - element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_element_get_data_range( - list_element, - &element_file_index, - &element_offset, - &element_size, - &element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range of list element: %d.", - function, - element_index ); - - return( -1 ); - } - result = libfdata_list_element_get_mapped_size( - list_element, - &mapped_size, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve mapped size of list element: %d.", - function, - element_index ); - - return( -1 ); - } - else if( result == 0 ) - { - mapped_size = element_size; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_index, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_index, - mapped_offset, - mapped_offset + mapped_size, - mapped_size ); - } -#endif - if( libfdata_mapped_range_set( - mapped_range, - mapped_offset, - mapped_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range: %d values.", - function, - element_index ); - - return( -1 ); - } - mapped_offset += (off64_t) mapped_size; - } - internal_list->size = (size64_t) mapped_offset - internal_list->mapped_offset; - internal_list->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( 1 ); -} - -/* Retrieves the element index for a specific offset - * The element_data_offset value is set to the offset relative to the start of the element - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_list_get_element_index_at_offset( - libfdata_list_t *list, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_list_get_element_index_at_offset"; - off64_t list_offset = 0; - off64_t mapped_range_end_offset = 0; - off64_t mapped_range_start_offset = 0; - size64_t mapped_range_size = 0; - int initial_element_index = 0; - int number_of_elements = 0; - int result = 0; - int search_element_index = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - libfdata_list_element_t *element = NULL; - off64_t element_offset = 0; - size64_t element_size = 0; - uint32_t element_flags = 0; - int element_file_index = -1; -#endif - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid offset value less than zero.", - function ); - - return( -1 ); - } - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - if( element_data_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element data offset.", - function ); - - return( -1 ); - } - if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_list_calculate_mapped_ranges( - internal_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - return( -1 ); - } - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested offset: 0x%08" PRIx64 "\n", - function, - offset ); - } -#endif - if( internal_list->size == 0 ) - { - return( 0 ); - } - if( offset < internal_list->mapped_offset ) - { - return( 0 ); - } - list_offset = offset - internal_list->mapped_offset; - - if( (size64_t) list_offset >= internal_list->size ) - { - return( 0 ); - } - if( libcdata_array_get_number_of_entries( - internal_list->mapped_ranges_array, - &number_of_elements, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from mapped ranges array.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: number of elements: %d\n", - function, - number_of_elements ); - } -#endif - /* This assumes a fairly even distribution of the sizes of the elements - */ - initial_element_index = (int) ( ( number_of_elements * list_offset ) / internal_list->size ); - - /* Look for the corresponding element upwards in the array - */ - for( search_element_index = initial_element_index; - search_element_index < number_of_elements; - search_element_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_list->mapped_ranges_array, - search_element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - search_element_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_start_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - search_element_index ); - - return( -1 ); - } - mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; - - if( mapped_range_end_offset < mapped_range_start_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element: %d - mapped range value out of bounds.", - function, - search_element_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - search_element_index, - mapped_range_start_offset, - mapped_range_end_offset, - mapped_range_size ); - } -#endif - /* Check if the offset is in the mapped range - */ - if( ( offset >= mapped_range_start_offset ) - && ( offset < mapped_range_end_offset ) ) - { - offset -= mapped_range_start_offset; - - break; - } - /* Check if the offset is out of bounds - */ - if( offset < mapped_range_start_offset ) - { - search_element_index = number_of_elements; - - break; - } - } - if( search_element_index >= number_of_elements ) - { - /* Look for the corresponding element downwards in the array - */ - for( search_element_index = initial_element_index; - search_element_index >= 0; - search_element_index-- ) - { - if( libcdata_array_get_entry_by_index( - internal_list->mapped_ranges_array, - search_element_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - search_element_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_start_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - search_element_index ); - - return( -1 ); - } - mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; - - if( mapped_range_end_offset < mapped_range_start_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element: %d - mapped range value out of bounds.", - function, - search_element_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - search_element_index, - mapped_range_start_offset, - mapped_range_end_offset, - mapped_range_size ); - } -#endif - /* Check if the offset is in the mapped range - */ - if( ( offset >= mapped_range_start_offset ) - && ( offset < mapped_range_end_offset ) ) - { - offset -= mapped_range_start_offset; - - break; - } - /* Check if the offset is out of bounds - */ - if( offset > mapped_range_start_offset ) - { - search_element_index--; - - break; - } - } - } - if( ( search_element_index >= 0 ) - && ( search_element_index < number_of_elements ) ) - { - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid offset value out of bounds.", - function ); - - return( -1 ); - } - *element_data_offset = offset; - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - search_element_index, - (intptr_t **) &element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - search_element_index ); - - return( -1 ); - } - if( libfdata_list_element_get_data_range( - element, - &element_file_index, - &element_offset, - &element_size, - &element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range of list element: %d.", - function, - search_element_index ); - - return( -1 ); - } - libcnotify_printf( - "%s: element: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - search_element_index, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - } -#endif - internal_list->current_element_index = search_element_index; - - result = 1; - } - if( result == 1 ) - { - *element_index = search_element_index; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); -} - -/* Retrieves the list element for a specific offset - * The element_data_offset value is set to the offset relative to the start of the element - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_list_get_list_element_at_offset( - libfdata_list_t *list, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - libfdata_list_element_t **element, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_get_list_element_at_offset"; - int result = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid offset value less than zero.", - function ); - - return( -1 ); - } - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - result = libfdata_list_get_element_index_at_offset( - list, - offset, - element_index, - element_data_offset, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element index at offset: 0x%08" PRIx64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - *element_index, - (intptr_t **) element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - *element_index ); - - return( -1 ); - } - } - return( result ); -} - -/* Retrieves the data range of an element at a specific offset - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_list_get_element_at_offset( - libfdata_list_t *list, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_element_at_offset"; - int result = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - result = libfdata_list_get_element_index_at_offset( - list, - offset, - element_index, - element_data_offset, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element index at offset: 0x%08" PRIx64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - *element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - *element_index ); - - return( -1 ); - } - if( libfdata_list_element_get_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range of list element: %d.", - function, - *element_index ); - - return( -1 ); - } - } - return( result ); -} - -/* List element value functions - */ - -/* Caches the element value - * Returns 1 if successful or -1 on error - */ -int libfdata_list_cache_element_value( - libfdata_list_t *list, - libfdata_cache_t *cache, - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - int64_t element_timestamp, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_cache_element_value"; - int cache_entry_index = -1; - int number_of_cache_entries = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( element_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element index value out of bounds.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } - if( internal_list->calculate_cache_entry_index == NULL ) - { - cache_entry_index = element_index % number_of_cache_entries; - } - else - { - cache_entry_index = internal_list->calculate_cache_entry_index( - element_index, - element_file_index, - element_offset, - element_size, - element_flags, - number_of_cache_entries ); - } - if( libfcache_cache_set_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - element_file_index, - element_offset, - element_timestamp, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value in cache entry: %d.", - function, - cache_entry_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the element value - * Returns 1 if successful or -1 on error - */ -int libfdata_list_get_element_value( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_list_element_t *element, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_value_t *cache_value = NULL; - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_get_element_value"; - size64_t element_size = 0; - off64_t cache_value_offset = (off64_t) -1; - off64_t element_offset = 0; - int64_t cache_value_timestamp = 0; - int64_t element_timestamp = 0; - uint32_t element_flags = 0; - int cache_entry_index = -1; - int cache_value_file_index = -1; - int element_file_index = -1; - int element_index = -1; - int number_of_cache_entries = 0; - int result = 0; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( internal_list->read_element_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - missing read element data function.", - function ); - - return( -1 ); - } - if( libfdata_list_element_get_data_range( - element, - &element_file_index, - &element_offset, - &element_size, - &element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from list element.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( libfdata_list_element_get_element_index( - element, - &element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element index from list element.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } - if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) - { - if( internal_list->calculate_cache_entry_index == NULL ) - { - cache_entry_index = element_index % number_of_cache_entries; - } - else - { - cache_entry_index = internal_list->calculate_cache_entry_index( - element_index, - element_file_index, - element_offset, - element_size, - element_flags, - number_of_cache_entries ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfdata_list_element_get_timestamp( - element, - &element_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve time stamp from list element.", - function ); - - return( -1 ); - } - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( element_file_index == cache_value_file_index ) - && ( element_offset == cache_value_offset ) - && ( element_timestamp == cache_value_timestamp ) ) - { - result = 1; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( result == 0 ) - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " miss (%d out of %d)\n", - function, - (intptr_t) cache, - cache_entry_index, - number_of_cache_entries ); - } - else - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " hit (%d out of %d)\n", - function, - (intptr_t) cache, - cache_entry_index, - number_of_cache_entries ); - } - } -#endif - } - if( result == 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading element data at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", - function, - element_offset, - element_offset, - element_size ); - } -#endif - if( internal_list->read_element_data( - internal_list->data_handle, - file_io_handle, - element, - cache, - element_file_index, - element_offset, - element_size, - element_flags, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read element data at offset: 0x%08" PRIx64 ".", - function, - element_offset ); - - return( -1 ); - } - if( internal_list->calculate_cache_entry_index == NULL ) - { - cache_entry_index = element_index % number_of_cache_entries; - } - else - { - cache_entry_index = internal_list->calculate_cache_entry_index( - element_index, - element_file_index, - element_offset, - element_size, - element_flags, - number_of_cache_entries ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfdata_list_element_get_timestamp( - element, - &element_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve time stamp from list element.", - function ); - - return( -1 ); - } - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( element_file_index != cache_value_file_index ) - || ( element_offset != cache_value_offset ) - || ( element_timestamp != cache_value_timestamp ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing cache value.", - function ); - - return( -1 ); - } - } - if( libfcache_cache_value_get_value( - cache_value, - element_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the value of a specific element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_get_element_value_by_index( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_element_value_by_index"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_get_element_value( - list, - file_io_handle, - cache, - list_element, - element_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element value.", - function ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Retrieves the value an element at a specific offset - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_list_get_element_value_at_offset( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_element_value_at_offset"; - int result = 0; - - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - result = libfdata_list_get_list_element_at_offset( - list, - offset, - element_index, - element_data_offset, - &list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element at offset: 0x%08" PRIx64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libfdata_list_get_element_value( - list, - file_io_handle, - cache, - list_element, - element_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element: %d value.", - function, - *element_index ); - - return( -1 ); - } - } - return( result ); -} - -/* Sets the value of a specific element - * - * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_element_value( - libfdata_list_t *list, - intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, - libfdata_cache_t *cache, - libfdata_list_element_t *element, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_list_set_element_value"; - size64_t element_size = 0; - off64_t element_offset = 0; - int64_t element_timestamp = 0; - uint32_t element_flags = 0; - int element_file_index = -1; - int element_index = -1; - - LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) - - if( libfdata_list_element_get_data_range( - element, - &element_file_index, - &element_offset, - &element_size, - &element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from list element.", - function ); - - return( -1 ); - } - if( libfdata_list_element_get_element_index( - element, - &element_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element index from list element.", - function ); - - return( -1 ); - } - if( libfdata_list_element_get_timestamp( - element, - &element_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve time stamp from list element.", - function ); - - return( -1 ); - } - if( libfdata_list_cache_element_value( - list, - cache, - element_index, - element_file_index, - element_offset, - element_size, - element_flags, - element_timestamp, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to cache element value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the value of a specific element - * - * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_list_set_element_value_by_index( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_set_element_value_by_index"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( libcdata_array_get_entry_by_index( - internal_list->elements_array, - element_index, - (intptr_t **) &list_element, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from elements array.", - function, - element_index ); - - return( -1 ); - } - if( libfdata_list_set_element_value( - list, - file_io_handle, - cache, - list_element, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set element value.", - function ); - - return( -1 ); - } - internal_list->current_element_index = element_index; - - return( 1 ); -} - -/* Sets the value of an element at a specific offset - * - * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_list_set_element_value_at_offset( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_set_element_value_at_offset"; - off64_t element_data_offset = 0; - int element_index = 0; - int result = 0; - - result = libfdata_list_get_list_element_at_offset( - list, - offset, - &element_index, - &element_data_offset, - &list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element at offset: 0x%08" PRIx64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libfdata_list_set_element_value( - list, - file_io_handle, - cache, - list_element, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value of element: %d.", - function, - element_index ); - - return( -1 ); - } - } - return( result ); -} - -/* Retrieves the size of the list - * Returns 1 if successful or -1 on error - */ -int libfdata_list_get_size( - libfdata_list_t *list, - size64_t *size, - libcerror_error_t **error ) -{ - libfdata_internal_list_t *internal_list = NULL; - static char *function = "libfdata_list_get_size"; - - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - internal_list = (libfdata_internal_list_t *) list; - - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - if( ( internal_list->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_list_calculate_mapped_ranges( - internal_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - return( -1 ); - } - } - *size = internal_list->size; - - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_list.h libbde-20240223/libfdata/libfdata_list.h --- libbde-20190102/libfdata/libfdata_list.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_list.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,454 +0,0 @@ -/* - * The list functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_LIST_H ) -#define _LIBFDATA_INTERNAL_LIST_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_list libfdata_internal_list_t; - -struct libfdata_internal_list -{ - /* The current (most recently used) element index - */ - int current_element_index; - - /* The mapped offset - */ - off64_t mapped_offset; - - /* The (list) size - */ - size64_t size; - - /* The (list) elements array - */ - libcdata_array_t *elements_array; - - /* The mapped ranges array - */ - libcdata_array_t *mapped_ranges_array; - - /* The flags - */ - uint8_t flags; - - /* The calculate cache entry index value - */ - int (*calculate_cache_entry_index)( - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - int number_of_cache_entries ); - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The read element data function - */ - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The write element data function - */ - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_list_initialize( - libfdata_list_t **list, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_free( - libfdata_list_t **list, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_clone( - libfdata_list_t **destination_list, - libfdata_list_t *source_list, - libcerror_error_t **error ); - -int libfdata_list_set_calculate_mapped_ranges_flag( - libfdata_list_t *list, - libcerror_error_t **error ); - -/* List elements functions - */ -LIBFDATA_EXTERN \ -int libfdata_list_empty( - libfdata_list_t *list, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_resize( - libfdata_list_t *list, - int number_of_elements, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_reverse( - libfdata_list_t *list, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_number_of_elements( - libfdata_list_t *list, - int *number_of_elements, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_list_element_by_index( - libfdata_list_t *list, - int element_index, - libfdata_list_element_t **element, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_element_by_index( - libfdata_list_t *list, - int element_index, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_set_element_by_index( - libfdata_list_t *list, - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_prepend_element( - libfdata_list_t *list, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_append_element( - libfdata_list_t *list, - int *element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_append_list( - libfdata_list_t *list, - libfdata_list_t *source_list, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_is_element_set( - libfdata_list_t *list, - int element_index, - libcerror_error_t **error ); - -/* Mapped range functions - */ -LIBFDATA_EXTERN \ -int libfdata_list_get_mapped_offset( - libfdata_list_t *list, - off64_t *mapped_offset, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_set_mapped_offset( - libfdata_list_t *list, - off64_t mapped_offset, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_mapped_size_by_index( - libfdata_list_t *list, - int element_index, - size64_t *mapped_size, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_set_mapped_size_by_index( - libfdata_list_t *list, - int element_index, - size64_t mapped_size, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_element_by_index_with_mapped_size( - libfdata_list_t *list, - int element_index, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - size64_t *mapped_size, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_set_element_by_index_with_mapped_size( - libfdata_list_t *list, - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - size64_t mapped_size, - libcerror_error_t **error ); - -/* TODO libfdata_list_prepend_element_with_mapped_size */ - -LIBFDATA_EXTERN \ -int libfdata_list_append_element_with_mapped_size( - libfdata_list_t *list, - int *element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - size64_t mapped_size, - libcerror_error_t **error ); - -int libfdata_list_calculate_mapped_ranges( - libfdata_internal_list_t *internal_list, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_element_index_at_offset( - libfdata_list_t *list, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_list_element_at_offset( - libfdata_list_t *list, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - libfdata_list_element_t **element, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_element_at_offset( - libfdata_list_t *list, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - libcerror_error_t **error ); - -/* TODO add libfdata_list_set_element_at_offset */ - -/* List element value functions - */ -LIBFDATA_EXTERN \ -int libfdata_list_cache_element_value( - libfdata_list_t *list, - libfdata_cache_t *cache, - int element_index, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - int64_t element_timestamp, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -int libfdata_list_get_element_value( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_list_element_t *element, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_element_value_by_index( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_get_element_value_at_offset( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - int *element_index, - off64_t *element_data_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_list_set_element_value( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_list_element_t *element, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_set_element_value_by_index( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_set_element_value_at_offset( - libfdata_list_t *list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -/* IO functions - */ -LIBFDATA_EXTERN \ -int libfdata_list_get_size( - libfdata_list_t *list, - size64_t *size, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_LIST_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_list_element.c libbde-20240223/libfdata/libfdata_list_element.c --- libbde-20190102/libfdata/libfdata_list_element.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_list_element.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,824 +0,0 @@ -/* - * The list element functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_definitions.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_list.h" -#include "libfdata_list_element.h" -#include "libfdata_range.h" -#include "libfdata_types.h" - -/* Creates an element - * Make sure the value element is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_initialize( - libfdata_list_element_t **element, - libfdata_list_t *list, - int element_index, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_initialize"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - if( *element != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid element value already set.", - function ); - - return( -1 ); - } - if( list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - if( element_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid element index value less than zero.", - function ); - - return( -1 ); - } - internal_element = memory_allocate_structure( - libfdata_internal_list_element_t ); - - if( internal_element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create element.", - function ); - - goto on_error; - } - if( memory_set( - internal_element, - 0, - sizeof( libfdata_internal_list_element_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear element.", - function ); - - memory_free( - internal_element ); - - return( -1 ); - } - if( libfdata_range_initialize( - &( internal_element->data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create data range.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_element->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - goto on_error; - } - internal_element->list = list; - internal_element->element_index = element_index; - - *element = (libfdata_list_element_t *) internal_element; - - return( 1 ); - -on_error: - if( internal_element != NULL ) - { - if( internal_element->data_range != NULL ) - { - libfdata_range_free( - &( internal_element->data_range ), - NULL ); - } - memory_free( - internal_element ); - } - return( -1 ); -} - -/* Frees an element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_free( - libfdata_list_element_t **element, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_free"; - int result = 1; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - if( *element != NULL ) - { - internal_element = (libfdata_internal_list_element_t *) *element; - *element = NULL; - - if( libfdata_range_free( - &( internal_element->data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data range.", - function ); - - result = -1; - } - memory_free( - internal_element ); - } - return( result ); -} - -/* Clones (duplicates) the element - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_clone( - libfdata_list_element_t **destination_element, - libfdata_list_element_t *source_element, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_destination_element = NULL; - libfdata_internal_list_element_t *internal_source_element = NULL; - static char *function = "libfdata_list_element_clone"; - - if( destination_element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination element.", - function ); - - return( -1 ); - } - if( *destination_element != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: destination element already set.", - function ); - - return( -1 ); - } - if( source_element == NULL ) - { - *destination_element = NULL; - - return( 1 ); - } - internal_source_element = (libfdata_internal_list_element_t *) source_element; - - internal_destination_element = memory_allocate_structure( - libfdata_internal_list_element_t ); - - if( internal_destination_element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination element.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_element, - 0, - sizeof( libfdata_internal_list_element_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination element.", - function ); - - memory_free( - internal_destination_element ); - - return( -1 ); - } - if( libfdata_range_clone( - &( internal_destination_element->data_range ), - internal_source_element->data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination data range.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_destination_element->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve destination timestamp.", - function ); - - goto on_error; - } - internal_destination_element->list = internal_source_element->list; - internal_destination_element->element_index = internal_source_element->element_index; - internal_destination_element->mapped_size = internal_source_element->mapped_size; - - *destination_element = (libfdata_list_element_t *) internal_destination_element; - - return( 1 ); - -on_error: - if( internal_destination_element != NULL ) - { - if( internal_destination_element->data_range != NULL ) - { - libfdata_range_free( - &( internal_destination_element->data_range ), - NULL ); - } - memory_free( - internal_destination_element ); - } - return( -1 ); -} - -/* Retrieves the element index - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_get_element_index( - libfdata_list_element_t *element, - int *element_index, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_get_element_index"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - *element_index = internal_element->element_index; - - return( 1 ); -} - -/* Sets the element index - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_set_element_index( - libfdata_list_element_t *element, - int element_index, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_set_element_index"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( element_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid element index value less than zero.", - function ); - - return( -1 ); - } - internal_element->element_index = element_index; - - return( 1 ); -} - -/* Retrieves the time stamp - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_get_timestamp( - libfdata_list_element_t *element, - int64_t *timestamp, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_get_timestamp"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( timestamp == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid time stamp.", - function ); - - return( -1 ); - } - *timestamp = internal_element->timestamp; - - return( 1 ); -} - -/* Data range functions - */ - -/* Retrieves the data range - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_get_data_range( - libfdata_list_element_t *element, - int *file_index, - off64_t *offset, - size64_t *size, - uint32_t *flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_get_data_range"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( libfdata_range_get( - internal_element->data_range, - file_index, - offset, - size, - flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the data range - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_set_data_range( - libfdata_list_element_t *element, - int file_index, - off64_t offset, - size64_t size, - uint32_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_set_data_range"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( file_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid file index less than zero.", - function ); - - return( -1 ); - } - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid offset value less than zero.", - function ); - - return( -1 ); - } - if( size > (size64_t) INT64_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( libfdata_range_set( - internal_element->data_range, - file_index, - offset, - size, - flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range.", - function ); - - return( -1 ); - } - if( libfcache_date_time_get_timestamp( - &( internal_element->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Mapped range functions - */ - -/* Retrieves the mapped size - * Returns 1 if successful, 0 if not set or -1 on error - */ -int libfdata_list_element_get_mapped_size( - libfdata_list_element_t *element, - size64_t *mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_get_mapped_size"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( mapped_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid mapped size.", - function ); - - return( -1 ); - } - if( ( internal_element->flags & LIBFDATA_LIST_ELEMENT_FLAG_HAS_MAPPED_SIZE ) == 0 ) - { - return( 0 ); - } - *mapped_size = internal_element->mapped_size; - - return( 1 ); -} - -/* Sets the mapped size - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_set_mapped_size( - libfdata_list_element_t *element, - size64_t mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_set_mapped_size"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( mapped_size > (size64_t) INT64_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid mapped size value exceeds maximum.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: element: %03d\tmapped size: %" PRIu64 "\n", - function, - internal_element->element_index, - mapped_size ); - - libcnotify_printf( - "\n" ); - } -#endif - internal_element->mapped_size = mapped_size; - internal_element->flags |= LIBFDATA_LIST_ELEMENT_FLAG_HAS_MAPPED_SIZE; - - if( libfdata_list_set_calculate_mapped_ranges_flag( - internal_element->list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set the calculate mapped ranges flag in list.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Element value functions - */ - -/* Retrieves the element value - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_get_element_value( - libfdata_list_element_t *element, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_get_element_value"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( libfdata_list_get_element_value( - internal_element->list, - file_io_handle, - cache, - element, - element_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the element value - * - * If the flag LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED is set the list element - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_list_element_set_element_value( - libfdata_list_element_t *element, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_list_element_t *internal_element = NULL; - static char *function = "libfdata_list_element_set_element_value"; - - if( element == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element.", - function ); - - return( -1 ); - } - internal_element = (libfdata_internal_list_element_t *) element; - - if( libfdata_list_set_element_value( - internal_element->list, - file_io_handle, - cache, - element, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set element value.", - function ); - - return( -1 ); - } - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_list_element.h libbde-20240223/libfdata/libfdata_list_element.h --- libbde-20190102/libfdata/libfdata_list_element.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_list_element.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ -/* - * The list element functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_LIST_ELEMENT_H ) -#define _LIBFDATA_INTERNAL_LIST_ELEMENT_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_range.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_list_element libfdata_internal_list_element_t; - -struct libfdata_internal_list_element -{ - /* The list reference - */ - libfdata_list_t *list; - - /* The (list) element index - */ - int element_index; - - /* The (element) data range - */ - libfdata_range_t *data_range; - - /* The (element) mapped size - */ - size64_t mapped_size; - - /* The timestamp - */ - int64_t timestamp; - - /* The flags - */ - uint8_t flags; -}; - -int libfdata_list_element_initialize( - libfdata_list_element_t **element, - libfdata_list_t *list, - int element_index, - libcerror_error_t **error ); - -int libfdata_list_element_free( - libfdata_list_element_t **element, - libcerror_error_t **error ); - -int libfdata_list_element_clone( - libfdata_list_element_t **destination_element, - libfdata_list_element_t *source_element, - libcerror_error_t **error ); - -int libfdata_list_element_get_element_index( - libfdata_list_element_t *element, - int *element_index, - libcerror_error_t **error ); - -int libfdata_list_element_set_element_index( - libfdata_list_element_t *element, - int element_index, - libcerror_error_t **error ); - -int libfdata_list_element_get_timestamp( - libfdata_list_element_t *element, - int64_t *timestamp, - libcerror_error_t **error ); - -/* Data range functions - */ -int libfdata_list_element_get_data_range( - libfdata_list_element_t *element, - int *file_index, - off64_t *offset, - size64_t *size, - uint32_t *flags, - libcerror_error_t **error ); - -int libfdata_list_element_set_data_range( - libfdata_list_element_t *element, - int file_index, - off64_t offset, - size64_t size, - uint32_t flags, - libcerror_error_t **error ); - -/* Mapped range functions - */ -LIBFDATA_EXTERN \ -int libfdata_list_element_get_mapped_size( - libfdata_list_element_t *element, - size64_t *mapped_size, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_element_set_mapped_size( - libfdata_list_element_t *element, - size64_t mapped_size, - libcerror_error_t **error ); - -/* Element value functions - */ -LIBFDATA_EXTERN \ -int libfdata_list_element_get_element_value( - libfdata_list_element_t *element, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_list_element_set_element_value( - libfdata_list_element_t *element, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_LIST_ELEMENT_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_mapped_range.c libbde-20240223/libfdata/libfdata_mapped_range.c --- libbde-20190102/libfdata/libfdata_mapped_range.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_mapped_range.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,312 +0,0 @@ -/* - * The (data) mapped range functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_libcerror.h" -#include "libfdata_mapped_range.h" - -/* Creates a mapped range - * Make sure the value mapped_range is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_mapped_range_initialize( - libfdata_mapped_range_t **mapped_range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_mapped_range_initialize"; - - if( mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid mapped range.", - function ); - - return( -1 ); - } - if( *mapped_range != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid mapped range value already set.", - function ); - - return( -1 ); - } - *mapped_range = memory_allocate_structure( - libfdata_mapped_range_t ); - - if( *mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create mapped range.", - function ); - - goto on_error; - } - if( memory_set( - *mapped_range, - 0, - sizeof( libfdata_mapped_range_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear mapped range.", - function ); - - goto on_error; - } - ( *mapped_range )->offset = (off64_t) -1; - - return( 1 ); - -on_error: - if( *mapped_range != NULL ) - { - memory_free( - *mapped_range ); - - *mapped_range = NULL; - } - return( -1 ); -} - -/* Frees a mapped range - * Returns 1 if successful or -1 on error - */ -int libfdata_mapped_range_free( - libfdata_mapped_range_t **mapped_range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_mapped_range_free"; - - if( mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid mapped range.", - function ); - - return( -1 ); - } - if( *mapped_range != NULL ) - { - memory_free( - *mapped_range ); - - *mapped_range = NULL; - } - return( 1 ); -} - -/* Clones (duplicates) the mapped range - * Returns 1 if successful or -1 on error - */ -int libfdata_mapped_range_clone( - libfdata_mapped_range_t **destination_mapped_range, - libfdata_mapped_range_t *source_mapped_range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_mapped_range_clone"; - - if( destination_mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination mapped range.", - function ); - - return( -1 ); - } - if( *destination_mapped_range != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination mapped range value already set.", - function ); - - return( -1 ); - } - if( source_mapped_range == NULL ) - { - *destination_mapped_range = NULL; - - return( 1 ); - } - *destination_mapped_range = memory_allocate_structure( - libfdata_mapped_range_t ); - - if( *destination_mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination mapped range.", - function ); - - goto on_error; - } - if( memory_copy( - *destination_mapped_range, - source_mapped_range, - sizeof( libfdata_mapped_range_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy source to destination mapped range.", - function ); - - goto on_error; - } - return( 1 ); - -on_error: - if( *destination_mapped_range != NULL ) - { - memory_free( - *destination_mapped_range ); - - *destination_mapped_range = NULL; - } - return( -1 ); -} - -/* Retrieves the mapped range values - * Returns 1 if successful or -1 on error - */ -int libfdata_mapped_range_get( - libfdata_mapped_range_t *mapped_range, - off64_t *offset, - size64_t *size, - libcerror_error_t **error ) -{ - static char *function = "libfdata_mapped_range_get"; - - if( mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid mapped range.", - function ); - - return( -1 ); - } - if( offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid offset.", - function ); - - return( -1 ); - } - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - *offset = mapped_range->offset; - *size = mapped_range->size; - - return( 1 ); -} - -/* Sets the mapped range values - * Returns 1 if successful or -1 on error - */ -int libfdata_mapped_range_set( - libfdata_mapped_range_t *mapped_range, - off64_t offset, - size64_t size, - libcerror_error_t **error ) -{ - static char *function = "libfdata_mapped_range_set"; - - if( mapped_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid mapped range.", - function ); - - return( -1 ); - } - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid offset value less than zero.", - function ); - - return( -1 ); - } - if( size > (size64_t) INT64_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - mapped_range->offset = offset; - mapped_range->size = size; - - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_mapped_range.h libbde-20240223/libfdata/libfdata_mapped_range.h --- libbde-20190102/libfdata/libfdata_mapped_range.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_mapped_range.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* - * The (data) mapped range functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_MAPPED_RANGE_H ) -#define _LIBFDATA_MAPPED_RANGE_H - -#include -#include - -#include "libfdata_libcerror.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_mapped_range libfdata_mapped_range_t; - -struct libfdata_mapped_range -{ - /* The (start) offset - */ - off64_t offset; - - /* The size - */ - size64_t size; -}; - -int libfdata_mapped_range_initialize( - libfdata_mapped_range_t **mapped_range, - libcerror_error_t **error ); - -int libfdata_mapped_range_free( - libfdata_mapped_range_t **mapped_range, - libcerror_error_t **error ); - -int libfdata_mapped_range_clone( - libfdata_mapped_range_t **destination_mapped_range, - libfdata_mapped_range_t *source_mapped_range, - libcerror_error_t **error ); - -int libfdata_mapped_range_get( - libfdata_mapped_range_t *mapped_range, - off64_t *offset, - size64_t *size, - libcerror_error_t **error ); - -int libfdata_mapped_range_set( - libfdata_mapped_range_t *mapped_range, - off64_t offset, - size64_t size, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_MAPPED_RANGE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_notify.c libbde-20240223/libfdata/libfdata_notify.c --- libbde-20190102/libfdata/libfdata_notify.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_notify.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * Notification functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) -#include -#endif - -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_notify.h" - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -/* Sets the verbose notification - */ -void libfdata_notify_set_verbose( - int verbose ) -{ - libcnotify_verbose_set( - verbose ); -} - -/* Sets the notification stream - * Returns 1 if successful or -1 on error - */ -int libfdata_notify_set_stream( - FILE *stream, - libcerror_error_t **error ) -{ - static char *function = "libfdata_notify_set_stream"; - - if( libcnotify_stream_set( - stream, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set stream.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Opens the notification stream using a filename - * The stream is opened in append mode - * Returns 1 if successful or -1 on error - */ -int libfdata_notify_stream_open( - const char *filename, - libcerror_error_t **error ) -{ - static char *function = "libfdata_notify_stream_open"; - - if( libcnotify_stream_open( - filename, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open stream.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Closes the notification stream if opened using a filename - * Returns 0 if successful or -1 on error - */ -int libfdata_notify_stream_close( - libcerror_error_t **error ) -{ - static char *function = "libfdata_notify_stream_close"; - - if( libcnotify_stream_close( - error ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open stream.", - function ); - - return( -1 ); - } - return( 0 ); -} - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - diff -Nru libbde-20190102/libfdata/libfdata_notify.h libbde-20240223/libfdata/libfdata_notify.h --- libbde-20190102/libfdata/libfdata_notify.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_notify.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * Notification functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_NOTIFY_H ) -#define _LIBFDATA_NOTIFY_H - -#include -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcerror.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -LIBFDATA_EXTERN \ -void libfdata_notify_set_verbose( - int verbose ); - -LIBFDATA_EXTERN \ -int libfdata_notify_set_stream( - FILE *stream, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_notify_stream_open( - const char *filename, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_notify_stream_close( - libcerror_error_t **error ); - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_NOTIFY_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_range.c libbde-20240223/libfdata/libfdata_range.c --- libbde-20190102/libfdata/libfdata_range.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_range.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,358 +0,0 @@ -/* - * The range functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_libcerror.h" -#include "libfdata_range.h" - -/* Creates a range - * Make sure the value range is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_range_initialize( - libfdata_range_t **range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_initialize"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range.", - function ); - - return( -1 ); - } - if( *range != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid range value already set.", - function ); - - return( -1 ); - } - *range = memory_allocate_structure( - libfdata_range_t ); - - if( *range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create range.", - function ); - - goto on_error; - } - if( memory_set( - *range, - 0, - sizeof( libfdata_range_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear range.", - function ); - - goto on_error; - } - ( *range )->file_index = -1; - ( *range )->offset = (off64_t) -1; - - return( 1 ); - -on_error: - if( *range != NULL ) - { - memory_free( - *range ); - - *range = NULL; - } - return( -1 ); -} - -/* Frees a range - * Returns 1 if successful or -1 on error - */ -int libfdata_range_free( - libfdata_range_t **range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_free"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range.", - function ); - - return( -1 ); - } - if( *range != NULL ) - { - memory_free( - *range ); - - *range = NULL; - } - return( 1 ); -} - -/* Clones (duplicates) the range - * Returns 1 if successful or -1 on error - */ -int libfdata_range_clone( - libfdata_range_t **destination_range, - libfdata_range_t *source_range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_clone"; - - if( destination_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination range.", - function ); - - return( -1 ); - } - if( *destination_range != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination range value already set.", - function ); - - return( -1 ); - } - if( source_range == NULL ) - { - *destination_range = NULL; - - return( 1 ); - } - *destination_range = memory_allocate_structure( - libfdata_range_t ); - - if( *destination_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination range.", - function ); - - goto on_error; - } - if( memory_copy( - *destination_range, - source_range, - sizeof( libfdata_range_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy source to destination range.", - function ); - - goto on_error; - } - return( 1 ); - -on_error: - if( *destination_range != NULL ) - { - memory_free( - *destination_range ); - - *destination_range = NULL; - } - return( -1 ); -} - -/* Retrieves the range values - * Returns 1 if successful or -1 on error - */ -int libfdata_range_get( - libfdata_range_t *range, - int *file_index, - off64_t *offset, - size64_t *size, - uint32_t *flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_get"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range.", - function ); - - return( -1 ); - } - if( file_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid file index.", - function ); - - return( -1 ); - } - if( offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid offset.", - function ); - - return( -1 ); - } - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - if( flags == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid flags.", - function ); - - return( -1 ); - } - *file_index = range->file_index; - *offset = range->offset; - *size = range->size; - *flags = range->flags; - - return( 1 ); -} - -/* Retrieves the size - * Returns 1 if successful or -1 on error - */ -int libfdata_range_get_size( - libfdata_range_t *range, - size64_t *size, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_get_size"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range.", - function ); - - return( -1 ); - } - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - *size = range->size; - - return( 1 ); -} - -/* Sets the range values - * Returns 1 if successful or -1 on error - */ -int libfdata_range_set( - libfdata_range_t *range, - int file_index, - off64_t offset, - size64_t size, - uint32_t flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_range_set"; - - if( range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range.", - function ); - - return( -1 ); - } - range->file_index = file_index; - range->offset = offset; - range->size = size; - range->flags = flags; - - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_range.h libbde-20240223/libfdata/libfdata_range.h --- libbde-20190102/libfdata/libfdata_range.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_range.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -/* - * The range functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_RANGE_H ) -#define _LIBFDATA_RANGE_H - -#include -#include - -#include "libfdata_libcerror.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_range libfdata_range_t; - -struct libfdata_range -{ - /* The file index - */ - int file_index; - - /* The offset - */ - off64_t offset; - - /* The size - */ - size64_t size; - - /* The flags - */ - uint32_t flags; -}; - -int libfdata_range_initialize( - libfdata_range_t **range, - libcerror_error_t **error ); - -int libfdata_range_free( - libfdata_range_t **range, - libcerror_error_t **error ); - -int libfdata_range_clone( - libfdata_range_t **destination_range, - libfdata_range_t *source_range, - libcerror_error_t **error ); - -int libfdata_range_get( - libfdata_range_t *range, - int *file_index, - off64_t *offset, - size64_t *size, - uint32_t *flags, - libcerror_error_t **error ); - -int libfdata_range_get_size( - libfdata_range_t *range, - size64_t *size, - libcerror_error_t **error ); - -int libfdata_range_set( - libfdata_range_t *range, - int file_index, - off64_t offset, - size64_t size, - uint32_t flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_RANGE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_range_list.c libbde-20240223/libfdata/libfdata_range_list.c --- libbde-20190102/libfdata/libfdata_range_list.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_range_list.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1194 +0,0 @@ -/* - * The range list functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_definitions.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_list.h" -#include "libfdata_list_element.h" -#include "libfdata_range_list.h" -#include "libfdata_types.h" - -/* Creates a range list - * Make sure the value range_list is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the range list - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_range_list_initialize( - libfdata_range_list_t **range_list, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - static char *function = "libfdata_range_list_initialize"; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", - function ); - - return( -1 ); - } - if( *range_list != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid range list value already set.", - function ); - - return( -1 ); - } - if( ( flags & 0xfe ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported flags: 0x%02" PRIx8 ".", - function ); - - return( -1 ); - } - internal_range_list = memory_allocate_structure( - libfdata_internal_range_list_t ); - - if( internal_range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create range list.", - function ); - - goto on_error; - } - if( memory_set( - internal_range_list, - 0, - sizeof( libfdata_internal_range_list_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear range list.", - function ); - - memory_free( - internal_range_list ); - - return( -1 ); - } - if( libcdata_range_list_initialize( - &( internal_range_list->elements_range_list ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create elements range list.", - function ); - - goto on_error; - } - internal_range_list->flags |= flags; - internal_range_list->data_handle = data_handle; - internal_range_list->free_data_handle = free_data_handle; - internal_range_list->clone_data_handle = clone_data_handle; - internal_range_list->read_element_data = read_element_data; - internal_range_list->write_element_data = write_element_data; - - *range_list = (libfdata_range_list_t *) internal_range_list; - - return( 1 ); - -on_error: - if( internal_range_list != NULL ) - { - if( internal_range_list->elements_range_list != NULL ) - { - libcdata_range_list_free( - &( internal_range_list->elements_range_list ), - NULL, - NULL ); - } - memory_free( - internal_range_list ); - } - return( -1 ); -} - -/* Frees a range list - * Returns 1 if successful or -1 on error - */ -int libfdata_range_list_free( - libfdata_range_list_t **range_list, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - static char *function = "libfdata_range_list_free"; - int result = 1; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid list.", - function ); - - return( -1 ); - } - if( *range_list != NULL ) - { - internal_range_list = (libfdata_internal_range_list_t *) *range_list; - *range_list = NULL; - - if( libcdata_range_list_free( - &( internal_range_list->elements_range_list ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the elements range list.", - function ); - - result = -1; - } - if( ( internal_range_list->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_range_list->data_handle != NULL ) - { - if( internal_range_list->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid range list - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_range_list->free_data_handle( - &( internal_range_list->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_range_list ); - } - return( result ); -} - -/* Clones (duplicates) the range list - * Returns 1 if successful or -1 on error - */ -int libfdata_range_list_clone( - libfdata_range_list_t **destination_range_list, - libfdata_range_list_t *source_range_list, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_destination_range_list = NULL; - libfdata_internal_range_list_t *internal_source_range_list = NULL; - static char *function = "libfdata_range_list_clone"; - - if( destination_range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination range list.", - function ); - - return( -1 ); - } - if( *destination_range_list != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination range list value already set.", - function ); - - return( -1 ); - } - if( source_range_list == NULL ) - { - *destination_range_list = NULL; - - return( 1 ); - } - internal_source_range_list = (libfdata_internal_range_list_t *) source_range_list; - - internal_destination_range_list = memory_allocate_structure( - libfdata_internal_range_list_t ); - - if( internal_destination_range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination range list.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_range_list, - 0, - sizeof( libfdata_internal_range_list_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination range list.", - function ); - - memory_free( - internal_destination_range_list ); - - return( -1 ); - } - if( internal_source_range_list->data_handle != NULL ) - { - if( internal_source_range_list->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source range list - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_range_list->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source range list - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_range_list->clone_data_handle( - &( internal_destination_range_list->data_handle ), - internal_source_range_list->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination data handle.", - function ); - - goto on_error; - } - } - if( libcdata_range_list_clone( - &( internal_destination_range_list->elements_range_list ), - internal_source_range_list->elements_range_list, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_list_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination elements range list.", - function ); - - goto on_error; - } - internal_destination_range_list->flags = internal_source_range_list->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; - internal_destination_range_list->free_data_handle = internal_source_range_list->free_data_handle; - internal_destination_range_list->clone_data_handle = internal_source_range_list->clone_data_handle; - internal_destination_range_list->read_element_data = internal_source_range_list->read_element_data; - internal_destination_range_list->write_element_data = internal_source_range_list->write_element_data; - - *destination_range_list = (libfdata_range_list_t *) internal_destination_range_list; - - return( 1 ); - -on_error: - if( internal_destination_range_list != NULL ) - { - if( ( internal_destination_range_list->data_handle != NULL ) - && ( internal_source_range_list->free_data_handle != NULL ) ) - { - internal_source_range_list->free_data_handle( - &( internal_destination_range_list->data_handle ), - NULL ); - } - memory_free( - internal_destination_range_list ); - } - return( -1 ); -} - -/* List elements functions - */ - -/* Empties the range list - * Returns 1 if successful or -1 on error - */ -int libfdata_range_list_empty( - libfdata_range_list_t *range_list, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - static char *function = "libfdata_range_list_empty"; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", - function ); - - return( -1 ); - } - internal_range_list = (libfdata_internal_range_list_t *) range_list; - - if( libcdata_range_list_empty( - internal_range_list->elements_range_list, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to empty elements range list.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Mapped range functions - */ - -/* Retrieves the list element for a specific offset - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_range_list_get_list_element_at_offset( - libfdata_range_list_t *range_list, - off64_t offset, - off64_t *element_data_offset, - libfdata_list_element_t **element, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - libfdata_list_t *list = NULL; - static char *function = "libfdata_range_list_get_list_element_at_offset"; - off64_t mapped_range_offset = 0; - size64_t mapped_range_size = 0; - int element_index = 0; - int result = 0; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", - function ); - - return( -1 ); - } - internal_range_list = (libfdata_internal_range_list_t *) range_list; - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested offset: 0x%08" PRIx64 "\n", - function, - offset ); - } -#endif - result = libcdata_range_list_get_range_at_offset( - internal_range_list->elements_range_list, - (uint64_t) offset, - (uint64_t *) &mapped_range_offset, - (uint64_t *) &mapped_range_size, - (intptr_t **) &list, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - mapped_range_offset, - mapped_range_offset + mapped_range_size, - mapped_range_size ); - } -#endif - result = libfdata_list_get_list_element_at_offset( - list, - offset, - &element_index, - element_data_offset, - element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element from list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - element missing for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); -} - -/* Retrieves the data range of an element at a specific offset - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_range_list_get_element_at_offset( - libfdata_range_list_t *range_list, - off64_t offset, - off64_t *element_data_offset, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - libcerror_error_t **error ) -{ - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_list_get_element_at_offset"; - int result = 0; - - result = libfdata_range_list_get_list_element_at_offset( - range_list, - offset, - element_data_offset, - &list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element at offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libfdata_list_element_get_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range of list element at offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - } - return( result ); -} - -/* Inserts an element data range based on its mapped range - * Returns 1 if successful or -1 on error - */ -int libfdata_range_list_insert_element( - libfdata_range_list_t *range_list, - off64_t offset, - size64_t size, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - libfdata_list_t *list = NULL; - libfdata_list_element_t *list_element = NULL; - static char *function = "libfdata_range_list_insert_element"; - off64_t element_data_offset = 0; - off64_t mapped_range_offset = 0; - size64_t element_mapped_size = 0; - size64_t mapped_range_size = 0; - int element_index = 0; - int result = 0; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", - function ); - - return( -1 ); - } - internal_range_list = (libfdata_internal_range_list_t *) range_list; - - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid offset value out of bounds.", - function ); - - return( -1 ); - } - if( size > (size64_t) INT64_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: file index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - element_file_index, - element_offset, - element_offset + element_size, - element_size ); - - libcnotify_printf( - "%s: requested range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - offset, - offset + size, - size ); - } -#endif - result = libcdata_range_list_get_range_at_offset( - internal_range_list->elements_range_list, - (uint64_t) offset, - (uint64_t *) &mapped_range_offset, - (uint64_t *) &mapped_range_size, - (intptr_t **) &list, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - mapped_range_offset, - mapped_range_offset + mapped_range_size, - mapped_range_size ); - } -#endif - result = libfdata_list_get_list_element_at_offset( - list, - offset, - &element_index, - &element_data_offset, - &list_element, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element from list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - element missing for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - if( element_data_offset != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid offset value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_list_element_get_mapped_size( - list_element, - &element_mapped_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve mapped size from list element at offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - if( size != element_mapped_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid size value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_list_element_set_data_range( - list_element, - element_file_index, - element_offset, - element_size, - element_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set data range in list element at offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - } - else - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: no mapped range found.\n", - function ); - } -#endif - if( libfdata_list_initialize( - &list, - internal_range_list->data_handle, - internal_range_list->free_data_handle, - internal_range_list->clone_data_handle, - internal_range_list->read_element_data, - internal_range_list->write_element_data, - LIBFDATA_DATA_HANDLE_FLAG_NON_MANAGED, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create list.", - function ); - - return( -1 ); - } - if( libfdata_list_set_mapped_offset( - list, - offset, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped offset in list.", - function ); - - libfdata_list_free( - &list, - NULL ); - - return( -1 ); - } - if( libfdata_list_append_element_with_mapped_size( - list, - &element_index, - element_file_index, - element_offset, - element_size, - element_flags, - size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append element to list.", - function ); - - libfdata_list_free( - &list, - NULL ); - - return( -1 ); - } - if( libcdata_range_list_insert_range( - internal_range_list->elements_range_list, - (uint64_t) offset, - (uint64_t) size, - (intptr_t *) list, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_list_free, - (int (*)(intptr_t *, intptr_t *, libcerror_error_t **)) &libfdata_list_append_list, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to insert range in elements range list.", - function ); - - libfdata_list_free( - &list, - NULL ); - - return( -1 ); - } - list = NULL; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( 1 ); -} - -/* List element value functions - */ - -/* Retrieves the value an element at a specific offset - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_range_list_get_element_value_at_offset( - libfdata_range_list_t *range_list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - off64_t *element_data_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - libfdata_list_t *list = NULL; - static char *function = "libfdata_range_list_get_element_value_at_offset"; - off64_t mapped_range_offset = 0; - size64_t mapped_range_size = 0; - int element_index = 0; - int result = 0; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", - function ); - - return( -1 ); - } - internal_range_list = (libfdata_internal_range_list_t *) range_list; - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested offset: 0x%08" PRIx64 "\n", - function, - offset ); - } -#endif - result = libcdata_range_list_get_range_at_offset( - internal_range_list->elements_range_list, - (uint64_t) offset, - (uint64_t *) &mapped_range_offset, - (uint64_t *) &mapped_range_size, - (intptr_t **) &list, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - mapped_range_offset, - mapped_range_offset + mapped_range_size, - mapped_range_size ); - } -#endif - result = libfdata_list_get_element_value_at_offset( - list, - file_io_handle, - cache, - offset, - &element_index, - element_data_offset, - element_value, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element value from list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - element value missing for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); -} - -/* Sets the value of an element at a specific offset - * - * If the flag LIBFDATA_RANGE_LIST_VALUE_FLAG_MANAGED is set the list - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_range_list_set_element_value_at_offset( - libfdata_range_list_t *range_list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_range_list_t *internal_range_list = NULL; - libfdata_list_t *list = NULL; - static char *function = "libfdata_range_list_set_element_value_at_offset"; - off64_t mapped_range_offset = 0; - size64_t mapped_range_size = 0; - int result = 0; - - if( range_list == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid range list.", - function ); - - return( -1 ); - } - internal_range_list = (libfdata_internal_range_list_t *) range_list; - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested offset: 0x%08" PRIx64 "\n", - function, - offset ); - } -#endif - result = libcdata_range_list_get_range_at_offset( - internal_range_list->elements_range_list, - (uint64_t) offset, - (uint64_t *) &mapped_range_offset, - (uint64_t *) &mapped_range_size, - (intptr_t **) &list, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve range from elements range list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: mapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - mapped_range_offset, - mapped_range_offset + mapped_range_size, - mapped_range_size ); - } -#endif - result = libfdata_list_set_element_value_at_offset( - list, - file_io_handle, - cache, - offset, - element_value, - free_element_value, - write_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set element value in list for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - else if( result == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - element value missing for offset: %" PRIi64 ".", - function, - offset ); - - return( -1 ); - } - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); -} - diff -Nru libbde-20190102/libfdata/libfdata_range_list.h libbde-20240223/libfdata/libfdata_range_list.h --- libbde-20190102/libfdata/libfdata_range_list.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_range_list.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,214 +0,0 @@ -/* - * The range list functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_RANGE_LIST_H ) -#define _LIBFDATA_INTERNAL_RANGE_LIST_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_range_list libfdata_internal_range_list_t; - -struct libfdata_internal_range_list -{ - /* The (list) elements range list - */ - libcdata_range_list_t *elements_range_list; - - /* The flags - */ - uint8_t flags; - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The read element data function - */ - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The write element data function - */ - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - uint8_t write_flags, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_range_list_initialize( - libfdata_range_list_t **range_list, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_list_element_t *list_element, - libfdata_cache_t *cache, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_range_list_free( - libfdata_range_list_t **range_list, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_range_list_clone( - libfdata_range_list_t **destination_range_list, - libfdata_range_list_t *source_range_list, - libcerror_error_t **error ); - -/* List elements functions - */ -LIBFDATA_EXTERN \ -int libfdata_range_list_empty( - libfdata_range_list_t *range_list, - libcerror_error_t **error ); - -/* Mapped range functions - */ - -LIBFDATA_EXTERN \ -int libfdata_range_list_get_list_element_at_offset( - libfdata_range_list_t *range_list, - off64_t offset, - off64_t *element_data_offset, - libfdata_list_element_t **element, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_range_list_get_element_at_offset( - libfdata_range_list_t *range_list, - off64_t offset, - off64_t *element_data_offset, - int *element_file_index, - off64_t *element_offset, - size64_t *element_size, - uint32_t *element_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_range_list_insert_element( - libfdata_range_list_t *range_list, - off64_t offset, - size64_t size, - int element_file_index, - off64_t element_offset, - size64_t element_size, - uint32_t element_flags, - libcerror_error_t **error ); - -/* List element value functions - */ - -LIBFDATA_EXTERN \ -int libfdata_range_list_get_element_value_at_offset( - libfdata_range_list_t *range_list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - off64_t *element_data_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_range_list_set_element_value_at_offset( - libfdata_range_list_t *range_list, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t offset, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_RANGE_LIST_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_segments_array.c libbde-20240223/libfdata/libfdata_segments_array.c --- libbde-20190102/libfdata/libfdata_segments_array.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_segments_array.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,914 +0,0 @@ -/* - * The segments array functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_mapped_range.h" -#include "libfdata_range.h" -#include "libfdata_segments_array.h" - -/* Retrieves a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_segments_array_get_segment_by_index( - libcdata_array_t *segments_array, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ) -{ - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_segments_array_get_segment_by_index"; - - if( libcdata_array_get_entry_by_index( - segments_array, - segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - segment_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the offset and size of a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_segments_array_set_segment_by_index( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - size64_t *data_size, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_mapped_range_t *mapped_range = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_segments_array_set_segment_by_index"; - off64_t previous_segment_offset = 0; - size64_t previous_segment_size = 0; - uint32_t previous_segment_flags = 0; - int previous_segment_file_index = 0; - - if( data_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data size.", - function ); - - return( -1 ); - } - if( segment_file_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment file index value out of bounds.", - function ); - - return( -1 ); - } - if( segment_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment offset value out of bounds.", - function ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - segments_array, - segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - segment_index ); - - return( -1 ); - } - if( segment_data_range == NULL ) - { - if( libfdata_range_initialize( - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segment data range.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - segments_array, - segment_index, - (intptr_t *) segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d to segments array.", - function, - segment_index ); - - libfdata_range_free( - &segment_data_range, - NULL ); - - return( -1 ); - } - } - else - { - if( libfdata_range_get( - segment_data_range, - &previous_segment_file_index, - &previous_segment_offset, - &previous_segment_size, - &previous_segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - segment_index ); - - return( -1 ); - } - *data_size -= previous_segment_size; - } - if( libfdata_range_set( - segment_data_range, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set segment data range values.", - function ); - - return( -1 ); - } - /* Make sure there is a mapped range entry for every segment - */ - if( libcdata_array_get_entry_by_index( - mapped_ranges_array, - segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - segment_index ); - - return( -1 ); - } - if( mapped_range == NULL ) - { - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - mapped_ranges_array, - segment_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in mapped ranges array.", - function, - segment_index ); - - libfdata_mapped_range_free( - &mapped_range, - NULL ); - - return( -1 ); - } - } - *data_size += segment_size; - - return( 1 ); -} - -/* Prepends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_segments_array_prepend_segment( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - size64_t *data_size, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_mapped_range_t *mapped_range = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_segments_array_prepend_segment"; - int mapped_range_index = -1; - - if( data_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data size.", - function ); - - return( -1 ); - } - if( segment_file_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment file index value out of bounds.", - function ); - - return( -1 ); - } - if( segment_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment offset value out of bounds.", - function ); - - return( -1 ); - } - if( segment_size > (size64_t) INT64_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment size value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - goto on_error; - } - if( libfdata_mapped_range_set( - mapped_range, - (off64_t) *data_size, - segment_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range values.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - mapped_ranges_array, - &mapped_range_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append mapped range to array.", - function ); - - goto on_error; - } - if( libfdata_range_initialize( - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segment data range.", - function ); - - goto on_error; - } - if( libfdata_range_set( - segment_data_range, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set segment data range values.", - function ); - - goto on_error; - } - if( libcdata_array_prepend_entry( - segments_array, - (intptr_t *) segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to prepend data range to segments array.", - function ); - - goto on_error; - } - *data_size += segment_size; - - return( 1 ); - -on_error: - if( segment_data_range != NULL ) - { - libfdata_range_free( - &segment_data_range, - NULL ); - } - if( mapped_range_index != -1 ) - { - libcdata_array_set_entry_by_index( - mapped_ranges_array, - mapped_range_index, - NULL, - NULL ); - } - if( mapped_range != NULL ) - { - libfdata_mapped_range_free( - &mapped_range, - NULL ); - } - return( -1 ); -} - -/* Appends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_segments_array_append_segment( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - size64_t *data_size, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_mapped_range_t *mapped_range = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_segments_array_append_segment"; - int mapped_range_index = -1; - - if( data_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid data size.", - function ); - - return( -1 ); - } - if( segment_file_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment file index value out of bounds.", - function ); - - return( -1 ); - } - if( segment_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment offset value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_mapped_range_initialize( - &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped range.", - function ); - - goto on_error; - } - if( libfdata_mapped_range_set( - mapped_range, - (off64_t) *data_size, - segment_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range values.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - mapped_ranges_array, - &mapped_range_index, - (intptr_t *) mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append mapped range to array.", - function ); - - goto on_error; - } - if( libfdata_range_initialize( - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segment data range.", - function ); - - goto on_error; - } - if( libfdata_range_set( - segment_data_range, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set segment data range values.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - segments_array, - segment_index, - (intptr_t *) segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append data range to segments array.", - function ); - - goto on_error; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - *segment_index, - segment_file_index, - segment_offset, - segment_offset + segment_size, - segment_size ); - - libcnotify_printf( - "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - *segment_index, - *data_size, - *data_size + segment_size, - segment_size ); - - libcnotify_printf( - "\n" ); - } -#endif - *data_size += segment_size; - - return( 1 ); - -on_error: - if( segment_data_range != NULL ) - { - libfdata_range_free( - &segment_data_range, - NULL ); - } - if( mapped_range_index != -1 ) - { - libcdata_array_set_entry_by_index( - mapped_ranges_array, - mapped_range_index, - NULL, - NULL ); - } - if( mapped_range != NULL ) - { - libfdata_mapped_range_free( - &mapped_range, - NULL ); - } - return( -1 ); -} - -/* Calculates the mapped ranges from the segments - * Returns 1 if successful or -1 on error - */ -int libfdata_segments_array_calculate_mapped_ranges( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - libcerror_error_t **error ) -{ - libfdata_mapped_range_t *mapped_range = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_segments_array_calculate_mapped_ranges"; - off64_t mapped_offset = 0; - off64_t segment_offset = 0; - size64_t segment_size = 0; - uint32_t segment_flags = 0; - int number_of_segments = 0; - int segment_file_index = 0; - int segment_index = 0; - - if( libcdata_array_get_number_of_entries( - segments_array, - &number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from segments array.", - function ); - - return( -1 ); - } - for( segment_index = 0; - segment_index < number_of_segments; - segment_index++ ) - { - if( libcdata_array_get_entry_by_index( - segments_array, - segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - segment_index ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - mapped_ranges_array, - segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - segment_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - segment_index, - segment_file_index, - segment_offset, - segment_offset + segment_size, - segment_size ); - - libcnotify_printf( - "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - segment_index, - mapped_offset, - mapped_offset + segment_size, - segment_size ); - } -#endif - if( libfdata_mapped_range_set( - mapped_range, - mapped_offset, - segment_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set mapped range: %d values.", - function, - segment_index ); - - return( -1 ); - } - mapped_offset += (off64_t) segment_size; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( 1 ); -} - -/* Retrieves the segment data range for a specific offset - * Returns 1 if successful or -1 on error - */ -int libfdata_segments_array_get_data_range_at_offset( - libcdata_array_t *segments_array, - off64_t value_offset, - off64_t *segment_data_offset, - libfdata_range_t **segment_data_range, - libcerror_error_t **error ) -{ - static char *function = "libfdata_segments_array_get_data_range_at_offset"; - size64_t segment_size = 0; - int number_of_segments = 0; - int segment_index = 0; - - if( segment_data_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid segment data offset.", - function ); - - return( -1 ); - } - if( segment_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid segment data range.", - function ); - - return( -1 ); - } - if( libcdata_array_get_number_of_entries( - segments_array, - &number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of segments.", - function ); - - return( -1 ); - } - if( number_of_segments <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of segments value out of bounds.", - function ); - - return( -1 ); - } - for( segment_index = 0; - segment_index < number_of_segments; - segment_index++ ) - { - if( libcdata_array_get_entry_by_index( - segments_array, - segment_index, - (intptr_t **) segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment data range: %d from array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_range_get_size( - *segment_data_range, - &segment_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve size from segment data range: %d.", - function, - segment_index ); - - return( -1 ); - } -/* TODO what about compressed data ranges */ - if( (size64_t) value_offset < segment_size ) - { - *segment_data_offset = value_offset; - - break; - } - value_offset -= segment_size; - } - if( segment_index >= number_of_segments ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment index value out of bounds.", - function ); - - return( -1 ); - } - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_segments_array.h libbde-20240223/libfdata/libfdata_segments_array.h --- libbde-20190102/libfdata/libfdata_segments_array.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_segments_array.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/* - * The segments array functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_SEGMENTS_ARRAY_H ) -#define _LIBFDATA_SEGMENTS_ARRAY_H - -#include -#include - -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" - -int libfdata_segments_array_get_segment_by_index( - libcdata_array_t *segments_array, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ); - -int libfdata_segments_array_set_segment_by_index( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - size64_t *data_size, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -int libfdata_segments_array_prepend_segment( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - size64_t *data_size, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -int libfdata_segments_array_append_segment( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - size64_t *data_size, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -int libfdata_segments_array_calculate_mapped_ranges( - libcdata_array_t *segments_array, - libcdata_array_t *mapped_ranges_array, - libcerror_error_t **error ); - -int libfdata_segments_array_get_data_range_at_offset( - libcdata_array_t *segments_array, - off64_t value_offset, - off64_t *segment_data_offset, - libfdata_range_t **segment_data_range, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -extern "C" { -#endif - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_SEGMENTS_ARRAY_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_stream.c libbde-20240223/libfdata/libfdata_stream.c --- libbde-20190102/libfdata/libfdata_stream.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_stream.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2542 +0,0 @@ -/* - * The stream functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#if defined( HAVE_UNISTD_H ) -#include -#endif - -#include "libfdata_definitions.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_mapped_range.h" -#include "libfdata_range.h" -#include "libfdata_segments_array.h" -#include "libfdata_stream.h" -#include "libfdata_types.h" -#include "libfdata_unused.h" - -/* Creates a stream - * Make sure the value stream is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the stream - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_initialize( - libfdata_stream_t **stream, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*create_segment)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ), - ssize_t (*read_segment_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - uint8_t *segment_data, - size_t segment_data_size, - uint32_t segment_flags, - uint8_t read_flags, - libcerror_error_t **error ), - ssize_t (*write_segment_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - const uint8_t *segment_data, - size_t segment_data_size, - uint32_t segment_flags, - uint8_t write_flags, - libcerror_error_t **error ), - off64_t (*seek_segment_offset)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - off64_t segment_offset, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_initialize"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - if( *stream != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid stream value already set.", - function ); - - return( -1 ); - } - if( ( flags & 0xfe ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported flags: 0x%02" PRIx8 ".", - function ); - - return( -1 ); - } - internal_stream = memory_allocate_structure( - libfdata_internal_stream_t ); - - if( internal_stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create stream.", - function ); - - goto on_error; - } - if( memory_set( - internal_stream, - 0, - sizeof( libfdata_internal_stream_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear stream.", - function ); - - memory_free( - internal_stream ); - - return( -1 ); - } - if( libcdata_array_initialize( - &( internal_stream->segments_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segments array.", - function ); - - goto on_error; - } - if( libcdata_array_initialize( - &( internal_stream->mapped_ranges_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped ranges array.", - function ); - - goto on_error; - } - internal_stream->flags |= flags; - internal_stream->data_handle = data_handle; - internal_stream->free_data_handle = free_data_handle; - internal_stream->clone_data_handle = clone_data_handle; - internal_stream->create_segment = create_segment; - internal_stream->read_segment_data = read_segment_data; - internal_stream->write_segment_data = write_segment_data; - internal_stream->seek_segment_offset = seek_segment_offset; - - *stream = (libfdata_stream_t *) internal_stream; - - return( 1 ); - -on_error: - if( internal_stream != NULL ) - { - if( internal_stream->segments_array != NULL ) - { - libcdata_array_free( - &( internal_stream->segments_array ), - NULL, - NULL ); - } - memory_free( - internal_stream ); - } - return( -1 ); -} - -/* Frees a stream - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_free( - libfdata_stream_t **stream, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_free"; - int result = 1; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - if( *stream != NULL ) - { - internal_stream = (libfdata_internal_stream_t *) *stream; - *stream = NULL; - - if( libcdata_array_free( - &( internal_stream->segments_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the segments array.", - function ); - - result = -1; - } - if( libcdata_array_free( - &( internal_stream->mapped_ranges_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the mapped ranges array.", - function ); - - result = -1; - } - if( ( internal_stream->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_stream->data_handle != NULL ) - { - if( internal_stream->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source stream - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_stream->free_data_handle( - &( internal_stream->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_stream ); - } - return( result ); -} - -/* Clones (duplicates) the stream - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_clone( - libfdata_stream_t **destination_stream, - libfdata_stream_t *source_stream, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_destination_stream = NULL; - libfdata_internal_stream_t *internal_source_stream = NULL; - static char *function = "libfdata_stream_clone"; - - if( destination_stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination stream.", - function ); - - return( -1 ); - } - if( *destination_stream != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: destination stream already set.", - function ); - - return( -1 ); - } - if( source_stream == NULL ) - { - *destination_stream = NULL; - - return( 1 ); - } - internal_source_stream = (libfdata_internal_stream_t *) source_stream; - - internal_destination_stream = memory_allocate_structure( - libfdata_internal_stream_t ); - - if( internal_destination_stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination stream.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_stream, - 0, - sizeof( libfdata_internal_stream_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination stream.", - function ); - - memory_free( - internal_destination_stream ); - - return( -1 ); - } - if( internal_source_stream->data_handle != NULL ) - { - if( internal_source_stream->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source stream - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_stream->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source stream - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_stream->clone_data_handle( - &( internal_destination_stream->data_handle ), - internal_source_stream->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination data handle.", - function ); - - goto on_error; - } - } - if( libcdata_array_clone( - &( internal_destination_stream->segments_array ), - internal_source_stream->segments_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination segments array.", - function ); - - goto on_error; - } - if( libcdata_array_clone( - &( internal_destination_stream->mapped_ranges_array ), - internal_source_stream->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination mapped ranges array.", - function ); - - goto on_error; - } - internal_destination_stream->flags = internal_source_stream->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; - internal_destination_stream->free_data_handle = internal_source_stream->free_data_handle; - internal_destination_stream->clone_data_handle = internal_source_stream->clone_data_handle; - internal_destination_stream->create_segment = internal_source_stream->create_segment; - internal_destination_stream->read_segment_data = internal_source_stream->read_segment_data; - internal_destination_stream->write_segment_data = internal_source_stream->write_segment_data; - internal_destination_stream->seek_segment_offset = internal_source_stream->seek_segment_offset; - - *destination_stream = (libfdata_stream_t *) internal_destination_stream; - - return( 1 ); - -on_error: - if( internal_destination_stream != NULL ) - { - if( internal_destination_stream->segments_array != NULL ) - { - libcdata_array_free( - &( internal_destination_stream->segments_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - NULL ); - } - if( ( internal_destination_stream->data_handle != NULL ) - && ( internal_source_stream->free_data_handle != NULL ) ) - { - internal_source_stream->free_data_handle( - &( internal_destination_stream->data_handle ), - NULL ); - } - memory_free( - internal_destination_stream ); - } - return( -1 ); -} - -/* Segment functions - */ - -/* Empties the stream - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_empty( - libfdata_stream_t *stream, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_empty"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libcdata_array_empty( - internal_stream->segments_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty segments array.", - function ); - - return( -1 ); - } - if( libcdata_array_empty( - internal_stream->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty mapped ranges array.", - function ); - - return( -1 ); - } - internal_stream->size = 0; - - return( 1 ); -} - -/* Resizes the stream - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_resize( - libfdata_stream_t *stream, - int number_of_segments, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_resize"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libcdata_array_resize( - internal_stream->segments_array, - number_of_segments, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize segments array.", - function ); - - return( -1 ); - } - if( libcdata_array_resize( - internal_stream->mapped_ranges_array, - number_of_segments, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize mapped ranges array.", - function ); - - return( -1 ); - } - internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Reverses the order of the segments - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_reverse( - libfdata_stream_t *stream, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_reverse"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libcdata_array_reverse( - internal_stream->segments_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to reverse segments array.", - function ); - - return( -1 ); - } - internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Retrieves the number of segments - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_get_number_of_segments( - libfdata_stream_t *stream, - int *number_of_segments, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_get_number_of_segments"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libcdata_array_get_number_of_entries( - internal_stream->segments_array, - number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from segments array.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_get_segment_by_index( - libfdata_stream_t *stream, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_get_segment_by_index"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libfdata_segments_array_get_segment_by_index( - internal_stream->segments_array, - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d.", - function, - segment_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_set_segment_by_index( - libfdata_stream_t *stream, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_set_segment_by_index"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libfdata_segments_array_set_segment_by_index( - internal_stream->segments_array, - internal_stream->mapped_ranges_array, - &( internal_stream->size ), - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set segment: %d.", - function, - segment_index ); - - return( -1 ); - } - internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Prepends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_prepend_segment( - libfdata_stream_t *stream, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_prepend_segment"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libfdata_segments_array_prepend_segment( - internal_stream->segments_array, - internal_stream->mapped_ranges_array, - &( internal_stream->size ), - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to prepend segment.", - function ); - - return( -1 ); - } - internal_stream->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Appends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_append_segment( - libfdata_stream_t *stream, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_append_segment"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libfdata_segments_array_append_segment( - internal_stream->segments_array, - internal_stream->mapped_ranges_array, - &( internal_stream->size ), - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append segment.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the mapped size - * The mapped size cannot be larger than the stream size - * A value of 0 is equivalent for the stream size - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_set_mapped_size( - libfdata_stream_t *stream, - size64_t mapped_size, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_set_mapped_size"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( mapped_size > internal_stream->size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid mapped size value out of bounds.", - function ); - - return( -1 ); - } - internal_stream->mapped_size = mapped_size; - - return( 1 ); -} - -/* Mapped range functions - */ - -/* Retrieves the mapped range of a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_get_segment_mapped_range( - libfdata_stream_t *stream, - int segment_index, - off64_t *mapped_range_offset, - size64_t *mapped_range_size, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_stream_get_segment_mapped_range"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( libcdata_array_get_entry_by_index( - internal_stream->mapped_ranges_array, - segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - mapped_range_offset, - mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - segment_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the segment index for a specific offset - * The segment_data_offset value is set to the offset relative to the start of the segment - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_stream_get_segment_index_at_offset( - libfdata_stream_t *stream, - off64_t offset, - int *segment_index, - off64_t *segment_data_offset, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_stream_get_segment_index_at_offset"; - off64_t mapped_range_end_offset = 0; - off64_t mapped_range_start_offset = 0; - size64_t mapped_range_size = 0; - size64_t stream_size = 0; - int initial_segment_index = 0; - int number_of_segments = 0; - int result = 0; - int search_segment_index = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - libfdata_range_t *segment_data_range = NULL; - off64_t segment_offset = 0; - size64_t segment_size = 0; - uint32_t segment_flags = 0; - int segment_file_index = -1; -#endif - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid offset value less than zero.", - function ); - - return( -1 ); - } - if( segment_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid segment index.", - function ); - - return( -1 ); - } - if( segment_data_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid segment data offset.", - function ); - - return( -1 ); - } - if( ( internal_stream->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_segments_array_calculate_mapped_ranges( - internal_stream->segments_array, - internal_stream->mapped_ranges_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - return( -1 ); - } - internal_stream->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested offset: 0x%08" PRIx64 "\n", - function, - offset ); - } -#endif - if( internal_stream->mapped_size != 0 ) - { - stream_size = internal_stream->mapped_size; - } - else - { - stream_size = internal_stream->size; - } - if( stream_size == 0 ) - { - return( 0 ); - } - if( libcdata_array_get_number_of_entries( - internal_stream->mapped_ranges_array, - &number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from mapped ranges array.", - function ); - - return( -1 ); - } - /* This assumes a fairly even distribution of the sizes of the segments - */ - initial_segment_index = (int) ( ( number_of_segments * offset ) / stream_size ); - - /* Look for the corresponding segment upwards in the array - */ - for( search_segment_index = initial_segment_index; - search_segment_index < number_of_segments; - search_segment_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_stream->mapped_ranges_array, - search_segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - search_segment_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_start_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - search_segment_index ); - - return( -1 ); - } - mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; - - if( mapped_range_end_offset < mapped_range_start_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment: %d - mapped range value out of bounds.", - function, - search_segment_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - search_segment_index, - mapped_range_start_offset, - mapped_range_end_offset, - mapped_range_size ); - } -#endif - /* Check if the offset is in the mapped range - */ - if( ( offset >= mapped_range_start_offset ) - && ( offset < mapped_range_end_offset ) ) - { - offset -= mapped_range_start_offset; - - break; - } - /* Check if the offset is out of bounds - */ - if( offset < mapped_range_start_offset ) - { - search_segment_index = number_of_segments; - - break; - } - } - if( search_segment_index >= number_of_segments ) - { - /* Look for the corresponding segment downwards in the array - */ - for( search_segment_index = initial_segment_index; - search_segment_index >= 0; - search_segment_index-- ) - { - if( libcdata_array_get_entry_by_index( - internal_stream->mapped_ranges_array, - search_segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - search_segment_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_start_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - search_segment_index ); - - return( -1 ); - } - mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; - - if( mapped_range_end_offset < mapped_range_start_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment: %d - mapped range value out of bounds.", - function, - search_segment_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - search_segment_index, - mapped_range_start_offset, - mapped_range_end_offset, - mapped_range_size ); - } -#endif - /* Check if the offset is in the mapped range - */ - if( ( offset >= mapped_range_start_offset ) - && ( offset < mapped_range_end_offset ) ) - { - offset -= mapped_range_start_offset; - - break; - } - /* Check if the offset is out of bounds - */ - if( offset > mapped_range_start_offset ) - { - search_segment_index--; - - break; - } - } - } - if( ( search_segment_index >= 0 ) - && ( search_segment_index < number_of_segments ) ) - { - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid offset value out of bounds.", - function ); - - return( -1 ); - } - *segment_data_offset = offset; - -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( libcdata_array_get_entry_by_index( - internal_stream->segments_array, - search_segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - search_segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - search_segment_index ); - - return( -1 ); - } - libcnotify_printf( - "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - search_segment_index, - segment_file_index, - segment_offset, - segment_offset + segment_size, - segment_size ); - } -#endif - result = 1; - } - if( result == 1 ) - { - *segment_index = search_segment_index; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); -} - -/* Retrieves the segment for a specific offset - * The segment_data_offset value is set to the offset relative to the start of the segment - * Returns 1 if successful, 0 if not or -1 on error - */ -int libfdata_stream_get_segment_at_offset( - libfdata_stream_t *stream, - off64_t offset, - int *segment_index, - off64_t *segment_data_offset, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_stream_get_segment_at_offset"; - int result = 0; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( segment_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid segment index.", - function ); - - return( -1 ); - } - result = libfdata_stream_get_segment_index_at_offset( - stream, - offset, - segment_index, - segment_data_offset, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment index at offset: 0x%08" PRIx64 ".", - function, - offset ); - - return( -1 ); - } - else if( result != 0 ) - { - if( libcdata_array_get_entry_by_index( - internal_stream->segments_array, - *segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - *segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - *segment_index ); - - return( -1 ); - } - } - return( result ); -} - -/* IO functions - */ - -/* Reads data from the current offset into a buffer - * Returns the number of bytes read or -1 on error - */ -ssize_t libfdata_stream_read_buffer( - libfdata_stream_t *stream, - intptr_t *file_io_handle, - uint8_t *buffer, - size_t buffer_size, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_stream_read_buffer"; - off64_t result_offset = 0; - off64_t segment_offset = 0; - size64_t segment_size = 0; - size64_t segment_data_size = 0; - size64_t stream_size = 0; - size_t buffer_offset = 0; - size_t read_size = 0; - ssize_t read_count = 0; - uint32_t segment_flags = 0; - int segment_file_index = 0; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( internal_stream->read_segment_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid stream - missing read segment data function.", - function ); - - return( -1 ); - } - if( internal_stream->seek_segment_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid stream - missing seek segment offset function.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( buffer_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid buffer size value exceeds maximum.", - function ); - - return( -1 ); - } - if( internal_stream->current_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - current offset value out of bounds.", - function ); - - return( -1 ); - } - if( internal_stream->mapped_size != 0 ) - { - stream_size = internal_stream->mapped_size; - } - else - { - stream_size = internal_stream->size; - } - /* Bail out early for requests to read empty buffers and beyond the end of the stream - */ - if( ( buffer_size == 0 ) - || ( (size64_t) internal_stream->current_offset >= stream_size ) ) - { - return( 0 ); - } - if( (size64_t) ( internal_stream->current_offset + buffer_size ) > stream_size ) - { - buffer_size = (size_t) ( stream_size - internal_stream->current_offset ); - } - if( libcdata_array_get_entry_by_index( - internal_stream->segments_array, - internal_stream->current_segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - if( ( internal_stream->segment_data_offset < 0 ) - || ( (size64_t) internal_stream->segment_data_offset >= segment_size ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - segment data offset value out of bounds.", - function ); - - return( -1 ); - } - segment_offset += internal_stream->segment_data_offset; - - segment_data_size = segment_size - internal_stream->segment_data_offset; - - result_offset = internal_stream->seek_segment_offset( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - segment_file_index, - segment_offset, - error ); - - if( result_offset != segment_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek segment: %d offset: %" PRIi64 ".", - function, - internal_stream->current_segment_index, - segment_offset ); - - return( -1 ); - } - while( buffer_size > 0 ) - { - if( (size64_t) buffer_size <= segment_data_size ) - { - read_size = buffer_size; - } - else - { - read_size = (size_t) segment_data_size; - } - if( read_size == 0 ) - { - break; - } - read_count = internal_stream->read_segment_data( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - segment_file_index, - &( buffer[ buffer_offset ]), - read_size, - segment_flags, - read_flags, - error ); - - if( read_count != (ssize_t) read_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read segment: %d data at offset: 0x%08" PRIx64 ".", - function, - internal_stream->current_segment_index, - segment_offset ); - - return( -1 ); - } - internal_stream->current_offset += read_size; - internal_stream->segment_data_offset += read_size; - segment_offset += read_size; - segment_data_size -= read_size; - buffer_size -= read_size; - buffer_offset += read_size; - - if( (size64_t) internal_stream->current_offset >= stream_size ) - { - break; - } - if( (size64_t) internal_stream->segment_data_offset >= segment_size ) - { - if( (size64_t) internal_stream->segment_data_offset > segment_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - segment data offset value out of bounds.", - function ); - - return( -1 ); - } - internal_stream->current_segment_index++; - - internal_stream->segment_data_offset = 0; - - if( libcdata_array_get_entry_by_index( - internal_stream->segments_array, - internal_stream->current_segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - segment_data_size = segment_size; - - result_offset = internal_stream->seek_segment_offset( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - segment_file_index, - segment_offset, - error ); - - if( result_offset != segment_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek segment: %d offset: %" PRIi64 ".", - function, - internal_stream->current_segment_index, - segment_offset ); - - return( -1 ); - } - } - } - return( (ssize_t) buffer_offset ); -} - -/* Reads data at a specific offset into a buffer - * Returns the number of bytes read or -1 on error - */ -ssize_t libfdata_stream_read_buffer_at_offset( - libfdata_stream_t *stream, - intptr_t *file_io_handle, - uint8_t *buffer, - size_t buffer_size, - off64_t offset, - uint8_t read_flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_stream_read_buffer_at_offset"; - ssize_t read_count = 0; - - if( libfdata_stream_seek_offset( - stream, - offset, - SEEK_SET, - error ) == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek offset.", - function ); - - return( -1 ); - } - read_count = libfdata_stream_read_buffer( - stream, - file_io_handle, - buffer, - buffer_size, - read_flags, - error ); - - if( read_count < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read buffer.", - function ); - - return( -1 ); - } - return( read_count ); -} - -/* Writes data in the buffer to the current offset - * Returns the number of bytes written or -1 on error - */ -ssize_t libfdata_stream_write_buffer( - libfdata_stream_t *stream, - intptr_t *file_io_handle, - const uint8_t *buffer, - size_t buffer_size, - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_stream_write_buffer"; - off64_t result_offset = 0; - off64_t segment_offset = 0; - size64_t segment_size = 0; - size64_t segment_data_size = 0; - size_t buffer_offset = 0; - size_t write_size = 0; - ssize_t write_count = 0; - uint32_t segment_flags = 0; - int number_of_segments = 0; - int result = 0; - int segment_file_index = 0; - int segment_index = 0; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( internal_stream->create_segment == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid stream - missing create segment function.", - function ); - - return( -1 ); - } - if( internal_stream->write_segment_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid stream - missing write segment data function.", - function ); - - return( -1 ); - } - if( internal_stream->seek_segment_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid stream - missing seek segment offset function.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( buffer_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid buffer size value exceeds maximum.", - function ); - - return( -1 ); - } - if( internal_stream->current_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - current offset value out of bounds.", - function ); - - return( -1 ); - } - /* Bail out early for requests to write empty buffers - */ - if( buffer_size == 0 ) - { - return( 0 ); - } - if( libcdata_array_get_number_of_entries( - internal_stream->segments_array, - &number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from segments array.", - function ); - - return( -1 ); - } - if( (size64_t) internal_stream->current_offset < internal_stream->size ) - { - if( libcdata_array_get_entry_by_index( - internal_stream->segments_array, - internal_stream->current_segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - if( ( internal_stream->segment_data_offset < 0 ) - || ( (size64_t) internal_stream->segment_data_offset >= segment_size ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - segment data offset value out of bounds.", - function ); - - return( -1 ); - } - segment_offset += internal_stream->segment_data_offset; - - segment_data_size = segment_size - internal_stream->segment_data_offset; - } - else while( (size64_t) internal_stream->current_offset >= internal_stream->size ) - { - if( internal_stream->current_segment_index < number_of_segments ) - { - internal_stream->current_segment_index++; - } - internal_stream->segment_data_offset = 0; - - result = internal_stream->create_segment( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segment: %d.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - else if( result == 0 ) - { - return( 0 ); - } - if( libfdata_stream_append_segment( - stream, - &segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append segment to stream.", - function ); - - return( -1 ); - } - if( internal_stream->current_segment_index != segment_index ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment index value out of bounds.", - function ); - - return( -1 ); - } - number_of_segments++; - - segment_data_size = segment_size; - } - result_offset = internal_stream->seek_segment_offset( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - segment_file_index, - segment_offset, - error ); - - if( result_offset != segment_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek segment: %d offset: %" PRIi64 ".", - function, - internal_stream->current_segment_index, - segment_offset ); - - return( -1 ); - } - while( buffer_size > 0 ) - { - if( (size64_t) buffer_size <= segment_data_size ) - { - write_size = buffer_size; - } - else - { - write_size = (size_t) segment_data_size; - } - if( write_size == 0 ) - { - break; - } - write_count = internal_stream->write_segment_data( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - segment_file_index, - &( buffer[ buffer_offset ] ), - write_size, - segment_flags, - write_flags, - error ); - - if( write_count != (ssize_t) write_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_WRITE_FAILED, - "%s: unable to write segment: %d data at offset: 0x%08" PRIx64 ".", - function, - internal_stream->current_segment_index, - segment_offset + internal_stream->segment_data_offset ); - - return( -1 ); - } - internal_stream->current_offset += write_size; - internal_stream->segment_data_offset += write_size; - segment_offset += write_size; - segment_data_size -= write_size; - buffer_size -= write_size; - buffer_offset += write_size; - - if( (size64_t) internal_stream->segment_data_offset >= segment_size ) - { - if( (size64_t) internal_stream->segment_data_offset > segment_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - segment data offset value out of bounds.", - function ); - - return( -1 ); - } - internal_stream->current_segment_index++; - - internal_stream->segment_data_offset = 0; - - if( internal_stream->current_segment_index < number_of_segments ) - { - if( libcdata_array_get_entry_by_index( - internal_stream->segments_array, - internal_stream->current_segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - } - else - { - result = internal_stream->create_segment( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segment: %d.", - function, - internal_stream->current_segment_index ); - - return( -1 ); - } - else if( result == 0 ) - { - break; - } - if( libfdata_stream_append_segment( - stream, - &segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append segment to stream.", - function ); - - return( -1 ); - } - if( internal_stream->current_segment_index != segment_index ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment index value out of bounds.", - function ); - - return( -1 ); - } - number_of_segments++; - } - segment_data_size = segment_size; - - result_offset = internal_stream->seek_segment_offset( - internal_stream->data_handle, - file_io_handle, - internal_stream->current_segment_index, - segment_file_index, - segment_offset, - error ); - - if( result_offset != segment_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek segment: %d offset: %" PRIi64 ".", - function, - internal_stream->current_segment_index, - segment_offset ); - - return( -1 ); - } - } - } - return( (ssize_t) buffer_offset ); -} - -/* Seeks a certain offset of the data - * Returns the offset if seek is successful or -1 on error - */ -off64_t libfdata_stream_seek_offset( - libfdata_stream_t *stream, - off64_t offset, - int whence, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_seek_offset"; - off64_t segment_data_offset = 0; - size64_t stream_size = 0; - int segment_index = 0; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( internal_stream->current_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid stream - current offset value out of bounds.", - function ); - - return( -1 ); - } - if( ( whence != SEEK_CUR ) - && ( whence != SEEK_END ) - && ( whence != SEEK_SET ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported whence.", - function ); - - return( -1 ); - } - if( internal_stream->mapped_size != 0 ) - { - stream_size = internal_stream->mapped_size; - } - else - { - stream_size = internal_stream->size; - } - if( whence == SEEK_CUR ) - { - offset += internal_stream->current_offset; - } - else if( whence == SEEK_END ) - { - offset += (off64_t) stream_size; - } -#if defined( HAVE_VERBOSE_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: seeking offset: %" PRIi64 ".\n", - function, - offset ); - } -#endif - if( offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: offset value out of bounds.", - function ); - - return( -1 ); - } - if( offset < (off64_t) stream_size ) - { - if( libfdata_stream_get_segment_index_at_offset( - stream, - offset, - &segment_index, - &segment_data_offset, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment index at offset: 0x%08" PRIx64 ".", - function, - offset ); - - return( -1 ); - } - } - else - { - if( libcdata_array_get_number_of_entries( - internal_stream->segments_array, - &segment_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from segments array.", - function ); - - return( -1 ); - } - segment_data_offset = 0; - } - internal_stream->current_segment_index = segment_index; - internal_stream->current_offset = offset; - internal_stream->segment_data_offset = segment_data_offset; - - return( offset ); -} - -/* Retrieves the offset - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_get_offset( - libfdata_stream_t *stream, - off64_t *offset, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_get_data_offset"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid offset.", - function ); - - return( -1 ); - } - *offset = internal_stream->current_offset; - - return( 1 ); -} - -/* Retrieves the size - * Returns 1 if successful or -1 on error - */ -int libfdata_stream_get_size( - libfdata_stream_t *stream, - size64_t *size, - libcerror_error_t **error ) -{ - libfdata_internal_stream_t *internal_stream = NULL; - static char *function = "libfdata_stream_get_size"; - - if( stream == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid stream.", - function ); - - return( -1 ); - } - internal_stream = (libfdata_internal_stream_t *) stream; - - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - if( ( internal_stream->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_segments_array_calculate_mapped_ranges( - internal_stream->segments_array, - internal_stream->mapped_ranges_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - return( -1 ); - } - internal_stream->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - if( internal_stream->mapped_size != 0 ) - { - *size = internal_stream->mapped_size; - } - else - { - *size = internal_stream->size; - } - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_stream.h libbde-20240223/libfdata/libfdata_stream.h --- libbde-20190102/libfdata/libfdata_stream.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_stream.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,355 +0,0 @@ -/* - * The stream functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_STREAM_H ) -#define _LIBFDATA_INTERNAL_STREAM_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_mapped_range.h" -#include "libfdata_range.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_stream libfdata_internal_stream_t; - -struct libfdata_internal_stream -{ - /* The current segment index - */ - int current_segment_index; - - /* The current offset - */ - off64_t current_offset; - - /* The (current) segment data offset - */ - off64_t segment_data_offset; - - /* The (stream) size - */ - size64_t size; - - /* The mapped (stream) size - */ - size64_t mapped_size; - - /* The segments array - */ - libcdata_array_t *segments_array; - - /* The mapped ranges array - */ - libcdata_array_t *mapped_ranges_array; - - /* The flags - */ - uint8_t flags; - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The create segment function - */ - int (*create_segment)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ); - - /* The read segment data function - */ - ssize_t (*read_segment_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - uint8_t *segment_data, - size_t segment_data_size, - uint32_t segment_flags, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The write segment data function - */ - ssize_t (*write_segment_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - const uint8_t *segment_data, - size_t segment_data_size, - uint32_t segment_flags, - uint8_t write_flags, - libcerror_error_t **error ); - - /* The seek segment offset function - */ - off64_t (*seek_segment_offset)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - off64_t segment_offset, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_stream_initialize( - libfdata_stream_t **stream, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*create_segment)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ), - ssize_t (*read_segment_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - uint8_t *segment_data, - size_t segment_data_size, - uint32_t segment_flags, - uint8_t read_flags, - libcerror_error_t **error ), - ssize_t (*write_segment_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - const uint8_t *segment_data, - size_t segment_data_size, - uint32_t segment_flags, - uint8_t write_flags, - libcerror_error_t **error ), - off64_t (*seek_segment_offset)( - intptr_t *data_handle, - intptr_t *file_io_handle, - int segment_index, - int segment_file_index, - off64_t segment_offset, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_free( - libfdata_stream_t **stream, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_clone( - libfdata_stream_t **destination_stream, - libfdata_stream_t *source_stream, - libcerror_error_t **error ); - -/* Segment functions - */ -LIBFDATA_EXTERN \ -int libfdata_stream_empty( - libfdata_stream_t *stream, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_resize( - libfdata_stream_t *stream, - int number_of_segments, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_reverse( - libfdata_stream_t *stream, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_get_number_of_segments( - libfdata_stream_t *stream, - int *number_of_segments, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_get_segment_by_index( - libfdata_stream_t *stream, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_set_segment_by_index( - libfdata_stream_t *stream, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_prepend_segment( - libfdata_stream_t *stream, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_append_segment( - libfdata_stream_t *stream, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_set_mapped_size( - libfdata_stream_t *stream, - size64_t mapped_size, - libcerror_error_t **error ); - -/* Mapped range functions - */ -LIBFDATA_EXTERN \ -int libfdata_stream_get_segment_mapped_range( - libfdata_stream_t *stream, - int segment_index, - off64_t *mapped_range_offset, - size64_t *mapped_range_size, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_get_segment_index_at_offset( - libfdata_stream_t *stream, - off64_t offset, - int *segment_index, - off64_t *segment_data_offset, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_get_segment_at_offset( - libfdata_stream_t *stream, - off64_t offset, - int *segment_index, - off64_t *segment_data_offset, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ); - -/* IO functions - */ -LIBFDATA_EXTERN \ -ssize_t libfdata_stream_read_buffer( - libfdata_stream_t *stream, - intptr_t *file_io_handle, - uint8_t *buffer, - size_t buffer_size, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -ssize_t libfdata_stream_read_buffer_at_offset( - libfdata_stream_t *stream, - intptr_t *file_io_handle, - uint8_t *buffer, - size_t buffer_size, - off64_t offset, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -ssize_t libfdata_stream_write_buffer( - libfdata_stream_t *stream, - intptr_t *file_io_handle, - const uint8_t *buffer, - size_t buffer_size, - uint8_t write_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -off64_t libfdata_stream_seek_offset( - libfdata_stream_t *stream, - off64_t offset, - int whence, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_get_offset( - libfdata_stream_t *stream, - off64_t *offset, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_stream_get_size( - libfdata_stream_t *stream, - size64_t *size, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_STREAM_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_support.c libbde-20240223/libfdata/libfdata_support.c --- libbde-20190102/libfdata/libfdata_support.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_support.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Support functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include - -#include - -#include "libfdata_definitions.h" -#include "libfdata_support.h" - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -/* Returns the library version as a string - */ -const char *libfdata_get_version( - void ) -{ - return( (const char *) LIBFDATA_VERSION_STRING ); -} - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - diff -Nru libbde-20190102/libfdata/libfdata_support.h libbde-20240223/libfdata/libfdata_support.h --- libbde-20190102/libfdata/libfdata_support.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_support.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * Support functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_SUPPORT_H ) -#define _LIBFDATA_SUPPORT_H - -#include -#include - -#include "libfdata_extern.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -#if !defined( HAVE_LOCAL_LIBFDATA ) - -LIBFDATA_EXTERN \ -const char *libfdata_get_version( - void ); - -#endif /* !defined( HAVE_LOCAL_LIBFDATA ) */ - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_SUPPORT_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_tree.c libbde-20240223/libfdata/libfdata_tree.c --- libbde-20190102/libfdata/libfdata_tree.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_tree.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1256 +0,0 @@ -/* - * The tree functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_definitions.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_tree.h" -#include "libfdata_tree_node.h" -#include "libfdata_types.h" - -/* Creates a tree - * Make sure the value tree is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the tree - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_initialize( - libfdata_tree_t **tree, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_node)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*read_sub_nodes)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - int sub_nodes_file_index, - off64_t sub_nodes_offset, - size64_t sub_nodes_size, - uint32_t sub_nodes_flags, - uint8_t read_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_initialize"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( *tree != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid tree value already set.", - function ); - - return( -1 ); - } - if( read_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid read node function.", - function ); - - return( -1 ); - } - if( read_sub_nodes == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid read sub nodes function.", - function ); - - return( -1 ); - } - internal_tree = memory_allocate_structure( - libfdata_internal_tree_t ); - - if( internal_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create tree.", - function ); - - goto on_error; - } - if( memory_set( - internal_tree, - 0, - sizeof( libfdata_internal_tree_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear tree.", - function ); - - goto on_error; - } - internal_tree->flags |= flags; - internal_tree->data_handle = data_handle; - internal_tree->free_data_handle = free_data_handle; - internal_tree->clone_data_handle = clone_data_handle; - internal_tree->read_node = read_node; - internal_tree->read_sub_nodes = read_sub_nodes; - - *tree = (libfdata_tree_t *) internal_tree; - - return( 1 ); - -on_error: - if( internal_tree != NULL ) - { - memory_free( - internal_tree ); - } - return( -1 ); -} - -/* Frees a tree - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_free( - libfdata_tree_t **tree, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_free"; - int result = 1; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( *tree != NULL ) - { - internal_tree = (libfdata_internal_tree_t *) *tree; - *tree = NULL; - - if( internal_tree->root_node != NULL ) - { - if( libfdata_tree_node_free( - &( internal_tree->root_node ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free root node.", - function ); - - result = -1; - } - } - if( ( internal_tree->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_tree->data_handle != NULL ) - { - if( internal_tree->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid list - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_tree->free_data_handle( - &( internal_tree->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_tree ); - } - return( result ); -} - -/* Clones (duplicates) the tree - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_clone( - libfdata_tree_t **destination_tree, - libfdata_tree_t *source_tree, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_source_tree = NULL; - libfdata_tree_node_t *source_tree_root_node = NULL; - intptr_t *destination_data_handle = NULL; - static char *function = "libfdata_tree_clone"; - off64_t node_offset = 0; - size64_t node_size = 0; - uint32_t node_flags = 0; - int node_file_index = -1; - - if( destination_tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination tree.", - function ); - - return( -1 ); - } - if( *destination_tree != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination tree value already set.", - function ); - - return( -1 ); - } - if( source_tree == NULL ) - { - *destination_tree = NULL; - - return( 1 ); - } - internal_source_tree = (libfdata_internal_tree_t *) source_tree; - - if( internal_source_tree->data_handle != NULL ) - { - if( internal_source_tree->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source tree - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_tree->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source tree - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_tree->clone_data_handle( - &destination_data_handle, - internal_source_tree->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to clone data handle.", - function ); - - goto on_error; - } - } - if( libfdata_tree_initialize( - destination_tree, - destination_data_handle, - internal_source_tree->free_data_handle, - internal_source_tree->clone_data_handle, - internal_source_tree->read_node, - internal_source_tree->read_sub_nodes, - LIBFDATA_DATA_HANDLE_FLAG_MANAGED, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination tree.", - function ); - - goto on_error; - } - destination_data_handle = NULL; - - if( libfdata_tree_get_root_node( - source_tree, - &source_tree_root_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve source tree root node.", - function ); - - goto on_error; - } - if( libfdata_tree_node_get_data_range( - source_tree_root_node, - &node_file_index, - &node_offset, - &node_size, - &node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve source tree root node data range.", - function ); - - goto on_error; - } - if( libfdata_tree_set_root_node( - *destination_tree, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set destination tree root node.", - function ); - - goto on_error; - } - /* TODO or clone all the tree nodes ? */ - - return( 1 ); - -on_error: - if( *destination_tree != NULL ) - { - libfdata_tree_free( - destination_tree, - NULL ); - } - if( destination_data_handle != NULL ) - { - internal_source_tree->free_data_handle( - &destination_data_handle, - NULL ); - } - return( -1 ); -} - -/* Retrieves the node value of the node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_get_node_value( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_tree_node_t *node, - intptr_t **node_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_value_t *cache_value = NULL; - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_get_node_value"; - size64_t node_size = 0; - off64_t cache_value_offset = (off64_t) -1; - off64_t node_offset = 0; - int64_t cache_value_timestamp = 0; - int64_t node_timestamp = 0; - uint32_t node_flags = 0; - int cache_entry_index = -1; - int cache_value_file_index = -1; - int node_file_index = -1; - int number_of_cache_entries = 0; - int result = 0; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( internal_tree->read_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing read node function.", - function ); - - return( -1 ); - } - if( libfdata_tree_node_get_data_range( - node, - &node_file_index, - &node_offset, - &node_size, - &node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from tree node.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } - if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) - { - if( ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - cache_entry_index = libfdata_tree_node_calculate_leaf_node_cache_entry_index( - node_offset, - number_of_cache_entries ); - } - else - { - cache_entry_index = libfdata_tree_node_calculate_branch_node_cache_entry_index( - node_offset, - number_of_cache_entries ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfdata_tree_node_get_timestamp( - node, - &node_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve time stamp from tree node.", - function ); - - return( -1 ); - } - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( node_file_index == cache_value_file_index ) - && ( node_offset == cache_value_offset ) - && ( node_timestamp == cache_value_timestamp ) ) - { - result = 1; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( result == 0 ) - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " miss (entry: %d, want: %" PRIi64 ", got: %" PRIi64 ")\n", - function, - (intptr_t) cache, - cache_entry_index, - node_offset, - cache_value_offset ); - } - else - { - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " hit (entry: %d)\n", - function, - (intptr_t) cache, - cache_entry_index ); - } - } -#endif - } - if( result == 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading node at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", - function, - node_offset, - node_offset, - node_size ); - } -#endif - if( internal_tree->read_node( - internal_tree->data_handle, - file_io_handle, - node, - cache, - node_file_index, - node_offset, - node_size, - node_flags, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read node at offset: 0x%08" PRIx64 ".", - function, - node_offset ); - - return( -1 ); - } - if( ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - cache_entry_index = libfdata_tree_node_calculate_leaf_node_cache_entry_index( - node_offset, - number_of_cache_entries ); - } - else - { - cache_entry_index = libfdata_tree_node_calculate_branch_node_cache_entry_index( - node_offset, - number_of_cache_entries ); - } - if( libfcache_cache_get_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache entry: %d from cache.", - function, - cache_entry_index ); - - return( -1 ); - } - if( cache_value != NULL ) - { - if( libfdata_tree_node_get_timestamp( - node, - &node_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve time stamp from tree node.", - function ); - - return( -1 ); - } - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - } - if( ( node_file_index != cache_value_file_index ) - || ( node_offset != cache_value_offset ) - || ( node_timestamp != cache_value_timestamp ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing cache value.", - function ); - - return( -1 ); - } - } - if( libfcache_cache_value_get_value( - cache_value, - node_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the node value of the node - * - * If the flag LIBFDATA_TREE_NODE_VALUE_FLAG_MANAGED is set the tree - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_set_node_value( - libfdata_tree_t *tree, - libfdata_cache_t *cache, - libfdata_tree_node_t *node, - intptr_t *node_value, - int (*free_node_value)( - intptr_t **node_value, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_tree_set_node_value"; - size64_t node_size = 0; - off64_t node_offset = 0; - int64_t node_timestamp = 0; - uint32_t node_flags = 0; - int cache_entry_index = -1; - int node_file_index = -1; - int number_of_cache_entries = 0; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - if( libfdata_tree_node_get_data_range( - node, - &node_file_index, - &node_offset, - &node_size, - &node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve data range from tree node.", - function ); - - return( -1 ); - } - if( libfdata_tree_node_get_timestamp( - node, - &node_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve timestamp from tree node.", - function ); - - return( -1 ); - } - if( libfcache_cache_get_number_of_entries( - (libfcache_cache_t *) cache, - &number_of_cache_entries, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of cache entries.", - function ); - - return( -1 ); - } - if( number_of_cache_entries <= 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid number of cache entries value out of bounds.", - function ); - - return( -1 ); - } - if( ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( ( (libfdata_internal_tree_node_t *) node )->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - cache_entry_index = libfdata_tree_node_calculate_leaf_node_cache_entry_index( - node_offset, - number_of_cache_entries ); - } - else - { - cache_entry_index = libfdata_tree_node_calculate_branch_node_cache_entry_index( - node_offset, - number_of_cache_entries ); - } - if( libfcache_cache_set_value_by_index( - (libfcache_cache_t *) cache, - cache_entry_index, - node_file_index, - node_offset, - node_timestamp, - node_value, - free_node_value, - flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value in cache entry: %d.", - function, - cache_entry_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Reads the sub nodes of the node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_read_sub_nodes( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_tree_node_t *node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_read_sub_nodes"; - off64_t sub_nodes_offset = 0; - size64_t sub_nodes_size = 0; - uint32_t sub_nodes_flags = 0; - int sub_nodes_file_index = -1; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( internal_tree->read_sub_nodes == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid tree - missing read sub nodes function.", - function ); - - return( -1 ); - } - if( libfdata_tree_node_get_sub_nodes_data_range( - node, - &sub_nodes_file_index, - &sub_nodes_offset, - &sub_nodes_size, - &sub_nodes_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub nodes data range.", - function ); - - return( -1 ); - } - if( internal_tree->read_sub_nodes( - internal_tree->data_handle, - file_io_handle, - node, - cache, - sub_nodes_file_index, - sub_nodes_offset, - sub_nodes_size, - sub_nodes_flags, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sub nodes at offset: 0x%08" PRIx64 ".", - function, - sub_nodes_offset ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the offset and size of the root node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_get_root_node( - libfdata_tree_t *tree, - libfdata_tree_node_t **root_node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_get_root_node"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( root_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid root node.", - function ); - - return( -1 ); - } - *root_node = internal_tree->root_node; - - return( 1 ); -} - -/* Sets the root node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_set_root_node( - libfdata_tree_t *tree, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_set_root_node"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( internal_tree->root_node == NULL ) - { - if( libfdata_tree_node_initialize( - &( internal_tree->root_node ), - tree, - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create root node.", - function ); - - return( -1 ); - } - } - if( libfdata_tree_node_set_data_range( - internal_tree->root_node, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set root node data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the number of leaf nodes in the tree - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_get_number_of_leaf_nodes( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_get_number_of_leaf_nodes"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( libfdata_tree_node_get_number_of_leaf_nodes( - internal_tree->root_node, - file_io_handle, - cache, - number_of_leaf_nodes, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf nodes from root node.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a leaf nodes at a specific index - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_get_leaf_node_by_index( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_node_index, - libfdata_tree_node_t **leaf_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_get_leaf_node_by_index"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( libfdata_tree_node_get_leaf_node_by_index( - internal_tree->root_node, - file_io_handle, - cache, - leaf_node_index, - leaf_node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node: %d from root node.", - function, - leaf_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the number of deleted leaf nodes in the tree - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_get_number_of_deleted_leaf_nodes( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_deleted_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_get_number_of_deleted_leaf_nodes"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( libfdata_tree_node_get_number_of_deleted_leaf_nodes( - internal_tree->root_node, - file_io_handle, - cache, - number_of_deleted_leaf_nodes, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of deleted leaf nodes from root node.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a deleted leaf nodes at a specific index - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_get_deleted_leaf_node_by_index( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int deleted_leaf_node_index, - libfdata_tree_node_t **deleted_leaf_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_t *internal_tree = NULL; - static char *function = "libfdata_tree_get_deleted_leaf_node_by_index"; - - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree = (libfdata_internal_tree_t *) tree; - - if( libfdata_tree_node_get_deleted_leaf_node_by_index( - internal_tree->root_node, - file_io_handle, - cache, - deleted_leaf_node_index, - deleted_leaf_node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of deleted leaf node: %d from root node.", - function, - deleted_leaf_node_index ); - - return( -1 ); - } - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_tree.h libbde-20240223/libfdata/libfdata_tree.h --- libbde-20190102/libfdata/libfdata_tree.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_tree.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,246 +0,0 @@ -/* - * The tree functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_TREE_H ) -#define _LIBFDATA_INTERNAL_TREE_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_tree libfdata_internal_tree_t; - -struct libfdata_internal_tree -{ - /* The root node - */ - libfdata_tree_node_t *root_node; - - /* The flags - */ - uint8_t flags; - - /* The calculate cache entry index value - */ - int (*calculate_cache_entry_index)( - int node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - int number_of_cache_entries ); - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The read node function - */ - int (*read_node)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The read sub nodes function - */ - int (*read_sub_nodes)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - int sub_nodes_file_index, - off64_t sub_nodes_offset, - size64_t sub_nodes_size, - uint32_t sub_nodes_flags, - uint8_t read_flags, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_tree_initialize( - libfdata_tree_t **tree, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_node)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*read_sub_nodes)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - int sub_nodes_file_index, - off64_t sub_nodes_offset, - size64_t sub_nodes_size, - uint32_t sub_nodes_flags, - uint8_t read_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_free( - libfdata_tree_t **tree, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_clone( - libfdata_tree_t **destination_tree, - libfdata_tree_t *source_tree, - libcerror_error_t **error ); - -/* Node value functions - */ -int libfdata_tree_get_node_value( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_tree_node_t *node, - intptr_t **node_value, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_tree_set_node_value( - libfdata_tree_t *tree, - libfdata_cache_t *cache, - libfdata_tree_node_t *node, - intptr_t *node_value, - int (*free_node_value)( - intptr_t **node_value, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -/* Sub node functions - */ -int libfdata_tree_read_sub_nodes( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - libfdata_tree_node_t *node, - uint8_t read_flags, - libcerror_error_t **error ); - -/* Root node functions - */ -LIBFDATA_EXTERN \ -int libfdata_tree_get_root_node( - libfdata_tree_t *tree, - libfdata_tree_node_t **root_node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_set_root_node( - libfdata_tree_t *tree, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ); - -/* Leaf node functions - */ -LIBFDATA_EXTERN \ -int libfdata_tree_get_number_of_leaf_nodes( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_get_leaf_node_by_index( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_node_index, - libfdata_tree_node_t **leaf_node, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_get_number_of_deleted_leaf_nodes( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_deleted_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_get_deleted_leaf_node_by_index( - libfdata_tree_t *tree, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int deleted_leaf_node_index, - libfdata_tree_node_t **deleted_leaf_node, - uint8_t read_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_TREE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_tree_node.c libbde-20240223/libfdata/libfdata_tree_node.c --- libbde-20190102/libfdata/libfdata_tree_node.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_tree_node.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,3461 +0,0 @@ -/* - * The tree node functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_definitions.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_range.h" -#include "libfdata_tree_node.h" -#include "libfdata_types.h" - -/* Creates a node - * Make sure the value node is referencing, is set to NULL - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_initialize( - libfdata_tree_node_t **node, - libfdata_tree_t *tree, - libfdata_tree_node_t *parent_node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_initialize"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( *node != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid node value already set.", - function ); - - return( -1 ); - } - if( tree == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid tree.", - function ); - - return( -1 ); - } - internal_tree_node = memory_allocate_structure( - libfdata_internal_tree_node_t ); - - if( internal_tree_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create node.", - function ); - - goto on_error; - } - if( memory_set( - internal_tree_node, - 0, - sizeof( libfdata_internal_tree_node_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear node.", - function ); - - memory_free( - internal_tree_node ); - - return( -1 ); - } - if( libfdata_range_initialize( - &( internal_tree_node->node_data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create node data range.", - function ); - - goto on_error; - } - if( libfdata_range_initialize( - &( internal_tree_node->sub_nodes_data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sub nodes data range.", - function ); - - goto on_error; - } - if( libcdata_array_initialize( - &( internal_tree_node->sub_nodes ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sub nodes array.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_tree_node->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - goto on_error; - } - internal_tree_node->tree = tree; - internal_tree_node->parent_node = parent_node; - internal_tree_node->flags = LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - *node = (libfdata_tree_node_t *) internal_tree_node; - - return( 1 ); - -on_error: - if( internal_tree_node != NULL ) - { - if( internal_tree_node->sub_nodes != NULL ) - { - libcdata_array_free( - &( internal_tree_node->sub_nodes ), - NULL, - NULL ); - } - if( internal_tree_node->sub_nodes_data_range != NULL ) - { - libfdata_range_free( - &( internal_tree_node->sub_nodes_data_range ), - NULL ); - } - if( internal_tree_node->node_data_range != NULL ) - { - libfdata_range_free( - &( internal_tree_node->node_data_range ), - NULL ); - } - memory_free( - internal_tree_node ); - } - return( -1 ); -} - -/* Frees a node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_free( - libfdata_tree_node_t **node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_free"; - int result = 1; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( *node != NULL ) - { - internal_tree_node = (libfdata_internal_tree_node_t *) *node; - *node = NULL; - - if( internal_tree_node->node_data_range != NULL ) - { - if( libfdata_range_free( - &( internal_tree_node->node_data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free node data range.", - function ); - - result = -1; - } - } - if( internal_tree_node->sub_nodes_data_range != NULL ) - { - if( libfdata_range_free( - &( internal_tree_node->sub_nodes_data_range ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free sub nodes data range.", - function ); - - result = -1; - } - } - if( libcdata_array_free( - &( internal_tree_node->sub_nodes ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the sub nodes array.", - function ); - - result = -1; - } - memory_free( - internal_tree_node ); - } - return( result ); -} - -/* Frees a node, but not its sub nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_free_single( - libfdata_tree_node_t **node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_free_single"; - int result = 1; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - if( *node != NULL ) - { - internal_tree_node = (libfdata_internal_tree_node_t *) node; - *node = NULL; - - if( libcdata_array_free( - &( internal_tree_node->sub_nodes ), - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the sub nodes array.", - function ); - - result = -1; - } - memory_free( - internal_tree_node ); - } - return( result ); -} - -/* Sets the parent node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_parent_node( - libfdata_tree_node_t *node, - libfdata_tree_node_t *parent_node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_parent_node"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - internal_tree_node->parent_node = parent_node; - - return( 1 ); -} - -/* Determines if the node is a root node - * Returns 1 if a root node, 0 if not or -1 on error - */ -int libfdata_tree_node_is_root( - libfdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_is_root"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( internal_tree_node->parent_node == NULL ) - { - return( 1 ); - } - return( 0 ); -} - -/* Retrieves the data offset and size - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_data_range( - libfdata_tree_node_t *node, - int *node_file_index, - off64_t *node_offset, - size64_t *node_size, - uint32_t *node_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_data_range"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( libfdata_range_get( - internal_tree_node->node_data_range, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the data offset and size - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_data_range( - libfdata_tree_node_t *node, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_data_range"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is virtual.", - function ); - - return( -1 ); - } - if( libfdata_range_set( - internal_tree_node->node_data_range, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set node data range.", - function ); - - return( -1 ); - } - if( libfcache_date_time_get_timestamp( - &( internal_tree_node->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Determines if the sub nodes data range has been set - * Returns 1 if sub nodes have been set, 0 if not or -1 on error - */ -int libfdata_tree_node_sub_nodes_data_range_is_set( - libfdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_sub_nodes_data_range_is_set"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - return( 1 ); - } - return( 0 ); -} - -/* Retrieves the sub nodes data range - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_sub_nodes_data_range( - libfdata_tree_node_t *node, - int *sub_nodes_file_index, - off64_t *sub_nodes_offset, - size64_t *sub_nodes_size, - uint32_t *sub_nodes_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_sub_nodes_data_range"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - sub nodes range has not been set.", - function ); - - return( -1 ); - } - if( libfdata_range_get( - internal_tree_node->sub_nodes_data_range, - sub_nodes_file_index, - sub_nodes_offset, - sub_nodes_size, - sub_nodes_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub nodes data range.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the sub nodes data range - * The sub nodes data range cannot be set after the sub nodes have been read - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_sub_nodes_data_range( - libfdata_tree_node_t *node, - int sub_nodes_file_index, - off64_t sub_nodes_offset, - size64_t sub_nodes_size, - uint32_t sub_nodes_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_sub_nodes_data_range"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is virtual.", - function ); - - return( -1 ); - } - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - sub nodes range has already been read.", - function ); - - return( -1 ); - } - if( libfdata_range_set( - internal_tree_node->sub_nodes_data_range, - sub_nodes_file_index, - sub_nodes_offset, - sub_nodes_size, - sub_nodes_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub nodes data range.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET; - - return( 1 ); -} - -/* Retrieves the time stamp - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_timestamp( - libfdata_tree_node_t *node, - int64_t *timestamp, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_timestamp"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( timestamp == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node time stamp.", - function ); - - return( -1 ); - } - *timestamp = internal_tree_node->timestamp; - - return( 1 ); -} - -/* Retrieves the first leaf node index - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_first_leaf_node_index( - libfdata_tree_node_t *node, - int *first_leaf_node_index, - int *deleted_first_leaf_node_index, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_first_leaf_node_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( first_leaf_node_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid first leaf node index.", - function ); - - return( -1 ); - } - if( deleted_first_leaf_node_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid first deleted leaf node index.", - function ); - - return( -1 ); - } - *first_leaf_node_index = internal_tree_node->first_leaf_node_index; - *deleted_first_leaf_node_index = internal_tree_node->first_deleted_leaf_node_index; - - return( 1 ); -} - -/* Sets the first leaf node index - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_first_leaf_node_index( - libfdata_tree_node_t *node, - int first_leaf_node_index, - int first_deleted_leaf_node_index, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_first_leaf_node_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( first_leaf_node_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid first leaf node index value less than zero.", - function ); - - return( -1 ); - } - if( first_deleted_leaf_node_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid first deleted leaf node index value less than zero.", - function ); - - return( -1 ); - } - internal_tree_node->first_leaf_node_index = first_leaf_node_index; - internal_tree_node->first_deleted_leaf_node_index = first_deleted_leaf_node_index; - - return( 1 ); -} - -/* Retrieves the node value - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_node_value( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t **node_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_node_value"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - cache, - node, - node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; - - return( 1 ); -} - -/* Sets the node value - * - * If the flag LIBFDATA_TREE_NODE_VALUE_FLAG_MANAGED is set the node - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_node_value( - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - intptr_t *node_value, - int (*free_node_value)( - intptr_t **node_value, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_node_value"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( libfdata_tree_set_node_value( - internal_tree_node->tree, - cache, - node, - node_value, - free_node_value, - flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set node value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Resizes the sub nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_resize_sub_nodes( - libfdata_tree_node_t *node, - int number_of_sub_nodes, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_resize_sub_nodes"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( libcdata_array_resize( - internal_tree_node->sub_nodes, - number_of_sub_nodes, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize sub nodes array.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the number of sub nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_number_of_sub_nodes( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_sub_nodes, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - intptr_t *node_value = NULL; - static char *function = "libfdata_tree_node_get_number_of_sub_nodes"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) - { - /* Make sure the node data is read before the sub nodes - */ - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) - { - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - cache, - node, - &node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; - } - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - if( libfdata_tree_read_sub_nodes( - internal_tree_node->tree, - file_io_handle, - cache, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sub nodes.", - function ); - - return( -1 ); - } - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_nodes, - number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub nodes array.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves a specific sub node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_sub_node_by_index( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int sub_node_index, - libfdata_tree_node_t **sub_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - intptr_t *node_value = NULL; - static char *function = "libfdata_tree_node_get_sub_node_by_index"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) - { - /* Make sure the node data is read before the sub nodes - */ - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) - { - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - cache, - node, - &node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; - } - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - if( libfdata_tree_read_sub_nodes( - internal_tree_node->tree, - file_io_handle, - cache, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sub nodes.", - function ); - - return( -1 ); - } - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; - } - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the offset and size of a specific sub node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_sub_node_by_index( - libfdata_tree_node_t *node, - int sub_node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - static char *function = "libfdata_tree_node_set_sub_node_by_index"; - off64_t previous_node_offset = 0; - size64_t previous_node_size = 0; - uint32_t previous_node_flags = 0; - int previous_node_file_index = -1; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - if( sub_node == NULL ) - { - if( libfdata_tree_node_initialize( - &sub_node, - internal_tree_node->tree, - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sub node.", - function ); - - return( -1 ); - } - if( libcdata_array_set_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t *) sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub node: %d in sub nodes array.", - function, - sub_node_index ); - - libfdata_tree_node_free( - &sub_node, - NULL ); - - return( -1 ); - } - } - else - { - if( libfdata_tree_node_get_data_range( - sub_node, - &previous_node_file_index, - &previous_node_offset, - &previous_node_size, - &previous_node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node: %d data range.", - function, - sub_node_index ); - - return( -1 ); - } - } - if( libfdata_tree_node_set_data_range( - sub_node, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub node: %d data range.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Appends a sub node offset and size - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_append_sub_node( - libfdata_tree_node_t *node, - int *sub_node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - static char *function = "libfdata_tree_node_append_sub_node"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( libfdata_tree_node_initialize( - &sub_node, - internal_tree_node->tree, - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create sub node.", - function ); - - goto on_error; - } - if( libfdata_tree_node_set_data_range( - sub_node, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub node data range.", - function ); - - goto on_error; - } - if( libcdata_array_append_entry( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t *) sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append sub node to sub nodes array.", - function ); - - goto on_error; - } - return( 1 ); - -on_error: - if( sub_node != NULL ) - { - libfdata_tree_node_free( - &sub_node, - NULL ); - } - return( -1 ); -} - -/* Inserts a sub node offset and size - * - * Uses the node_value_compare_function to determine the order of the sub nodes - * The node_value_compare_function should return LIBFDATA_COMPARE_LESS, - * LIBFDATA_COMPARE_EQUAL, LIBFDATA_COMPARE_GREATER if successful or -1 on error - * - * Duplicate entries are allowed by default and inserted after the last duplicate entry. - * Only allowing unique entries can be enforced by setting the flag LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_ENTRIES - * - * Returns 1 if successful, 0 if the node already exists or -1 on error - */ -int libfdata_tree_node_insert_sub_node( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *sub_node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - int (*node_value_compare_function)( - intptr_t *first_node_value, - intptr_t *second_node_value, - libcerror_error_t **error ), - uint8_t insert_flags, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_t *insert_cache = NULL; - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *insert_sub_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - intptr_t *insert_sub_node_value = NULL; - intptr_t *sub_node_value = NULL; - static char *function = "libfdata_tree_node_insert_sub_node"; - int number_of_sub_nodes = 0; - int result = 0; - int sub_node_iterator = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( sub_node_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid sub node index.", - function ); - - return( -1 ); - } - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( node_value_compare_function == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node value compare function.", - function ); - - return( -1 ); - } - if( ( insert_flags & ~( LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_SUB_NODE_VALUES ) ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported insert flags: 0x%02" PRIx8 ".", - function, - insert_flags ); - - return( -1 ); - } - if( libfdata_tree_node_initialize( - &insert_sub_node, - internal_tree_node->tree, - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create insert sub node.", - function ); - - goto on_error; - } - if( libfdata_tree_node_set_data_range( - insert_sub_node, - node_file_index, - node_offset, - node_size, - node_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set insert sub node data range.", - function ); - - goto on_error; - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_nodes, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub nodes array.", - function ); - - goto on_error; - } - if( libfcache_cache_initialize( - &insert_cache, - 1, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create insert cache.", - function ); - - goto on_error; - } - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - (libfdata_cache_t *) insert_cache, - insert_sub_node, - &insert_sub_node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve insert sub node value.", - function ); - - goto on_error; - } - for( sub_node_iterator = 0; - sub_node_iterator < number_of_sub_nodes; - sub_node_iterator++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_iterator, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_iterator ); - - goto on_error; - } - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - cache, - sub_node, - &sub_node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node value: %d.", - function, - sub_node_iterator ); - - goto on_error; - } - result = node_value_compare_function( - insert_sub_node_value, - sub_node_value, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to compare sub node value: %d.", - function, - sub_node_iterator ); - - goto on_error; - } - else if( result == LIBFDATA_COMPARE_EQUAL ) - { - if( ( insert_flags & LIBFDATA_TREE_NODE_INSERT_FLAG_UNIQUE_SUB_NODE_VALUES ) != 0 ) - { - if( libfcache_cache_free( - &insert_cache, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the insert cache.", - function ); - - goto on_error; - } - if( libfdata_tree_node_free( - &insert_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the insert sub node.", - function ); - - goto on_error; - } - return( 0 ); - } - } - else if( result == LIBFDATA_COMPARE_LESS ) - { - break; - } - else if( result != LIBFDATA_COMPARE_GREATER ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported node value compare function return value: %d.", - function, - result ); - - goto on_error; - } - } - if( libfcache_cache_free( - &insert_cache, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the insert cache.", - function ); - - goto on_error; - } - if( ( number_of_sub_nodes > 0 ) - && ( result == LIBCDATA_COMPARE_LESS ) ) - { - *sub_node_index = sub_node_iterator; - - if( libcdata_array_resize( - internal_tree_node->sub_nodes, - number_of_sub_nodes + 1, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize sub nodes array.", - function ); - - goto on_error; - } - for( sub_node_iterator = number_of_sub_nodes; - sub_node_iterator > *sub_node_index; - sub_node_iterator-- ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_iterator - 1, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve sub node: %d from sub nodes array.", - function, - sub_node_iterator - 1 ); - - goto on_error; - } - if( libcdata_array_set_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_iterator, - (intptr_t *) sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set sub node: %d in sub nodes array.", - function, - sub_node_iterator ); - - goto on_error; - } - } - if( libcdata_array_set_entry_by_index( - internal_tree_node->sub_nodes, - *sub_node_index, - (intptr_t *) insert_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set insert sub node: %d in sub nodes array.", - function, - *sub_node_index ); - - goto on_error; - } - } - else - { - *sub_node_index = number_of_sub_nodes; - - if( libcdata_array_resize( - internal_tree_node->sub_nodes, - number_of_sub_nodes + 1, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize sub nodes array.", - function ); - - goto on_error; - } - if( libcdata_array_set_entry_by_index( - internal_tree_node->sub_nodes, - *sub_node_index, - (intptr_t *) insert_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set insert sub node: %d in sub nodes array.", - function, - *sub_node_index ); - - goto on_error; - } - } - return( 1 ); - -on_error: - if( insert_cache != NULL ) - { - libfcache_cache_free( - &insert_cache, - NULL ); - } - if( insert_sub_node != NULL ) - { - libfdata_tree_node_free( - &insert_sub_node, - NULL ); - } - return( -1 ); -} - -/* Splits the sub nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_split_sub_nodes( - libfdata_tree_node_t *node, - int number_of_splits, - libcerror_error_t **error ) -{ - libcdata_array_t *virtual_sub_nodes_array = NULL; - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - libfdata_tree_node_t *virtual_sub_node = NULL; - static char *function = "libfdata_tree_node_split_sub_nodes"; - int number_of_split_sub_nodes = 0; - int number_of_sub_nodes = 0; - int result = 1; - int last_sub_node_index = 0; - int split_sub_node_index = 0; - int sub_node_index = 0; - int virtual_sub_node_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - node is a leaf.", - function ); - - return( -1 ); - } - if( number_of_splits < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid number of splits value less than zero.", - function ); - - return( -1 ); - } - if( number_of_splits == 0 ) - { - return( 1 ); - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_nodes, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub nodes array.", - function ); - - return( -1 ); - } - number_of_split_sub_nodes = number_of_sub_nodes / number_of_splits; - - if( number_of_split_sub_nodes < 2 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: number of sub nodes too small to split in: %d.", - function, - number_of_splits ); - - return( -1 ); - } - if( libcdata_array_initialize( - &virtual_sub_nodes_array, - number_of_splits, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create virtual sub nodes array.", - function ); - - return( -1 ); - } - for( virtual_sub_node_index = 0; - virtual_sub_node_index < number_of_splits; - virtual_sub_node_index++ ) - { - if( libfdata_tree_node_initialize( - &virtual_sub_node, - internal_tree_node->tree, - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create virtual sub node: %d.", - function, - virtual_sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - ( (libfdata_internal_tree_node_t *) virtual_sub_node )->flags |= LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL; - - if( libcdata_array_set_entry_by_index( - virtual_sub_nodes_array, - virtual_sub_node_index, - (intptr_t *) virtual_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set virtual sub node: %d in virtual sub nodes array.", - function, - virtual_sub_node_index ); - - libfdata_tree_node_free( - &virtual_sub_node, - NULL ); - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - last_sub_node_index = ( number_of_split_sub_nodes * ( virtual_sub_node_index + 1 ) ) - 1; - - if( virtual_sub_node_index == ( number_of_splits - 1 ) ) - { - last_sub_node_index += number_of_sub_nodes % number_of_splits; - } - if( last_sub_node_index > number_of_sub_nodes ) - { - last_sub_node_index = number_of_sub_nodes - 1; - } - if( libcdata_array_resize( - ( (libfdata_internal_tree_node_t *) virtual_sub_node )->sub_nodes, - last_sub_node_index + 1 - sub_node_index, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize sub nodes array of virtual sub node: %d.", - function, - virtual_sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - split_sub_node_index = 0; - - while( sub_node_index <= last_sub_node_index ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - if( split_sub_node_index == 0 ) - { - if( sub_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sub node: %d.", - function, - sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - if( ( (libfdata_internal_tree_node_t *) sub_node )->node_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid sub node: %d - missing node data range.", - function, - sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - /* The node data range of a virtual node cannot be set by the set_data_range function - */ - if( libfdata_tree_node_get_data_range( - sub_node, - &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->file_index ), - &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->offset ), - &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->size ), - &( ( (libfdata_internal_tree_node_t *) virtual_sub_node )->node_data_range->flags ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set virtual sub node data range.", - function ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - } - if( libcdata_array_set_entry_by_index( - ( (libfdata_internal_tree_node_t *) virtual_sub_node )->sub_nodes, - split_sub_node_index, - (intptr_t *) sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set entry: %d in sub nodes array of virtual sub node: %d.", - function, - split_sub_node_index, - virtual_sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - if( libfdata_tree_node_set_parent_node( - sub_node, - virtual_sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set parent node in sub node: %d.", - function, - split_sub_node_index ); - - libcdata_array_free( - &virtual_sub_nodes_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_tree_node_free_single, - NULL ); - - result = -1; - - break; - } - sub_node_index++; - split_sub_node_index++; - } - virtual_sub_node = NULL; - } - if( result != 1 ) - { - /* Set the parent values in the sub nodes back to their orginal value - */ - for( sub_node_index = 0; - sub_node_index < number_of_sub_nodes; - sub_node_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - continue; - } - if( libfdata_tree_node_set_parent_node( - sub_node, - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set parent node in sub node: %d.", - function, - sub_node_index ); - - continue; - } - } - return( -1 ); - } - if( libcdata_array_free( - &( internal_tree_node->sub_nodes ), - NULL, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the sub nodes array.", - function ); - - result = -1; - } - internal_tree_node->sub_nodes = virtual_sub_nodes_array; - - return( result ); -} - -/* Determines if the node is deleted - * Returns 1 if deleted, 0 if not or -1 on error - */ -int libfdata_tree_node_is_deleted( - libfdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_is_deleted"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_DELETED ) != 0 ) ) - { - return( 1 ); - } - return( 0 ); -} - -/* Marks a node as deleted - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_deleted( - libfdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_deleted"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - -/* TODO add deleted branch node support */ - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, - "%s: invalid node - currently only deleted leaf nodes are supported.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_IS_DELETED; - - if( libfdata_tree_node_set_calculate_leaf_node_values( - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set calculate leaf node values.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Makes a deleted node of a specific sub node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_deleted_sub_node( - libfdata_tree_node_t *node, - int sub_node_index, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - static char *function = "libfdata_tree_node_set_deleted_sub_node"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - if( sub_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_set_deleted( - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to set deleted in sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the flag to calculate the leaf node values and propagates this up to its parent node - * Returns 1 if the successful or -1 on error - */ -int libfdata_tree_node_set_calculate_leaf_node_values( - libfdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_calculate_leaf_node_values"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( internal_tree_node->parent_node != NULL ) - { - if( libfdata_tree_node_set_calculate_leaf_node_values( - internal_tree_node->parent_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set calculate leaf node values in parent node.", - function ); - - return( -1 ); - } - } - internal_tree_node->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Reads the leaf node values - * Returns 1 if the successful or -1 on error - */ -int libfdata_tree_node_read_leaf_node_values( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - intptr_t *node_value = NULL; - static char *function = "libfdata_tree_node_read_leaf_node_values"; - int number_of_deleted_leaf_nodes = 0; - int number_of_leaf_nodes = 0; - int number_of_sub_nodes = 0; - int result = 0; - int sub_node_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) - { - /* Make sure the node data is read before the sub nodes - */ - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) - { - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - cache, - node, - &node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; - } - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - if( libfdata_tree_read_sub_nodes( - internal_tree_node->tree, - file_io_handle, - cache, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sub nodes.", - function ); - - return( -1 ); - } - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; - } - internal_tree_node->number_of_leaf_nodes = 0; - internal_tree_node->number_of_deleted_leaf_nodes = 0; - - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_nodes, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub nodes array.", - function ); - - return( -1 ); - } - for( sub_node_index = 0; - sub_node_index < number_of_sub_nodes; - sub_node_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_get_number_of_leaf_nodes( - sub_node, - file_io_handle, - cache, - &number_of_leaf_nodes, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf nodes from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_get_number_of_deleted_leaf_nodes( - sub_node, - file_io_handle, - cache, - &number_of_deleted_leaf_nodes, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of deleted leaf nodes from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_set_first_leaf_node_index( - sub_node, - internal_tree_node->number_of_leaf_nodes, - internal_tree_node->number_of_deleted_leaf_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set first leaf node index in sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( ( number_of_leaf_nodes == 0 ) - && ( number_of_deleted_leaf_nodes == 0 ) ) - { - /* It is possible to have branch nodes without leaf nodes - */ - result = libfdata_tree_node_is_leaf( - sub_node, - file_io_handle, - cache, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if sub node: %d is a leaf.", - function, - sub_node_index ); - - return( -1 ); - } - else if( result != 0 ) - { - result = libfdata_tree_node_is_deleted( - sub_node, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if sub node: %d is deleted.", - function, - sub_node_index ); - - return( -1 ); - } - else if( result == 0 ) - { - internal_tree_node->number_of_leaf_nodes++; - } - else - { - internal_tree_node->number_of_deleted_leaf_nodes++; - } - } - } - else - { - internal_tree_node->number_of_leaf_nodes += number_of_leaf_nodes; - internal_tree_node->number_of_deleted_leaf_nodes += number_of_deleted_leaf_nodes; - } - } - return( 1 ); -} - -/* Determines if the node is a leaf node - * Returns 1 if a leaf node, 0 if not or -1 on error - */ -int libfdata_tree_node_is_leaf( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - intptr_t *node_value = NULL; - static char *function = "libfdata_tree_node_is_leaf"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ ) == 0 ) ) - { - /* Make sure the node data is read before the sub nodes - */ - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ ) == 0 ) - { - if( libfdata_tree_get_node_value( - internal_tree_node->tree, - file_io_handle, - cache, - node, - &node_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_NOTE_DATA_READ; - } - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - if( libfdata_tree_read_sub_nodes( - internal_tree_node->tree, - file_io_handle, - cache, - node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read sub nodes.", - function ); - - return( -1 ); - } - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_SUB_NODES_READ; - } - if( ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_VIRTUAL ) == 0 ) - && ( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_IS_LEAF ) != 0 ) ) - { - return( 1 ); - } - return( 0 ); -} - -/* Makes a leaf node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_leaf( - libfdata_tree_node_t *node, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_set_leaf"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( ( internal_tree_node->flags & LIBFDATA_TREE_NODE_FLAG_SUB_NODES_DATA_RANGE_SET ) != 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - sub nodes range was set.", - function ); - - return( -1 ); - } - internal_tree_node->flags |= LIBFDATA_TREE_NODE_FLAG_IS_LEAF; - - if( libfdata_tree_node_set_calculate_leaf_node_values( - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set calculate leaf node values.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Makes a leaf node of a specific sub node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_set_leaf_sub_node( - libfdata_tree_node_t *node, - int sub_node_index, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - static char *function = "libfdata_tree_node_set_leaf_sub_node"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - if( sub_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_set_leaf( - sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to set leaf in sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the number of leaf nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_number_of_leaf_nodes( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_number_of_leaf_nodes"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( number_of_leaf_nodes == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid number of leaf nodes.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_tree_node_read_leaf_node_values( - node, - file_io_handle, - cache, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - *number_of_leaf_nodes = internal_tree_node->number_of_leaf_nodes; - - return( 1 ); -} - -/* Retrieves a specific leaf node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_leaf_node_by_index( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_node_index, - libfdata_tree_node_t **leaf_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - static char *function = "libfdata_tree_node_get_leaf_node_by_index"; - int first_deleted_leaf_node_index = 0; - int first_leaf_node_index = 0; - int number_of_leaf_nodes = 0; - int number_of_sub_nodes = 0; - int result = 0; - int sub_node_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( leaf_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid leaf node.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_tree_node_read_leaf_node_values( - node, - file_io_handle, - cache, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_nodes, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub nodes array.", - function ); - - return( -1 ); - } - for( sub_node_index = 0; - sub_node_index < number_of_sub_nodes; - sub_node_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_get_number_of_leaf_nodes( - sub_node, - file_io_handle, - cache, - &number_of_leaf_nodes, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf nodes from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_get_first_leaf_node_index( - sub_node, - &first_leaf_node_index, - &first_deleted_leaf_node_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve first leaf node index from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( number_of_leaf_nodes == 0 ) - { - /* It is possible to have branch nodes without leaf nodes - */ - result = libfdata_tree_node_is_leaf( - sub_node, - file_io_handle, - cache, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if sub node: %d is a leaf.", - function, - sub_node_index ); - - return( -1 ); - } - else if( result != 0 ) - { - result = libfdata_tree_node_is_deleted( - sub_node, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if sub node: %d is deleted.", - function, - sub_node_index ); - - return( -1 ); - } - else if( result == 0 ) - { - if( leaf_node_index == first_leaf_node_index ) - { - *leaf_node = sub_node; - - break; - } - } - } - } - else if( ( leaf_node_index >= first_leaf_node_index ) - && ( leaf_node_index < ( first_leaf_node_index + number_of_leaf_nodes ) ) ) - { - /* Note that the first_leaf_node_index is relative for a branch - */ - if( libfdata_tree_node_get_leaf_node_by_index( - sub_node, - file_io_handle, - cache, - leaf_node_index - first_leaf_node_index, - leaf_node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve leaf node: %d from sub node: %d.", - function, - leaf_node_index - first_leaf_node_index, - sub_node_index ); - - return( -1 ); - } - break; - } - } - if( sub_node_index >= number_of_sub_nodes ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid sub node index value out of bounds.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the number of deleted leaf nodes - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_number_of_deleted_leaf_nodes( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_deleted_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - static char *function = "libfdata_tree_node_get_number_of_deleted_leaf_nodes"; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( number_of_deleted_leaf_nodes == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid number of deleted leaf nodes.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_tree_node_read_leaf_node_values( - node, - file_io_handle, - cache, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - *number_of_deleted_leaf_nodes = internal_tree_node->number_of_deleted_leaf_nodes; - - return( 1 ); -} - -/* Retrieves a specific deleted leaf node - * Returns 1 if successful or -1 on error - */ -int libfdata_tree_node_get_deleted_leaf_node_by_index( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int deleted_leaf_node_index, - libfdata_tree_node_t **deleted_leaf_node, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfdata_internal_tree_node_t *internal_tree_node = NULL; - libfdata_tree_node_t *sub_node = NULL; - static char *function = "libfdata_tree_node_get_deleted_leaf_node_by_index"; - int first_deleted_leaf_node_index = 0; - int first_leaf_node_index = 0; - int number_of_deleted_leaf_nodes = 0; - int number_of_sub_nodes = 0; - int result = 0; - int sub_node_index = 0; - - if( node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid node.", - function ); - - return( -1 ); - } - internal_tree_node = (libfdata_internal_tree_node_t *) node; - - if( deleted_leaf_node == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid deleted leaf node.", - function ); - - return( -1 ); - } - if( ( internal_tree_node->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_tree_node_read_leaf_node_values( - node, - file_io_handle, - cache, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve node value.", - function ); - - return( -1 ); - } - internal_tree_node->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - if( libcdata_array_get_number_of_entries( - internal_tree_node->sub_nodes, - &number_of_sub_nodes, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from sub nodes array.", - function ); - - return( -1 ); - } - for( sub_node_index = 0; - sub_node_index < number_of_sub_nodes; - sub_node_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_tree_node->sub_nodes, - sub_node_index, - (intptr_t **) &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from sub nodes array.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_get_number_of_deleted_leaf_nodes( - sub_node, - file_io_handle, - cache, - &number_of_deleted_leaf_nodes, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of leaf nodes from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libfdata_tree_node_get_first_leaf_node_index( - sub_node, - &first_leaf_node_index, - &first_deleted_leaf_node_index, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve first leaf node index from sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( number_of_deleted_leaf_nodes == 0 ) - { - /* It is possible to have branch nodes without leaf nodes - */ - result = libfdata_tree_node_is_leaf( - sub_node, - file_io_handle, - cache, - read_flags, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if sub node: %d is a leaf.", - function, - sub_node_index ); - - return( -1 ); - } - else if( result != 0 ) - { - result = libfdata_tree_node_is_deleted( - sub_node, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to determine if sub node: %d is deleted.", - function, - sub_node_index ); - - return( -1 ); - } - else if( result != 0 ) - { - if( deleted_leaf_node_index == first_deleted_leaf_node_index ) - { - *deleted_leaf_node = sub_node; - - break; - } - } - } - } - else if( ( deleted_leaf_node_index >= first_deleted_leaf_node_index ) - && ( deleted_leaf_node_index < ( first_deleted_leaf_node_index + number_of_deleted_leaf_nodes ) ) ) - { - /* Note that the first_deleted_leaf_node_index is relative for a branch - */ - if( libfdata_tree_node_get_deleted_leaf_node_by_index( - sub_node, - file_io_handle, - cache, - deleted_leaf_node_index - first_deleted_leaf_node_index, - deleted_leaf_node, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve deleted leaf node: %d from sub node: %d.", - function, - deleted_leaf_node_index - first_deleted_leaf_node_index, - sub_node_index ); - - return( -1 ); - } - break; - } - } - if( sub_node_index >= number_of_sub_nodes ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid sub node index value out of bounds.", - function ); - - return( -1 ); - } - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_tree_node.h libbde-20240223/libfdata/libfdata_tree_node.h --- libbde-20190102/libfdata/libfdata_tree_node.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_tree_node.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,359 +0,0 @@ -/* - * The tree node functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_TREE_NODE_H ) -#define _LIBFDATA_INTERNAL_TREE_NODE_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_range.h" -#include "libfdata_tree.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -#define libfdata_tree_node_calculate_branch_node_cache_entry_index( node_offset, number_of_cache_entries ) \ - ( number_of_cache_entries > 4 ) ? ( node_offset % ( number_of_cache_entries / 4 ) ) : ( node_offset % number_of_cache_entries ) - -#define libfdata_tree_node_calculate_leaf_node_cache_entry_index( node_offset, number_of_cache_entries ) \ - ( number_of_cache_entries > 4 ) ? ( number_of_cache_entries / 4 ) + ( node_offset % ( ( number_of_cache_entries * 3 ) / 4 ) ) : ( node_offset % number_of_cache_entries ) - -typedef struct libfdata_internal_tree_node libfdata_internal_tree_node_t; - -struct libfdata_internal_tree_node -{ - /* The tree reference - */ - libfdata_tree_t *tree; - - /* The parent (tree) node reference - */ - libfdata_tree_node_t *parent_node; - - /* The node data range - */ - libfdata_range_t *node_data_range; - - /* The sub nodes data range - */ - libfdata_range_t *sub_nodes_data_range; - - /* The timestamp - */ - int64_t timestamp; - - /* The flags - */ - uint8_t flags; - - /* The sub nodes (array) - */ - libcdata_array_t *sub_nodes; - - /* The number of leaf nodes - */ - int number_of_leaf_nodes; - - /* The number of deleted leaf nodes - */ - int number_of_deleted_leaf_nodes; - - /* The relative first leaf node index - */ - int first_leaf_node_index; - - /* The relative first deleted leaf node index - */ - int first_deleted_leaf_node_index; -}; - -int libfdata_tree_node_initialize( - libfdata_tree_node_t **node, - libfdata_tree_t *tree, - libfdata_tree_node_t *parent_node, - libcerror_error_t **error ); - -int libfdata_tree_node_free( - libfdata_tree_node_t **node, - libcerror_error_t **error ); - -int libfdata_tree_node_free_single( - libfdata_tree_node_t **node, - libcerror_error_t **error ); - -int libfdata_tree_node_set_parent_node( - libfdata_tree_node_t *node, - libfdata_tree_node_t *parent_node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_is_root( - libfdata_tree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_get_data_range( - libfdata_tree_node_t *node, - int *node_file_index, - off64_t *node_offset, - size64_t *node_size, - uint32_t *node_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_data_range( - libfdata_tree_node_t *node, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_sub_nodes_data_range_is_set( - libfdata_tree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_get_sub_nodes_data_range( - libfdata_tree_node_t *node, - int *sub_nodes_file_index, - off64_t *sub_nodes_offset, - size64_t *sub_nodes_size, - uint32_t *sub_nodes_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_sub_nodes_data_range( - libfdata_tree_node_t *node, - int sub_nodes_file_index, - off64_t sub_nodes_offset, - size64_t sub_nodes_size, - uint32_t sub_nodes_flags, - libcerror_error_t **error ); - -int libfdata_tree_node_get_timestamp( - libfdata_tree_node_t *node, - int64_t *timestamp, - libcerror_error_t **error ); - -int libfdata_tree_node_get_first_leaf_node_index( - libfdata_tree_node_t *node, - int *first_leaf_node_index, - int *deleted_first_leaf_node_index, - libcerror_error_t **error ); - -int libfdata_tree_node_set_first_leaf_node_index( - libfdata_tree_node_t *node, - int first_leaf_node_index, - int deleted_first_leaf_node_index, - libcerror_error_t **error ); - -/* Node value functions - */ -LIBFDATA_EXTERN \ -int libfdata_tree_node_get_node_value( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - intptr_t **node_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_node_value( - libfdata_tree_node_t *node, - libfdata_cache_t *cache, - intptr_t *node_value, - int (*free_node_value)( - intptr_t **node_value, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -/* Sub node functions - */ -LIBFDATA_EXTERN \ -int libfdata_tree_node_resize_sub_nodes( - libfdata_tree_node_t *node, - int number_of_sub_nodes, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_get_number_of_sub_nodes( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_sub_nodes, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_get_sub_node_by_index( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int sub_node_index, - libfdata_tree_node_t **sub_node, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_sub_node_by_index( - libfdata_tree_node_t *node, - int sub_node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_append_sub_node( - libfdata_tree_node_t *node, - int *sub_node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_insert_sub_node( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *sub_node_index, - int node_file_index, - off64_t node_offset, - size64_t node_size, - uint32_t node_flags, - int (*node_value_compare_function)( - intptr_t *first_node_value, - intptr_t *second_node_value, - libcerror_error_t **error ), - uint8_t insert_flags, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_split_sub_nodes( - libfdata_tree_node_t *node, - int number_of_splits, - libcerror_error_t **error ); - -/* Deleted node functions - */ -LIBFDATA_EXTERN \ -int libfdata_tree_node_is_deleted( - libfdata_tree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_deleted( - libfdata_tree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_deleted_sub_node( - libfdata_tree_node_t *node, - int sub_node_index, - libcerror_error_t **error ); - -/* Leaf node functions - */ -int libfdata_tree_node_set_calculate_leaf_node_values( - libfdata_tree_node_t *node, - libcerror_error_t **error ); - -int libfdata_tree_node_read_leaf_node_values( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_is_leaf( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_leaf( - libfdata_tree_node_t *node, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_tree_node_set_leaf_sub_node( - libfdata_tree_node_t *node, - int sub_node_index, - libcerror_error_t **error ); - -int libfdata_tree_node_get_number_of_leaf_nodes( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_tree_node_get_leaf_node_by_index( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int leaf_node_index, - libfdata_tree_node_t **leaf_node, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_tree_node_get_number_of_deleted_leaf_nodes( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int *number_of_deleted_leaf_nodes, - uint8_t read_flags, - libcerror_error_t **error ); - -int libfdata_tree_node_get_deleted_leaf_node_by_index( - libfdata_tree_node_t *node, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int deleted_leaf_node_index, - libfdata_tree_node_t **deleted_leaf_node, - uint8_t read_flags, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_TREE_NODE_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_types.h libbde-20240223/libfdata/libfdata_types.h --- libbde-20190102/libfdata/libfdata_types.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_types.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* - * The internal type definitions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_TYPES_H ) -#define _LIBFDATA_INTERNAL_TYPES_H - -#include -#include - -/* Define HAVE_LOCAL_LIBFDATA for local use of libfdata - * The definitions in are copied here - * for local use of libfdata - */ -#if defined( HAVE_LOCAL_LIBFDATA ) - -/* The following type definitions hide internal data structures - */ -#if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) -typedef struct libfdata_area {} libfdata_area_t; -typedef struct libfdata_btree {} libfdata_btree_t; -typedef struct libfdata_btree_node {} libfdata_btree_node_t; -typedef struct libfdata_cache {} libfdata_cache_t; -typedef struct libfdata_list {} libfdata_list_t; -typedef struct libfdata_list_element {} libfdata_list_element_t; -typedef struct libfdata_range_list {} libfdata_range_list_t; -typedef struct libfdata_stream {} libfdata_stream_t; -typedef struct libfdata_tree {} libfdata_tree_t; -typedef struct libfdata_tree_node {} libfdata_tree_node_t; -typedef struct libfdata_vector {} libfdata_vector_t; - -#else -typedef intptr_t libfdata_area_t; -typedef intptr_t libfdata_btree_t; -typedef intptr_t libfdata_btree_node_t; -typedef intptr_t libfdata_cache_t; -typedef intptr_t libfdata_list_t; -typedef intptr_t libfdata_list_element_t; -typedef intptr_t libfdata_range_list_t; -typedef intptr_t libfdata_stream_t; -typedef intptr_t libfdata_tree_t; -typedef intptr_t libfdata_tree_node_t; -typedef intptr_t libfdata_vector_t; - -#endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */ - -#endif /* defined( HAVE_LOCAL_LIBFDATA ) */ - -#endif /* !defined( _LIBFDATA_INTERNAL_TYPES_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_unused.h libbde-20240223/libfdata/libfdata_unused.h --- libbde-20190102/libfdata/libfdata_unused.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_unused.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* - * The internal unused definition - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_UNUSED_H ) -#define _LIBFDATA_INTERNAL_UNUSED_H - -#include - -#if !defined( LIBFDATA_ATTRIBUTE_UNUSED ) -#if defined( __GNUC__ ) && __GNUC__ >= 3 -#define LIBFDATA_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -#else -#define LIBFDATA_ATTRIBUTE_UNUSED -#endif -#endif - -#if defined( _MSC_VER ) -#define LIBFDATA_UNREFERENCED_PARAMETER( parameter ) \ - UNREFERENCED_PARAMETER( parameter ); -#else -#define LIBFDATA_UNREFERENCED_PARAMETER( parameter ) \ - /* parameter */ -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_UNUSED_H ) */ - diff -Nru libbde-20190102/libfdata/libfdata_vector.c libbde-20240223/libfdata/libfdata_vector.c --- libbde-20190102/libfdata/libfdata_vector.c 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_vector.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1889 +0,0 @@ -/* - * The vector functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#include -#include -#include - -#include "libfdata_definitions.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libcnotify.h" -#include "libfdata_libfcache.h" -#include "libfdata_mapped_range.h" -#include "libfdata_range.h" -#include "libfdata_segments_array.h" -#include "libfdata_types.h" -#include "libfdata_unused.h" -#include "libfdata_vector.h" - -/* Creates a vector - * Make sure the value vector is referencing, is set to NULL - * - * If the flag LIBFDATA_DATA_HANDLE_FLAG_MANAGED is set the vector - * takes over management of the data handle and the data handle is freed when - * no longer needed - * - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_initialize( - libfdata_vector_t **vector, - size64_t element_data_size, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_vector_t *vector, - libfdata_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_vector_t *vector, - libfdata_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_initialize"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - if( *vector != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid vector value already set.", - function ); - - return( -1 ); - } - if( element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, - "%s: invalid element data size value zero or less.", - function ); - - return( -1 ); - } - internal_vector = memory_allocate_structure( - libfdata_internal_vector_t ); - - if( internal_vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create vector.", - function ); - - goto on_error; - } - if( memory_set( - internal_vector, - 0, - sizeof( libfdata_internal_vector_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear vector.", - function ); - - memory_free( - internal_vector ); - - return( -1 ); - } - if( libcdata_array_initialize( - &( internal_vector->segments_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create segments array.", - function ); - - goto on_error; - } - if( libcdata_array_initialize( - &( internal_vector->mapped_ranges_array ), - 0, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create mapped ranges array.", - function ); - - goto on_error; - } - if( libfcache_date_time_get_timestamp( - &( internal_vector->timestamp ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache timestamp.", - function ); - - goto on_error; - } - internal_vector->element_data_size = element_data_size; - internal_vector->flags |= flags; - internal_vector->data_handle = data_handle; - internal_vector->free_data_handle = free_data_handle; - internal_vector->clone_data_handle = clone_data_handle; - internal_vector->read_element_data = read_element_data; - internal_vector->write_element_data = write_element_data; - - *vector = (libfdata_vector_t *) internal_vector; - - return( 1 ); - -on_error: - if( internal_vector != NULL ) - { - if( internal_vector->segments_array != NULL ) - { - libcdata_array_free( - &( internal_vector->segments_array ), - NULL, - NULL ); - } - memory_free( - internal_vector ); - } - return( -1 ); -} - -/* Frees a vector - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_free( - libfdata_vector_t **vector, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_free"; - int result = 1; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - if( *vector != NULL ) - { - internal_vector = (libfdata_internal_vector_t *) *vector; - *vector = NULL; - - if( libcdata_array_free( - &( internal_vector->segments_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the segments array.", - function ); - - result = -1; - } - if( libcdata_array_free( - &( internal_vector->mapped_ranges_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free the mapped ranges array.", - function ); - - result = -1; - } - if( ( internal_vector->flags & LIBFDATA_DATA_HANDLE_FLAG_MANAGED ) != 0 ) - { - if( internal_vector->data_handle != NULL ) - { - if( internal_vector->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid vector - missing free data handle function.", - function ); - - result = -1; - } - else if( internal_vector->free_data_handle( - &( internal_vector->data_handle ), - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to free data handle.", - function ); - - result = -1; - } - } - } - memory_free( - internal_vector ); - } - return( result ); -} - -/* Clones (duplicates) the vector - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_clone( - libfdata_vector_t **destination_vector, - libfdata_vector_t *source_vector, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_destination_vector = NULL; - libfdata_internal_vector_t *internal_source_vector = NULL; - static char *function = "libfdata_vector_clone"; - - if( destination_vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid destination vector.", - function ); - - return( -1 ); - } - if( *destination_vector != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid destination vector value already set.", - function ); - - return( -1 ); - } - if( source_vector == NULL ) - { - *destination_vector = source_vector; - - return( 1 ); - } - internal_source_vector = (libfdata_internal_vector_t *) source_vector; - - internal_destination_vector = memory_allocate_structure( - libfdata_internal_vector_t ); - - if( internal_destination_vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create destination vector.", - function ); - - goto on_error; - } - if( memory_set( - internal_destination_vector, - 0, - sizeof( libfdata_internal_vector_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear destination vector.", - function ); - - memory_free( - internal_destination_vector ); - - return( -1 ); - } - if( internal_source_vector->data_handle != NULL ) - { - if( internal_source_vector->free_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source vector - missing free data handle function.", - function ); - - goto on_error; - } - if( internal_source_vector->clone_data_handle == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid source vector - missing clone data handle function.", - function ); - - goto on_error; - } - if( internal_source_vector->clone_data_handle( - &( internal_destination_vector->data_handle ), - internal_source_vector->data_handle, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination data handle.", - function ); - - goto on_error; - } - } - if( libcdata_array_clone( - &( internal_destination_vector->segments_array ), - internal_source_vector->segments_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination segments array.", - function ); - - goto on_error; - } - if( libcdata_array_clone( - &( internal_destination_vector->mapped_ranges_array ), - internal_source_vector->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - (int (*)(intptr_t **, intptr_t *, libcerror_error_t **)) &libfdata_mapped_range_clone, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create destination mapped ranges array.", - function ); - - goto on_error; - } - internal_destination_vector->element_data_size = internal_source_vector->element_data_size; - internal_destination_vector->timestamp = internal_source_vector->timestamp; - internal_destination_vector->flags = internal_source_vector->flags | LIBFDATA_DATA_HANDLE_FLAG_MANAGED; - internal_destination_vector->data_handle = internal_source_vector->data_handle; - internal_destination_vector->free_data_handle = internal_source_vector->free_data_handle; - internal_destination_vector->clone_data_handle = internal_source_vector->clone_data_handle; - internal_destination_vector->read_element_data = internal_source_vector->read_element_data; - internal_destination_vector->write_element_data = internal_source_vector->write_element_data; - - *destination_vector = (libfdata_vector_t *) internal_destination_vector; - - return( 1 ); - -on_error: - if( internal_destination_vector != NULL ) - { - if( internal_destination_vector->segments_array != NULL ) - { - libcdata_array_free( - &( internal_destination_vector->segments_array ), - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - NULL ); - } - if( ( internal_destination_vector->data_handle != NULL ) - && ( internal_source_vector->free_data_handle != NULL ) ) - { - internal_source_vector->free_data_handle( - &( internal_destination_vector->data_handle ), - NULL ); - } - memory_free( - internal_destination_vector ); - } - return( -1 ); -} - -/* Segment functions - */ - -/* Empties the vector - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_empty( - libfdata_vector_t *vector, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_empty"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libcdata_array_empty( - internal_vector->segments_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty segments array.", - function ); - - return( -1 ); - } - if( libcdata_array_empty( - internal_vector->mapped_ranges_array, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to empty mapped ranges array.", - function ); - - return( -1 ); - } - internal_vector->size = 0; - - return( 1 ); -} - -/* Resizes the segments - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_resize( - libfdata_vector_t *vector, - int number_of_segments, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_resize"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libcdata_array_resize( - internal_vector->segments_array, - number_of_segments, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize segments array.", - function ); - - return( -1 ); - } - if( libcdata_array_resize( - internal_vector->mapped_ranges_array, - number_of_segments, - (int (*)(intptr_t **, libcerror_error_t **)) &libfdata_mapped_range_free, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED, - "%s: unable to resize mapped ranges array.", - function ); - - return( -1 ); - } - internal_vector->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Retrieves the number of segments of the vector - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_number_of_segments( - libfdata_vector_t *vector, - int *number_of_segments, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_get_number_of_segments"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libcdata_array_get_number_of_entries( - internal_vector->segments_array, - number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from segments array.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the offset and size of a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_segment_by_index( - libfdata_vector_t *vector, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_get_segment_by_index"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libfdata_segments_array_get_segment_by_index( - internal_vector->segments_array, - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d.", - function, - segment_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the offset and size of a specific segment - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_set_segment_by_index( - libfdata_vector_t *vector, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_set_segment_by_index"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libfdata_segments_array_set_segment_by_index( - internal_vector->segments_array, - internal_vector->mapped_ranges_array, - &( internal_vector->size ), - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set segment: %d.", - function, - segment_index ); - - return( -1 ); - } - internal_vector->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Prepends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_prepend_segment( - libfdata_vector_t *vector, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_prepend_segment"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libfdata_segments_array_prepend_segment( - internal_vector->segments_array, - internal_vector->mapped_ranges_array, - &( internal_vector->size ), - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to prepend segment.", - function ); - - return( -1 ); - } - internal_vector->flags |= LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES; - - return( 1 ); -} - -/* Appends a segment - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_append_segment( - libfdata_vector_t *vector, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_append_segment"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( libfdata_segments_array_append_segment( - internal_vector->segments_array, - internal_vector->mapped_ranges_array, - &( internal_vector->size ), - segment_index, - segment_file_index, - segment_offset, - segment_size, - segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append segment.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Vector element functions - */ - -/* Retrieves the element data size of the vector - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_element_data_size( - libfdata_vector_t *vector, - size64_t *element_data_size, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_get_element_data_size"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( element_data_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element data size.", - function ); - - return( -1 ); - } - *element_data_size = internal_vector->element_data_size; - - return( 1 ); -} - -/* Retrieves the number of elements of the vector - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_number_of_elements( - libfdata_vector_t *vector, - int *number_of_elements, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_get_number_of_elements"; - size64_t safe_number_of_elements = 0; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( internal_vector->element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - element data size value out of bounds.", - function ); - - return( -1 ); - } - if( number_of_elements == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid number of elements.", - function ); - - return( -1 ); - } - safe_number_of_elements = internal_vector->size / internal_vector->element_data_size; - - if( ( internal_vector->size % internal_vector->element_data_size ) != 0 ) - { - safe_number_of_elements++; - } - if( safe_number_of_elements > (size64_t) INT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: number of elements value out of bounds.", - function ); - - return( -1 ); - } - *number_of_elements = (int) safe_number_of_elements; - - return( 1 ); -} - -/* Mapped range functions - */ - -/* Retrieves the element index for a specific offset - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_element_index_at_offset( - libfdata_vector_t *vector, - off64_t element_value_offset, - int *element_index, - off64_t *element_data_offset, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - libfdata_mapped_range_t *mapped_range = NULL; - static char *function = "libfdata_vector_get_element_index_at_offset"; - off64_t mapped_range_end_offset = 0; - off64_t mapped_range_start_offset = 0; - off64_t segment_data_offset = 0; - size64_t mapped_range_size = 0; - uint64_t calculated_element_index = 0; - int initial_segment_index = 0; - int number_of_segments = 0; - int segment_index = 0; - int result = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - libfdata_range_t *segment_data_range = NULL; - off64_t segment_offset = 0; - size64_t segment_size = 0; - uint32_t segment_flags = 0; - int segment_file_index = -1; -#endif - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( internal_vector->element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - element data size value out of bounds.", - function ); - - return( -1 ); - } - if( internal_vector->size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - size value out of bounds.", - function ); - - return( -1 ); - } - if( element_value_offset < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO, - "%s: invalid element value offset value less than zero.", - function ); - - return( -1 ); - } - if( element_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element index.", - function ); - - return( -1 ); - } - if( element_data_offset == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid element data offset.", - function ); - - return( -1 ); - } - if( ( internal_vector->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_segments_array_calculate_mapped_ranges( - internal_vector->segments_array, - internal_vector->mapped_ranges_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges from segments array.", - function ); - - return( -1 ); - } - internal_vector->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: requested offset: 0x%08" PRIx64 "\n", - function, - element_value_offset ); - } -#endif - if( internal_vector->size == 0 ) - { - return( 0 ); - } - if( libcdata_array_get_number_of_entries( - internal_vector->mapped_ranges_array, - &number_of_segments, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve number of entries from mapped ranges array.", - function ); - - return( -1 ); - } - /* This assumes a fairly even distribution of the sizes of the segments - */ - initial_segment_index = (int) ( ( number_of_segments * element_value_offset ) / internal_vector->size ); - - /* Look for the corresponding segment upwards in the array - */ - for( segment_index = initial_segment_index; - segment_index < number_of_segments; - segment_index++ ) - { - if( libcdata_array_get_entry_by_index( - internal_vector->mapped_ranges_array, - segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_start_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - segment_index ); - - return( -1 ); - } - mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; - - if( mapped_range_end_offset < mapped_range_start_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment: %d - mapped range value out of bounds.", - function, - segment_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - segment_index, - mapped_range_start_offset, - mapped_range_end_offset, - mapped_range_size ); - } -#endif - /* Check if the element value offset is in the mapped range - */ - if( ( element_value_offset >= mapped_range_start_offset ) - && ( element_value_offset < mapped_range_end_offset ) ) - { - break; - } - /* Check if the element value offset is out of bounds - */ - if( element_value_offset < mapped_range_start_offset ) - { - segment_index = number_of_segments; - - break; - } - } - if( segment_index >= number_of_segments ) - { - /* Look for the corresponding segment downwards in the array - */ - for( segment_index = initial_segment_index; - segment_index >= 0; - segment_index-- ) - { - if( libcdata_array_get_entry_by_index( - internal_vector->mapped_ranges_array, - segment_index, - (intptr_t **) &mapped_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from mapped ranges array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_mapped_range_get( - mapped_range, - &mapped_range_start_offset, - &mapped_range_size, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to retrieve values from mapped range: %d.", - function, - segment_index ); - - return( -1 ); - } - mapped_range_end_offset = mapped_range_start_offset + (off64_t) mapped_range_size; - - if( mapped_range_end_offset < mapped_range_start_offset ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid segment: %d - mapped range value out of bounds.", - function, - segment_index ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: segment: %03d\tmapped range: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - segment_index, - mapped_range_start_offset, - mapped_range_end_offset, - mapped_range_size ); - } -#endif - /* Check if the element value offset is in the mapped range - */ - if( ( element_value_offset >= mapped_range_start_offset ) - && ( element_value_offset < mapped_range_end_offset ) ) - { - break; - } - /* Check if the element value offset is out of bounds - */ - if( element_value_offset > mapped_range_start_offset ) - { - segment_index = -1; - - break; - } - segment_data_offset += (off64_t) mapped_range_size; - } - } - if( ( segment_index >= 0 ) - && ( segment_index < number_of_segments ) ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( libcdata_array_get_entry_by_index( - internal_vector->segments_array, - segment_index, - (intptr_t **) &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve entry: %d from segments array.", - function, - segment_index ); - - return( -1 ); - } - if( libfdata_range_get( - segment_data_range, - &segment_file_index, - &segment_offset, - &segment_size, - &segment_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment: %d data range values.", - function, - segment_index ); - - return( -1 ); - } - libcnotify_printf( - "%s: segment: %03d\tfile index: %03d offset: 0x%08" PRIx64 " - 0x%08" PRIx64 " (size: %" PRIu64 ")\n", - function, - segment_index, - segment_file_index, - segment_offset, - segment_offset + segment_size, - segment_size ); - } -#endif - calculated_element_index = (uint64_t) element_value_offset / internal_vector->element_data_size; - - if( calculated_element_index > (uint64_t) INT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid element index value exceeds maximum.", - function ); - - return( -1 ); - } - /* The element data offset is relative from the start of the vector element not the underlying segment - */ - *element_index = (int) calculated_element_index; - *element_data_offset = element_value_offset % internal_vector->element_data_size; - - result = 1; - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "\n" ); - } -#endif - return( result ); -} - -/* Vector element value functions - */ - -/* Retrieves the value of a specific element - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_element_value_by_index( - libfdata_vector_t *vector, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - libfcache_cache_value_t *cache_value = NULL; - libfdata_internal_vector_t *internal_vector = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_vector_get_element_value_by_index"; - off64_t cache_value_offset = (off64_t) -1; - off64_t element_data_offset = 0; - int64_t cache_value_timestamp = 0; - uint32_t element_data_flags = 0; - int cache_value_file_index = -1; - int element_data_file_index = -1; - int result = 0; - -#if defined( HAVE_DEBUG_OUTPUT ) - const char *hit_or_miss = NULL; -#endif - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( internal_vector->read_element_data == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid vector - missing read element data function.", - function ); - - return( -1 ); - } - if( internal_vector->element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - element data size value out of bounds.", - function ); - - return( -1 ); - } - if( ( internal_vector->size == 0 ) - || ( internal_vector->size > (off64_t) INT64_MAX ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - size value out of bounds.", - function ); - - return( -1 ); - } - if( element_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element index value out of bounds.", - function ); - - return( -1 ); - } - element_data_offset = (off64_t) ( element_index * internal_vector->element_data_size ); - - if( (size64_t) element_data_offset > internal_vector->size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element index value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_segments_array_get_data_range_at_offset( - internal_vector->segments_array, - element_data_offset, - &element_data_offset, - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", - function, - element_data_offset ); - - return( -1 ); - } - if( segment_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing segment data range.", - function ); - - return( -1 ); - } - element_data_file_index = segment_data_range->file_index; - element_data_offset += segment_data_range->offset; - element_data_flags = segment_data_range->flags; - - if( ( read_flags & LIBFDATA_READ_FLAG_IGNORE_CACHE ) == 0 ) - { - result = libfcache_cache_get_value_by_identifier( - (libfcache_cache_t *) cache, - element_data_file_index, - element_data_offset, - internal_vector->timestamp, - &cache_value, - error ); - - if( result == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from cache.", - function ); - - return( -1 ); - } -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - if( result == 0 ) - { - hit_or_miss = "miss"; - } - else - { - hit_or_miss = "hit"; - } - libcnotify_printf( - "%s: cache: 0x%08" PRIjx " %s\n", - function, - (intptr_t) cache, - hit_or_miss ); - } -#endif /* defined( HAVE_DEBUG_OUTPUT ) */ - } - if( result == 0 ) - { -#if defined( HAVE_DEBUG_OUTPUT ) - if( libcnotify_verbose != 0 ) - { - libcnotify_printf( - "%s: reading element data at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIu64 "\n", - function, - element_data_offset, - element_data_offset, - internal_vector->element_data_size ); - } -#endif - if( internal_vector->read_element_data( - internal_vector->data_handle, - file_io_handle, - vector, - cache, - element_index, - element_data_file_index, - element_data_offset, - internal_vector->element_data_size, - element_data_flags, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_IO, - LIBCERROR_IO_ERROR_READ_FAILED, - "%s: unable to read element data at offset: 0x%08" PRIx64 ".", - function, - element_data_offset ); - - return( -1 ); - } - if( libfcache_cache_get_value_by_identifier( - (libfcache_cache_t *) cache, - element_data_file_index, - element_data_offset, - internal_vector->timestamp, - &cache_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve value from cache.", - function ); - - return( -1 ); - } - if( libfcache_cache_value_get_identifier( - cache_value, - &cache_value_file_index, - &cache_value_offset, - &cache_value_timestamp, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve cache value identifier.", - function ); - - return( -1 ); - } - if( ( element_data_file_index != cache_value_file_index ) - || ( element_data_offset != cache_value_offset ) - || ( internal_vector->timestamp != cache_value_timestamp ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid cache value - identifier value out of bounds.", - function ); - - return( -1 ); - } - } - if( libfcache_cache_value_get_value( - cache_value, - element_value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element value.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the value an element at a specific offset - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_element_value_at_offset( - libfdata_vector_t *vector, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t element_value_offset, - off64_t *element_data_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ) -{ - static char *function = "libfdata_vector_get_element_value_at_offset"; - int element_index = 0; - - if( libfdata_vector_get_element_index_at_offset( - vector, - element_value_offset, - &element_index, - element_data_offset, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element index at offset: 0x%08" PRIx64 ".", - function, - element_value_offset ); - - return( -1 ); - } - if( libfdata_vector_get_element_value_by_index( - vector, - file_io_handle, - cache, - element_index, - element_value, - read_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve element: %d value.", - function, - element_index ); - - return( -1 ); - } - return( 1 ); -} - -/* Sets the value of a specific element - * - * If the flag LIBFDATA_VECTOR_ELEMENT_VALUE_FLAG_MANAGED is set the vector - * takes over management of the value and the value is freed when - * no longer needed. - * - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_set_element_value_by_index( - libfdata_vector_t *vector, - intptr_t *file_io_handle LIBFDATA_ATTRIBUTE_UNUSED, - libfdata_cache_t *cache, - int element_index, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - libfdata_range_t *segment_data_range = NULL; - static char *function = "libfdata_vector_set_element_value_by_index"; - off64_t element_data_offset = 0; - - LIBFDATA_UNREFERENCED_PARAMETER( file_io_handle ) - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( internal_vector->element_data_size == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - element data size value out of bounds.", - function ); - - return( -1 ); - } - if( ( internal_vector->size == 0 ) - || ( internal_vector->size > (off64_t) INT64_MAX ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid vector - size value out of bounds.", - function ); - - return( -1 ); - } - if( element_index < 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element index value out of bounds.", - function ); - - return( -1 ); - } - element_data_offset = (off64_t) ( element_index * internal_vector->element_data_size ); - - if( (size64_t) element_data_offset > internal_vector->size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid element index value out of bounds.", - function ); - - return( -1 ); - } - if( libfdata_segments_array_get_data_range_at_offset( - internal_vector->segments_array, - element_data_offset, - &element_data_offset, - &segment_data_range, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve segment data range for offset: 0x%08" PRIx64 ".", - function, - element_data_offset ); - - return( -1 ); - } - if( segment_data_range == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: missing segment data range.", - function ); - - return( -1 ); - } - element_data_offset += segment_data_range->offset; - - if( libfcache_cache_set_value_by_identifier( - (libfcache_cache_t *) cache, - segment_data_range->file_index, - element_data_offset, - internal_vector->timestamp, - element_value, - free_element_value, - write_flags, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set value in cache.", - function ); - - return( -1 ); - } - return( 1 ); -} - -/* Retrieves the size - * Returns 1 if successful or -1 on error - */ -int libfdata_vector_get_size( - libfdata_vector_t *vector, - size64_t *size, - libcerror_error_t **error ) -{ - libfdata_internal_vector_t *internal_vector = NULL; - static char *function = "libfdata_vector_get_size"; - - if( vector == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid vector.", - function ); - - return( -1 ); - } - internal_vector = (libfdata_internal_vector_t *) vector; - - if( size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid size.", - function ); - - return( -1 ); - } - if( ( internal_vector->flags & LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ) != 0 ) - { - if( libfdata_segments_array_calculate_mapped_ranges( - internal_vector->segments_array, - internal_vector->mapped_ranges_array, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to calculate mapped ranges.", - function ); - - return( -1 ); - } - internal_vector->flags &= ~( LIBFDATA_FLAG_CALCULATE_MAPPED_RANGES ); - } - *size = internal_vector->size; - - return( 1 ); -} - diff -Nru libbde-20190102/libfdata/libfdata_vector.h libbde-20240223/libfdata/libfdata_vector.h --- libbde-20190102/libfdata/libfdata_vector.h 2019-01-02 15:57:23.000000000 +0000 +++ libbde-20240223/libfdata/libfdata_vector.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,295 +0,0 @@ -/* - * The vector functions - * - * Copyright (C) 2010-2018, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software 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 General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBFDATA_INTERNAL_VECTOR_H ) -#define _LIBFDATA_INTERNAL_VECTOR_H - -#include -#include - -#include "libfdata_extern.h" -#include "libfdata_libcdata.h" -#include "libfdata_libcerror.h" -#include "libfdata_libfcache.h" -#include "libfdata_types.h" - -#if defined( __cplusplus ) -extern "C" { -#endif - -typedef struct libfdata_internal_vector libfdata_internal_vector_t; - -struct libfdata_internal_vector -{ - /* The element data size - */ - size64_t element_data_size; - - /* The (vector) size - */ - size64_t size; - - /* The segments array - */ - libcdata_array_t *segments_array; - - /* The mapped ranges array - */ - libcdata_array_t *mapped_ranges_array; - - /* The timestamp - */ - int64_t timestamp; - - /* The flags - */ - uint8_t flags; - - /* The data handle - */ - intptr_t *data_handle; - - /* The free data handle function - */ - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ); - - /* The clone (duplicate) data handle function - */ - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ); - - /* The read element data function - */ - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_vector_t *vector, - libfdata_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ); - - /* The write element data function - */ - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_vector_t *vector, - libfdata_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ); -}; - -LIBFDATA_EXTERN \ -int libfdata_vector_initialize( - libfdata_vector_t **vector, - size64_t element_data_size, - intptr_t *data_handle, - int (*free_data_handle)( - intptr_t **data_handle, - libcerror_error_t **error ), - int (*clone_data_handle)( - intptr_t **destination_data_handle, - intptr_t *source_data_handle, - libcerror_error_t **error ), - int (*read_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_vector_t *vector, - libfdata_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t read_flags, - libcerror_error_t **error ), - int (*write_element_data)( - intptr_t *data_handle, - intptr_t *file_io_handle, - libfdata_vector_t *vector, - libfdata_cache_t *cache, - int element_index, - int element_data_file_index, - off64_t element_data_offset, - size64_t element_data_size, - uint32_t element_data_flags, - uint8_t write_flags, - libcerror_error_t **error ), - uint8_t flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_free( - libfdata_vector_t **vector, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_clone( - libfdata_vector_t **destination_vector, - libfdata_vector_t *source_vector, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_empty( - libfdata_vector_t *vector, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_resize( - libfdata_vector_t *vector, - int number_of_segments, - libcerror_error_t **error ); - -/* Segment functions - */ -LIBFDATA_EXTERN \ -int libfdata_vector_get_number_of_segments( - libfdata_vector_t *vector, - int *number_of_segments, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_get_segment_by_index( - libfdata_vector_t *vector, - int segment_index, - int *segment_file_index, - off64_t *segment_offset, - size64_t *segment_size, - uint32_t *segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_set_segment_by_index( - libfdata_vector_t *vector, - int segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_prepend_segment( - libfdata_vector_t *vector, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_append_segment( - libfdata_vector_t *vector, - int *segment_index, - int segment_file_index, - off64_t segment_offset, - size64_t segment_size, - uint32_t segment_flags, - libcerror_error_t **error ); - -/* Vector element functions - */ -LIBFDATA_EXTERN \ -int libfdata_vector_get_element_data_size( - libfdata_vector_t *vector, - size64_t *element_data_size, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_get_number_of_elements( - libfdata_vector_t *vector, - int *number_of_elements, - libcerror_error_t **error ); - -/* Mapped range functions - */ -LIBFDATA_EXTERN \ -int libfdata_vector_get_element_index_at_offset( - libfdata_vector_t *vector, - off64_t element_value_offset, - int *element_index, - off64_t *element_data_offset, - libcerror_error_t **error ); - -/* Vector element value functions - */ -LIBFDATA_EXTERN \ -int libfdata_vector_get_element_value_by_index( - libfdata_vector_t *vector, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_get_element_value_at_offset( - libfdata_vector_t *vector, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - off64_t element_value_offset, - off64_t *element_data_offset, - intptr_t **element_value, - uint8_t read_flags, - libcerror_error_t **error ); - -LIBFDATA_EXTERN \ -int libfdata_vector_set_element_value_by_index( - libfdata_vector_t *vector, - intptr_t *file_io_handle, - libfdata_cache_t *cache, - int element_index, - intptr_t *element_value, - int (*free_element_value)( - intptr_t **element_value, - libcerror_error_t **error ), - uint8_t write_flags, - libcerror_error_t **error ); - -/* IO functions - */ -LIBFDATA_EXTERN \ -int libfdata_vector_get_size( - libfdata_vector_t *vector, - size64_t *size, - libcerror_error_t **error ); - -#if defined( __cplusplus ) -} -#endif - -#endif /* !defined( _LIBFDATA_INTERNAL_VECTOR_H ) */ - diff -Nru libbde-20190102/libfdatetime/Makefile.am libbde-20240223/libfdatetime/Makefile.am --- libbde-20190102/libfdatetime/Makefile.am 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/Makefile.am 2024-02-23 03:03:35.000000000 +0000 @@ -28,9 +28,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libfdatetime ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdatetime_la_SOURCES) diff -Nru libbde-20190102/libfdatetime/Makefile.in libbde-20240223/libfdatetime/Makefile.in --- libbde-20190102/libfdatetime/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libfdatetime/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libfdatetime ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -200,6 +200,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -217,8 +218,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -235,6 +234,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -246,8 +251,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -265,7 +272,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -283,7 +289,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -337,8 +342,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -357,6 +360,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -367,8 +371,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -391,26 +395,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -419,7 +403,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -438,6 +421,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -480,9 +464,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -551,8 +532,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -575,11 +554,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -711,6 +687,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -763,7 +741,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -907,6 +884,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -923,15 +908,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libfdatetime ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdatetime_la_SOURCES) diff -Nru libbde-20190102/libfdatetime/libfdatetime_date_time_values.c libbde-20240223/libfdatetime/libfdatetime_date_time_values.c --- libbde-20190102/libfdatetime/libfdatetime_date_time_values.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_date_time_values.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Date and time values functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_date_time_values.h libbde-20240223/libfdatetime/libfdatetime_date_time_values.h --- libbde-20190102/libfdatetime/libfdatetime_date_time_values.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_date_time_values.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Date and time values functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_DATE_TIME_VALUES_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_definitions.h libbde-20240223/libfdatetime/libfdatetime_definitions.h --- libbde-20190102/libfdatetime/libfdatetime_definitions.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_definitions.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBFDATETIME_INTERNAL_DEFINITIONS_H ) @@ -36,11 +36,11 @@ #else #include -#define LIBFDATETIME_VERSION 20180910 +#define LIBFDATETIME_VERSION 20240115 /* The version string */ -#define LIBFDATETIME_VERSION_STRING "20180910" +#define LIBFDATETIME_VERSION_STRING "20240115" /* The byte order definitions */ diff -Nru libbde-20190102/libfdatetime/libfdatetime_error.c libbde-20240223/libfdatetime/libfdatetime_error.c --- libbde-20190102/libfdatetime/libfdatetime_error.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_error.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_error.h libbde-20240223/libfdatetime/libfdatetime_error.h --- libbde-20190102/libfdatetime/libfdatetime_error.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_error.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_extern.h libbde-20240223/libfdatetime/libfdatetime_extern.h --- libbde-20190102/libfdatetime/libfdatetime_extern.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_extern.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBFDATETIME_EXTERN_VARIABLE extern +#else #define LIBFDATETIME_EXTERN_VARIABLE LIBFDATETIME_EXTERN +#endif #else #define LIBFDATETIME_EXTERN /* extern */ diff -Nru libbde-20190102/libfdatetime/libfdatetime_fat_date_time.c libbde-20240223/libfdatetime/libfdatetime_fat_date_time.c --- libbde-20190102/libfdatetime/libfdatetime_fat_date_time.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_fat_date_time.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * FAT date and time functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_fat_date_time.h libbde-20240223/libfdatetime/libfdatetime_fat_date_time.h --- libbde-20190102/libfdatetime/libfdatetime_fat_date_time.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_fat_date_time.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * FAT date and time functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_FAT_DATE_TIME_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_filetime.c libbde-20240223/libfdatetime/libfdatetime_filetime.c --- libbde-20190102/libfdatetime/libfdatetime_filetime.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_filetime.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * FILETIME functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_filetime.h libbde-20240223/libfdatetime/libfdatetime_filetime.h --- libbde-20190102/libfdatetime/libfdatetime_filetime.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_filetime.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * FILETIME functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_FILETIME_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_floatingtime.c libbde-20240223/libfdatetime/libfdatetime_floatingtime.c --- libbde-20190102/libfdatetime/libfdatetime_floatingtime.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_floatingtime.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Floatingtime functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_floatingtime.h libbde-20240223/libfdatetime/libfdatetime_floatingtime.h --- libbde-20190102/libfdatetime/libfdatetime_floatingtime.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_floatingtime.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Floatingtime functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_FLOATINGTIME_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_hfs_time.c libbde-20240223/libfdatetime/libfdatetime_hfs_time.c --- libbde-20190102/libfdatetime/libfdatetime_hfs_time.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_hfs_time.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * HFS time functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_hfs_time.h libbde-20240223/libfdatetime/libfdatetime_hfs_time.h --- libbde-20190102/libfdatetime/libfdatetime_hfs_time.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_hfs_time.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * HFS time functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_HFS_TIME_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_libcerror.h libbde-20240223/libfdatetime/libfdatetime_libcerror.h --- libbde-20190102/libfdatetime/libfdatetime_libcerror.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_libcerror.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_LIBCERROR_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_nsf_timedate.c libbde-20240223/libfdatetime/libfdatetime_nsf_timedate.c --- libbde-20190102/libfdatetime/libfdatetime_nsf_timedate.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_nsf_timedate.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notes Storage Facility (NSF) timedate functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_nsf_timedate.h libbde-20240223/libfdatetime/libfdatetime_nsf_timedate.h --- libbde-20190102/libfdatetime/libfdatetime_nsf_timedate.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_nsf_timedate.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Notes Storage Facility (NSF) timedate functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_NSF_TIMEDATE_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_posix_time.c libbde-20240223/libfdatetime/libfdatetime_posix_time.c --- libbde-20190102/libfdatetime/libfdatetime_posix_time.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_posix_time.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * POSIX time functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_posix_time.h libbde-20240223/libfdatetime/libfdatetime_posix_time.h --- libbde-20190102/libfdatetime/libfdatetime_posix_time.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_posix_time.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * POSIX time functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_POSIX_TIME_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_support.c libbde-20240223/libfdatetime/libfdatetime_support.c --- libbde-20190102/libfdatetime/libfdatetime_support.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_support.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_support.h libbde-20240223/libfdatetime/libfdatetime_support.h --- libbde-20190102/libfdatetime/libfdatetime_support.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_support.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_SUPPORT_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_systemtime.c libbde-20240223/libfdatetime/libfdatetime_systemtime.c --- libbde-20190102/libfdatetime/libfdatetime_systemtime.c 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_systemtime.c 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * SYSTEMTIME functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfdatetime/libfdatetime_systemtime.h libbde-20240223/libfdatetime/libfdatetime_systemtime.h --- libbde-20190102/libfdatetime/libfdatetime_systemtime.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_systemtime.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * SYSTEMTIME functions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_SYSTEMTIME_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_types.h libbde-20240223/libfdatetime/libfdatetime_types.h --- libbde-20190102/libfdatetime/libfdatetime_types.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_types.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFDATETIME_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libfdatetime/libfdatetime_unused.h libbde-20240223/libfdatetime/libfdatetime_unused.h --- libbde-20190102/libfdatetime/libfdatetime_unused.h 2019-01-02 15:57:25.000000000 +0000 +++ libbde-20240223/libfdatetime/libfdatetime_unused.h 2024-02-23 03:03:35.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2009-2018, Joachim Metz + * Copyright (C) 2009-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBFDATETIME_INTERNAL_UNUSED_H ) -#define _LIBFDATETIME_INTERNAL_UNUSED_H +#if !defined( _LIBFDATETIME_UNUSED_H ) +#define _LIBFDATETIME_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBFDATETIME_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBFDATETIME_UNUSED_H ) */ diff -Nru libbde-20190102/libfguid/Makefile.am libbde-20240223/libfguid/Makefile.am --- libbde-20190102/libfguid/Makefile.am 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/Makefile.am 2024-02-23 03:03:36.000000000 +0000 @@ -2,7 +2,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ + @LIBCERROR_CPPFLAGS@ noinst_LTLIBRARIES = libfguid.la @@ -21,9 +21,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libfguid ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfguid_la_SOURCES) diff -Nru libbde-20190102/libfguid/Makefile.in libbde-20240223/libfguid/Makefile.in --- libbde-20190102/libfguid/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libfguid/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libfguid ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -178,6 +178,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -195,8 +196,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -213,6 +212,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -224,8 +229,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -243,7 +250,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -261,7 +267,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -315,8 +320,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -335,6 +338,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -345,8 +349,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -369,26 +373,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -397,7 +381,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -416,6 +399,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -458,9 +442,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -529,8 +510,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -553,11 +532,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -569,7 +545,7 @@ @HAVE_LOCAL_LIBFGUID_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBFGUID_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBFGUID_TRUE@ -I$(top_srcdir)/common \ -@HAVE_LOCAL_LIBFGUID_TRUE@ @LIBCERROR_CPPFLAGS@ +@HAVE_LOCAL_LIBFGUID_TRUE@ @LIBCERROR_CPPFLAGS@ @HAVE_LOCAL_LIBFGUID_TRUE@noinst_LTLIBRARIES = libfguid.la @HAVE_LOCAL_LIBFGUID_TRUE@libfguid_la_SOURCES = \ @@ -675,6 +651,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -727,7 +705,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -864,6 +841,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -880,15 +865,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libfguid ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfguid_la_SOURCES) diff -Nru libbde-20190102/libfguid/libfguid_definitions.h libbde-20240223/libfguid/libfguid_definitions.h --- libbde-20190102/libfguid/libfguid_definitions.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_definitions.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBFGUID_INTERNAL_DEFINITIONS_H ) @@ -36,11 +36,11 @@ #else #include -#define LIBFGUID_VERSION 20180724 +#define LIBFGUID_VERSION 20240116 /* The version string */ -#define LIBFGUID_VERSION_STRING "20180724" +#define LIBFGUID_VERSION_STRING "20240116" /* The byte order definitions */ diff -Nru libbde-20190102/libfguid/libfguid_error.c libbde-20240223/libfguid/libfguid_error.c --- libbde-20190102/libfguid/libfguid_error.c 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_error.c 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfguid/libfguid_error.h libbde-20240223/libfguid/libfguid_error.h --- libbde-20190102/libfguid/libfguid_error.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_error.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFGUID_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libfguid/libfguid_extern.h libbde-20240223/libfguid/libfguid_extern.h --- libbde-20190102/libfguid/libfguid_extern.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_extern.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFGUID_INTERNAL_EXTERN_H ) @@ -28,16 +28,13 @@ */ #if !defined( HAVE_LOCAL_LIBFGUID ) -/* If libtool DLL support is enabled set LIBFGUID_DLL_EXPORT - * before including libfguid/extern.h - */ -#if defined( _WIN32 ) && defined( DLL_EXPORT ) -#define LIBFGUID_DLL_EXPORT -#endif - #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBFGUID_EXTERN_VARIABLE extern +#else #define LIBFGUID_EXTERN_VARIABLE LIBFGUID_EXTERN +#endif #else #define LIBFGUID_EXTERN /* extern */ diff -Nru libbde-20190102/libfguid/libfguid_identifier.c libbde-20240223/libfguid/libfguid_identifier.c --- libbde-20190102/libfguid/libfguid_identifier.c 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_identifier.c 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * GUID functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfguid/libfguid_identifier.h libbde-20240223/libfguid/libfguid_identifier.h --- libbde-20190102/libfguid/libfguid_identifier.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_identifier.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * Global (or Universal) Unique Identifier (GUID/UUID) functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFGUID_INTERNAL_IDENTIFIER_H ) diff -Nru libbde-20190102/libfguid/libfguid_libcerror.h libbde-20240223/libfguid/libfguid_libcerror.h --- libbde-20190102/libfguid/libfguid_libcerror.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_libcerror.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFGUID_LIBCERROR_H ) diff -Nru libbde-20190102/libfguid/libfguid_support.c libbde-20240223/libfguid/libfguid_support.c --- libbde-20190102/libfguid/libfguid_support.c 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_support.c 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfguid/libfguid_support.h libbde-20240223/libfguid/libfguid_support.h --- libbde-20190102/libfguid/libfguid_support.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_support.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFGUID_SUPPORT_H ) diff -Nru libbde-20190102/libfguid/libfguid_types.h libbde-20240223/libfguid/libfguid_types.h --- libbde-20190102/libfguid/libfguid_types.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_types.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFGUID_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libfguid/libfguid_unused.h libbde-20240223/libfguid/libfguid_unused.h --- libbde-20190102/libfguid/libfguid_unused.h 2019-01-02 15:57:27.000000000 +0000 +++ libbde-20240223/libfguid/libfguid_unused.h 2024-02-23 03:03:36.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBFGUID_INTERNAL_UNUSED_H ) -#define _LIBFGUID_INTERNAL_UNUSED_H +#if !defined( _LIBFGUID_UNUSED_H ) +#define _LIBFGUID_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBFGUID_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBFGUID_UNUSED_H ) */ diff -Nru libbde-20190102/libfvalue/Makefile.am libbde-20240223/libfvalue/Makefile.am --- libbde-20190102/libfvalue/Makefile.am 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/Makefile.am 2024-02-23 03:03:37.000000000 +0000 @@ -30,8 +30,8 @@ libfvalue_libfguid.h \ libfvalue_libfwnt.h \ libfvalue_libuna.h \ - libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ libfvalue_split_utf8_string.c libfvalue_split_utf8_string.h \ + libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ libfvalue_string.c libfvalue_string.h \ libfvalue_types.h \ libfvalue_table.c libfvalue_table.h \ @@ -40,17 +40,19 @@ libfvalue_value_type.c libfvalue_value_type.h \ libfvalue_support.c libfvalue_support.h \ libfvalue_unused.h \ - libfvalue_utf16_string.c libfvalue_utf16_string.h \ - libfvalue_utf8_string.c libfvalue_utf8_string.h + libfvalue_utf8_string.c libfvalue_utf8_string.h \ + libfvalue_utf16_string.c libfvalue_utf16_string.h endif MAINTAINERCLEANFILES = \ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libfvalue ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfvalue_la_SOURCES) diff -Nru libbde-20190102/libfvalue/Makefile.in libbde-20240223/libfvalue/Makefile.in --- libbde-20190102/libfvalue/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libfvalue/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libfvalue ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -130,16 +130,16 @@ libfvalue_libcerror.h libfvalue_libcnotify.h \ libfvalue_libfdatetime.h libfvalue_libfguid.h \ libfvalue_libfwnt.h libfvalue_libuna.h \ - libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ libfvalue_split_utf8_string.c libfvalue_split_utf8_string.h \ + libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ libfvalue_string.c libfvalue_string.h libfvalue_types.h \ libfvalue_table.c libfvalue_table.h libfvalue_value.c \ libfvalue_value.h libfvalue_value_entry.c \ libfvalue_value_entry.h libfvalue_value_type.c \ libfvalue_value_type.h libfvalue_support.c libfvalue_support.h \ - libfvalue_unused.h libfvalue_utf16_string.c \ - libfvalue_utf16_string.h libfvalue_utf8_string.c \ - libfvalue_utf8_string.h + libfvalue_unused.h libfvalue_utf8_string.c \ + libfvalue_utf8_string.h libfvalue_utf16_string.c \ + libfvalue_utf16_string.h @HAVE_LOCAL_LIBFVALUE_TRUE@am_libfvalue_la_OBJECTS = \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_binary_data.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_data_handle.lo \ @@ -147,16 +147,16 @@ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_filetime.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_floating_point.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_integer.lo \ -@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf16_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf8_string.lo \ +@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf16_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_string.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_table.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_entry.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_type.lo \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_support.lo \ -@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf16_string.lo \ -@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf8_string.lo +@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf8_string.lo \ +@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf16_string.lo libfvalue_la_OBJECTS = $(am_libfvalue_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -220,6 +220,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -237,8 +238,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -255,6 +254,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -266,8 +271,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -285,7 +292,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -303,7 +309,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -357,8 +362,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -377,6 +380,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -387,8 +391,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -411,26 +415,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -439,7 +423,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -458,6 +441,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -500,9 +484,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -571,8 +552,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -595,11 +574,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -638,8 +614,8 @@ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libfguid.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libfwnt.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_libuna.h \ -@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf8_string.c libfvalue_split_utf8_string.h \ +@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_split_utf16_string.c libfvalue_split_utf16_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_string.c libfvalue_string.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_types.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_table.c libfvalue_table.h \ @@ -648,8 +624,8 @@ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_value_type.c libfvalue_value_type.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_support.c libfvalue_support.h \ @HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_unused.h \ -@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf16_string.c libfvalue_utf16_string.h \ -@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf8_string.c libfvalue_utf8_string.h +@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf8_string.c libfvalue_utf8_string.h \ +@HAVE_LOCAL_LIBFVALUE_TRUE@ libfvalue_utf16_string.c libfvalue_utf16_string.h MAINTAINERCLEANFILES = \ Makefile.in @@ -757,6 +733,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -809,7 +787,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -959,6 +936,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -975,15 +960,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libfvalue ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfvalue_la_SOURCES) diff -Nru libbde-20190102/libfvalue/libfvalue_binary_data.c libbde-20240223/libfvalue/libfvalue_binary_data.c --- libbde-20190102/libfvalue/libfvalue_binary_data.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_binary_data.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Binary data value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -304,6 +304,17 @@ return( -1 ); } + if( utf8_string_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string size.", + function ); + + return( -1 ); + } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; @@ -335,17 +346,6 @@ return( -1 ); } - if( utf8_string_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-8 string size.", - function ); - - return( -1 ); - } *utf8_string_size = 0; if( ( binary_data->data != NULL ) @@ -456,77 +456,77 @@ return( -1 ); } - supported_flags = 0x000000ffUL - | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER - | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; - - if( ( string_format_flags & ~( supported_flags ) ) != 0 ) + if( utf8_string == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported string format flags: 0x%08" PRIx32 ".", - function, - string_format_flags ); + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string.", + function ); return( -1 ); } - string_format_type = string_format_flags & 0x000000ffUL; - - if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) - && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) - && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) + if( utf8_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported string format type.", + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UTF-8 string size value exceeds maximum.", function ); return( -1 ); } - if( utf8_string == NULL ) + if( utf8_string_index == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-8 string.", + "%s: invalid UTF-8 string index.", function ); return( -1 ); } - if( utf8_string_size > (size_t) SSIZE_MAX ) + if( *utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid UTF-8 string size value exceeds maximum.", + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-8 string is too small.", function ); return( -1 ); } - if( utf8_string_index == NULL ) + supported_flags = 0x000000ffUL + | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER + | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; + + if( ( string_format_flags & ~( supported_flags ) ) != 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-8 string index.", - function ); + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported string format flags: 0x%08" PRIx32 ".", + function, + string_format_flags ); return( -1 ); } - if( *utf8_string_index >= utf8_string_size ) + string_format_type = string_format_flags & 0x000000ffUL; + + if( ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 ) + && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 ) + && ( string_format_type != LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: UTF-8 string is too small.", + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported string format type.", function ); return( -1 ); @@ -643,6 +643,17 @@ return( -1 ); } + if( utf16_string_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-16 string size.", + function ); + + return( -1 ); + } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; @@ -674,17 +685,6 @@ return( -1 ); } - if( utf16_string_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-16 string size.", - function ); - - return( -1 ); - } *utf16_string_size = 0; if( ( binary_data->data != NULL ) @@ -858,6 +858,17 @@ return( -1 ); } + if( utf16_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-16 string.", + function ); + + return( -1 ); + } if( utf16_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( @@ -880,7 +891,7 @@ return( -1 ); } - if( *utf16_string_index > utf16_string_size ) + if( *utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, @@ -922,50 +933,6 @@ return( -1 ); } - if( utf16_string == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-16 string.", - function ); - - return( -1 ); - } - if( utf16_string_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid UTF-16 string size value exceeds maximum.", - function ); - - return( -1 ); - } - if( utf16_string_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-16 string index.", - function ); - - return( -1 ); - } - if( *utf16_string_index >= utf16_string_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: UTF-16 string is too small.", - function ); - - return( -1 ); - } if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) { @@ -1139,6 +1106,17 @@ return( -1 ); } + if( utf32_string_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-32 string size.", + function ); + + return( -1 ); + } supported_flags = 0x000000ffUL | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER | LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER; @@ -1170,17 +1148,6 @@ return( -1 ); } - if( utf32_string_size == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-32 string size.", - function ); - - return( -1 ); - } *utf32_string_size = 0; if( ( binary_data->data != NULL ) @@ -1354,6 +1321,17 @@ return( -1 ); } + if( utf32_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-32 string.", + function ); + + return( -1 ); + } if( utf32_string_size > (size_t) SSIZE_MAX ) { libcerror_error_set( @@ -1376,7 +1354,7 @@ return( -1 ); } - if( *utf32_string_index > utf32_string_size ) + if( *utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, @@ -1417,50 +1395,6 @@ function ); return( -1 ); - } - if( utf32_string == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-32 string.", - function ); - - return( -1 ); - } - if( utf32_string_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid UTF-32 string size value exceeds maximum.", - function ); - - return( -1 ); - } - if( utf32_string_index == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-32 string index.", - function ); - - return( -1 ); - } - if( *utf32_string_index >= utf32_string_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: UTF-32 string is too small.", - function ); - - return( -1 ); } if( ( binary_data->data != NULL ) && ( binary_data->data_size != 0 ) ) diff -Nru libbde-20190102/libfvalue/libfvalue_binary_data.h libbde-20240223/libfvalue/libfvalue_binary_data.h --- libbde-20190102/libfvalue/libfvalue_binary_data.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_binary_data.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Binary data value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_BINARY_DATA_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_codepage.h libbde-20240223/libfvalue/libfvalue_codepage.h --- libbde-20190102/libfvalue/libfvalue_codepage.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_codepage.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Codepage functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_CODEPAGE_H ) @@ -70,6 +70,7 @@ LIBFVALUE_CODEPAGE_UTF32_BIG_ENDIAN = 12001, LIBFVALUE_CODEPAGE_UTF7 = 65000, LIBFVALUE_CODEPAGE_UTF8 = 65001, + LIBFVALUE_CODEPAGE_SCSU = 65002, LIBFVALUE_CODEPAGE_WINDOWS_874 = 874, LIBFVALUE_CODEPAGE_WINDOWS_932 = 932, @@ -87,7 +88,7 @@ LIBFVALUE_CODEPAGE_WINDOWS_1258 = 1258, /* A special codepage to indicate codepage 1200 that uses ASCII strings as well. - * This has primarily been seen in the ESE database format and could be SCSU. + * This has primarily been seen in the ESE database format. */ LIBFVALUE_CODEPAGE_1200_MIXED = (int) 0x800004b0 }; diff -Nru libbde-20190102/libfvalue/libfvalue_data_handle.c libbde-20240223/libfvalue/libfvalue_data_handle.c --- libbde-20190102/libfvalue/libfvalue_data_handle.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_data_handle.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Data handle functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfvalue/libfvalue_data_handle.h libbde-20240223/libfvalue/libfvalue_data_handle.h --- libbde-20190102/libfvalue/libfvalue_data_handle.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_data_handle.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Data handle functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_DATA_HANDLE_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_definitions.h libbde-20240223/libfvalue/libfvalue_definitions.h --- libbde-20190102/libfvalue/libfvalue_definitions.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_definitions.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBFVALUE_INTERNAL_DEFINITIONS_H ) @@ -36,17 +36,17 @@ #else #include -#define LIBFVALUE_VERSION 20180817 +#define LIBFVALUE_VERSION 20240124 /* The libfvalue version string */ -#define LIBFVALUE_VERSION_STRING "20180817" +#define LIBFVALUE_VERSION_STRING "20240124" /* The endian definitions */ -#define LIBFVALUE_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG -#define LIBFVALUE_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE -#define LIBFVALUE_ENDIAN_NATIVE (uint8_t) 'n' +#define LIBFVALUE_ENDIAN_BIG _BYTE_STREAM_ENDIAN_BIG +#define LIBFVALUE_ENDIAN_LITTLE _BYTE_STREAM_ENDIAN_LITTLE +#define LIBFVALUE_ENDIAN_NATIVE (uint8_t) 'n' /* The value flags definitions */ @@ -56,35 +56,35 @@ * the data handle is expected to be available * during the life-time of the value */ - LIBFVALUE_VALUE_FLAG_DATA_HANDLE_NON_MANAGED = 0x00, + LIBFVALUE_VALUE_FLAG_DATA_HANDLE_NON_MANAGED = 0x00, /* The data handle is managed by the value */ - LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED = 0x01, + LIBFVALUE_VALUE_FLAG_DATA_HANDLE_MANAGED = 0x01, /* The identifier is not managed by the value * the identifier is expected to be available * during the life-time of the value */ - LIBFVALUE_VALUE_FLAG_IDENTIFIER_NON_MANAGED = 0x00, + LIBFVALUE_VALUE_FLAG_IDENTIFIER_NON_MANAGED = 0x00, /* The identifier is managed by the value */ - LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED = 0x02, + LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED = 0x02, /* The data is not managed by the value * the data is expected to be available * during the life-time of the value */ - LIBFVALUE_VALUE_FLAG_DATA_NON_MANAGED = 0x00, + LIBFVALUE_VALUE_FLAG_DATA_NON_MANAGED = 0x00, /* The data is managed by the value */ - LIBFVALUE_VALUE_FLAG_DATA_MANAGED = 0x04, + LIBFVALUE_VALUE_FLAG_DATA_MANAGED = 0x04, /* The value has a runtime instance of the value type */ - LIBFVALUE_VALUE_FLAG_HAS_RUNTIME_INSTANCE = 0x08, + LIBFVALUE_VALUE_FLAG_HAS_RUNTIME_INSTANCE = 0x08, }; /* The value identifier flags definitions @@ -100,16 +100,16 @@ * if LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED is set * a copy of the identifier will be managed by the value */ - LIBFVALUE_VALUE_IDENTIFIER_FLAG_NON_MANAGED = 0x00, + LIBFVALUE_VALUE_IDENTIFIER_FLAG_NON_MANAGED = 0x00, /* The identifier is managed by the value * This will also set LIBFVALUE_VALUE_FLAG_IDENTIFIER_MANAGED in the value */ - LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED = 0x01, + LIBFVALUE_VALUE_IDENTIFIER_FLAG_MANAGED = 0x01, /* The identifier is not cloned, but passed as a reference */ - LIBFVALUE_VALUE_IDENTIFIER_FLAG_CLONE_BY_REFERENCE = 0x10 + LIBFVALUE_VALUE_IDENTIFIER_FLAG_CLONE_BY_REFERENCE = 0x10 }; /* The value data flags definitions @@ -125,23 +125,23 @@ * if LIBFVALUE_VALUE_FLAG_DATA_MANAGED is set * a copy of the data will be managed by the value */ - LIBFVALUE_VALUE_DATA_FLAG_NON_MANAGED = 0x00, + LIBFVALUE_VALUE_DATA_FLAG_NON_MANAGED = 0x00, /* The data is managed by the value * This will also set LIBFVALUE_VALUE_FLAG_DATA_MANAGED in the value */ - LIBFVALUE_VALUE_DATA_FLAG_MANAGED = 0x02, + LIBFVALUE_VALUE_DATA_FLAG_MANAGED = 0x02, /* The data is not cloned, but passed as a reference */ - LIBFVALUE_VALUE_DATA_FLAG_CLONE_BY_REFERENCE = 0x10 + LIBFVALUE_VALUE_DATA_FLAG_CLONE_BY_REFERENCE = 0x10 }; /* The value class definitions */ enum LIBFVALUE_VALUE_CLASSES { - LIBFVALUE_VALUE_CLASS_UNDEFINED = 0, + LIBFVALUE_VALUE_CLASS_UNDEFINED = 0, LIBFVALUE_VALUE_CLASS_BINARY, LIBFVALUE_VALUE_CLASS_BOOLEAN, LIBFVALUE_VALUE_CLASS_DATETIME, @@ -155,7 +155,7 @@ */ enum LIBFVALUE_VALUE_TYPES { - LIBFVALUE_VALUE_TYPE_UNDEFINED = 0, + LIBFVALUE_VALUE_TYPE_UNDEFINED = 0, LIBFVALUE_VALUE_TYPE_NULL, @@ -199,12 +199,12 @@ */ enum LIBFVALUE_BINARY_DATA_FORMAT_FLAGS { - LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 = 0x00000001UL, - LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 = 0x00000002UL, - LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 = 0x00000003UL, + LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE16 = 0x00000001UL, + LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE32 = 0x00000002UL, + LIBFVALUE_BINARY_DATA_FORMAT_TYPE_BASE64 = 0x00000003UL, - LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER = 0x00000100UL, - LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER = 0x00000200UL, + LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_LOWER = 0x00000100UL, + LIBFVALUE_BINARY_DATA_FORMAT_FLAG_CASE_UPPER = 0x00000200UL, }; /* The date time value format definition flags @@ -213,39 +213,39 @@ { /* Format the date time value in C time */ - LIBFVALUE_DATE_TIME_FORMAT_TYPE_CTIME = 0x00000001UL, + LIBFVALUE_DATE_TIME_FORMAT_TYPE_CTIME = 0x00000001UL, /* Format the date time value in ISO 8601 */ - LIBFVALUE_DATE_TIME_FORMAT_TYPE_ISO8601 = 0x00000002UL, + LIBFVALUE_DATE_TIME_FORMAT_TYPE_ISO8601 = 0x00000002UL, /* Format the date time value as a date only */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE = 0x00000100UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE = 0x00000100UL, /* Format the date time value as a time only */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME = 0x00000200UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME = 0x00000200UL, /* Format the date time value as a duration */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_DURATION = 0x00000400UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_DURATION = 0x00000400UL, /* Format the date time value with a time in milli seconds */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MILLI_SECONDS = 0x00010000UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MILLI_SECONDS = 0x00010000UL, /* Format the date time value with a time in micro seconds */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MICRO_SECONDS = 0x00020000UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_MICRO_SECONDS = 0x00020000UL, /* Format the date time value with a time in nano seconds */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_NANO_SECONDS = 0x00040000UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIME_NANO_SECONDS = 0x00040000UL, /* Add a timezone indicator */ - LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIMEZONE_INDICATOR = 0x80000000UL, + LIBFVALUE_DATE_TIME_FORMAT_FLAG_TIMEZONE_INDICATOR = 0x80000000UL, }; #define LIBFVALUE_DATE_TIME_FORMAT_FLAG_DATE_TIME \ @@ -266,38 +266,38 @@ { /* Format the using lower case */ - LIBFVALUE_GUID_FORMAT_FLAG_USE_LOWER_CASE = 0x00000001UL, + LIBFVALUE_GUID_FORMAT_FLAG_USE_LOWER_CASE = 0x00000001UL, /* Format the using upper case */ - LIBFVALUE_GUID_FORMAT_FLAG_USE_UPPER_CASE = 0x00000002UL, + LIBFVALUE_GUID_FORMAT_FLAG_USE_UPPER_CASE = 0x00000002UL, /* Format the using surrounding braces { GUID } */ - LIBFVALUE_GUID_FORMAT_FLAG_USE_SURROUNDING_BRACES = 0x00000004UL + LIBFVALUE_GUID_FORMAT_FLAG_USE_SURROUNDING_BRACES = 0x00000004UL }; /* The floating point value format flags */ enum LIBFVALUE_FLOATING_POINT_FORMAT_FLAGS { - LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL = 0x00000001UL, - LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL = 0x00000002UL + LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_DECIMAL = 0x00000001UL, + LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL = 0x00000002UL }; /* The integer value format flags */ enum LIBFVALUE_INTEGER_FORMAT_FLAGS { - LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL = 0x00000001UL, - LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL = 0x00000002UL, - LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN = 0x00000003UL, + LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL = 0x00000001UL, + LIBFVALUE_INTEGER_FORMAT_TYPE_HEXADECIMAL = 0x00000002UL, + LIBFVALUE_INTEGER_FORMAT_TYPE_BOOLEAN = 0x00000003UL, - LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED = 0x00000100UL, - LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED = 0x00000200UL, + LIBFVALUE_INTEGER_FORMAT_FLAG_SIGNED = 0x00000100UL, + LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED = 0x00000200UL, /* The integer has no base indicator e.g. 0x */ - LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR = 0x00010000UL + LIBFVALUE_INTEGER_FORMAT_FLAG_NO_BASE_INDICATOR = 0x00010000UL }; #define LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_SIGNED \ @@ -306,13 +306,33 @@ #define LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL_UNSIGNED \ LIBFVALUE_INTEGER_FORMAT_TYPE_DECIMAL | LIBFVALUE_INTEGER_FORMAT_FLAG_UNSIGNED +/* The POSIX time value encodings, which need to be combined with a byte order indication + */ +enum LIBFVALUE_POSIX_TIME_ENCODINGS +{ + LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_32BIT_SIGNED = 0x00000000UL, + LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_32BIT_UNSIGNED = 0x00000100UL, + LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_64BIT_SIGNED = 0x00000200UL, + LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_64BIT_UNSIGNED = 0x00000300UL, + LIBFVALUE_POSIX_TIME_ENCODING_MICRO_SECONDS_64BIT_SIGNED = 0x00000400UL, + LIBFVALUE_POSIX_TIME_ENCODING_MICRO_SECONDS_64BIT_UNSIGNED = 0x00000500UL, + LIBFVALUE_POSIX_TIME_ENCODING_NANO_SECONDS_64BIT_SIGNED = 0x00000600UL, + LIBFVALUE_POSIX_TIME_ENCODING_NANO_SECONDS_64BIT_UNSIGNED = 0x00000700UL +}; + +#define LIBFVALUE_POSIX_TIME_ENCODING_32BIT_BIG_ENDIAN \ + LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_32BIT_SIGNED | LIBFVALUE_ENDIAN_BIG + +#define LIBFVALUE_POSIX_TIME_ENCODING_32BIT_LITTLE_ENDIAN \ + LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_32BIT_SIGNED | LIBFVALUE_ENDIAN_LITTLE + /* The table flag definitions */ enum LIBFVALUE_TABLE_FLAGS { /* Allow a partial match of the identifier */ - LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH = 0x01 + LIBFVALUE_TABLE_FLAG_ALLOW_PARTIAL_MATCH = 0x01 }; /* The print flags definitions @@ -321,7 +341,7 @@ { /* Print the value with a type description */ - LIBFVALUE_PRINT_FLAG_WITH_TYPE_DESCRIPTION = 0x01 + LIBFVALUE_PRINT_FLAG_WITH_TYPE_DESCRIPTION = 0x01 }; #endif /* !defined( HAVE_LOCAL_LIBFVALUE ) */ diff -Nru libbde-20190102/libfvalue/libfvalue_error.c libbde-20240223/libfvalue/libfvalue_error.c --- libbde-20190102/libfvalue/libfvalue_error.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_error.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfvalue/libfvalue_error.h libbde-20240223/libfvalue/libfvalue_error.h --- libbde-20190102/libfvalue/libfvalue_error.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_error.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_extern.h libbde-20240223/libfvalue/libfvalue_extern.h --- libbde-20190102/libfvalue/libfvalue_extern.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_extern.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBFVALUE_EXTERN_VARIABLE extern +#else #define LIBFVALUE_EXTERN_VARIABLE LIBFVALUE_EXTERN +#endif #else #define LIBFVALUE_EXTERN /* extern */ diff -Nru libbde-20190102/libfvalue/libfvalue_filetime.c libbde-20240223/libfvalue/libfvalue_filetime.c --- libbde-20190102/libfvalue/libfvalue_filetime.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_filetime.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Filetime functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -27,7 +27,7 @@ #include "libfvalue_libcerror.h" #include "libfvalue_libfdatetime.h" -#if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) +#if defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) /* Copies the filetime from an integer value * Returns 1 if successful or -1 on error @@ -109,5 +109,5 @@ return( 1 ); } -#endif /* defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ +#endif /* defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ diff -Nru libbde-20190102/libfvalue/libfvalue_filetime.h libbde-20240223/libfvalue/libfvalue_filetime.h --- libbde-20190102/libfvalue/libfvalue_filetime.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_filetime.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Filetime functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_FILETIME_H ) @@ -32,7 +32,7 @@ extern "C" { #endif -#if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) +#if defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) int libfvalue_filetime_copy_from_integer( libfdatetime_filetime_t *filetime, @@ -46,7 +46,7 @@ size_t *integer_value_size, libcerror_error_t **error ); -#endif /* defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ +#endif /* defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ #if defined( __cplusplus ) } diff -Nru libbde-20190102/libfvalue/libfvalue_floating_point.c libbde-20240223/libfvalue/libfvalue_floating_point.c --- libbde-20190102/libfvalue/libfvalue_floating_point.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_floating_point.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Floating point value (IEEE 754) functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -1980,12 +1980,12 @@ } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { - number_of_characters = (uint16_t) ( floating_point_value_size >> 2 ) + 3; + number_of_characters = (uint8_t) ( floating_point_value_size >> 2 ) + 3; } else { - bit_shift = (uint16_t) ( floating_point_value_size - 1 ); - is_signed = (uint16_t) ( floating_point_value >> bit_shift ); + bit_shift = (int8_t) ( floating_point_value_size - 1 ); + is_signed = (uint8_t) ( floating_point_value >> bit_shift ); if( is_signed != 0 ) { @@ -2118,7 +2118,7 @@ utf16_string[ safe_utf16_string_index++ ] = (uint16_t) '0'; utf16_string[ safe_utf16_string_index++ ] = (uint16_t) 'x'; - bit_shift = (uint16_t) ( floating_point_value_size - 4 ); + bit_shift = (int8_t) ( floating_point_value_size - 4 ); do { @@ -2290,8 +2290,8 @@ uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; + uint16_t character_value = 0; uint8_t byte_value = 0; - uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; double value_fraction = 0.0; @@ -2435,7 +2435,7 @@ { character_value = utf16_string[ safe_utf16_string_index++ ]; - if(character_value != (uint16_t) '0' ) + if( character_value != (uint16_t) '0' ) { libcerror_error_set( error, @@ -2797,12 +2797,12 @@ } if( string_format_type == LIBFVALUE_FLOATING_POINT_FORMAT_TYPE_HEXADECIMAL ) { - number_of_characters = (uint32_t) ( floating_point_value_size >> 2 ) + 3; + number_of_characters = (uint8_t) ( floating_point_value_size >> 2 ) + 3; } else { - bit_shift = (uint32_t) ( floating_point_value_size - 1 ); - is_signed = (uint32_t) ( floating_point_value >> bit_shift ); + bit_shift = (int8_t) ( floating_point_value_size - 1 ); + is_signed = (uint8_t) ( floating_point_value >> bit_shift ); if( is_signed != 0 ) { @@ -2935,7 +2935,7 @@ utf32_string[ safe_utf32_string_index++ ] = (uint32_t) '0'; utf32_string[ safe_utf32_string_index++ ] = (uint32_t) 'x'; - bit_shift = (uint32_t) ( floating_point_value_size - 4 ); + bit_shift = (int8_t) ( floating_point_value_size - 4 ); do { @@ -3105,10 +3105,10 @@ size_t safe_utf32_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; + uint32_t character_value = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; - uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; double value_fraction = 0.0; diff -Nru libbde-20190102/libfvalue/libfvalue_floating_point.h libbde-20240223/libfvalue/libfvalue_floating_point.h --- libbde-20190102/libfvalue/libfvalue_floating_point.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_floating_point.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Floating point value (IEEE 754) functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_FLOATING_POINT_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_integer.c libbde-20240223/libfvalue/libfvalue_integer.c --- libbde-20190102/libfvalue/libfvalue_integer.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_integer.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Integer value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -1542,9 +1542,10 @@ safe_utf8_string_index++; } - if( sign == -1 ) + if( ( sign == -1 ) + && ( value_64bit != 0 ) ) { - value_64bit |= (uint64_t) 1 << bit_shift; + value_64bit = ~( value_64bit - 1 ); } } *utf8_string_index = safe_utf8_string_index; @@ -1891,8 +1892,8 @@ uint64_t value_64bit = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; + uint16_t character_value = 0; uint8_t byte_value = 0; - uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; @@ -2206,9 +2207,10 @@ safe_utf16_string_index++; } - if( sign == -1 ) + if( ( sign == -1 ) + && ( value_64bit != 0 ) ) { - value_64bit |= (uint64_t) 1 << bit_shift; + value_64bit = ~( value_64bit - 1 ); } } *utf16_string_index = safe_utf16_string_index; @@ -2553,10 +2555,10 @@ size_t safe_utf32_string_index = 0; uint64_t divider = 0; uint64_t value_64bit = 0; + uint32_t character_value = 0; uint32_t string_format_type = 0; uint32_t supported_flags = 0; uint8_t byte_value = 0; - uint8_t character_value = 0; int8_t bit_shift = 0; int8_t sign = 1; @@ -2870,9 +2872,10 @@ safe_utf32_string_index++; } - if( sign == -1 ) + if( ( sign == -1 ) + && ( value_64bit != 0 ) ) { - value_64bit |= (uint64_t) 1 << bit_shift; + value_64bit = ~( value_64bit - 1 ); } } *utf32_string_index = safe_utf32_string_index; diff -Nru libbde-20190102/libfvalue/libfvalue_integer.h libbde-20240223/libfvalue/libfvalue_integer.h --- libbde-20190102/libfvalue/libfvalue_integer.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_integer.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Integer value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTEGER_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_libcdata.h libbde-20240223/libfvalue/libfvalue_libcdata.h --- libbde-20190102/libfvalue/libfvalue_libcdata.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libcdata.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcdata header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBCDATA_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_libcerror.h libbde-20240223/libfvalue/libfvalue_libcerror.h --- libbde-20190102/libfvalue/libfvalue_libcerror.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libcerror.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBCERROR_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_libcnotify.h libbde-20240223/libfvalue/libfvalue_libcnotify.h --- libbde-20190102/libfvalue/libfvalue_libcnotify.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libcnotify.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libcnotify header * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBCNOTIFY_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_libfdatetime.h libbde-20240223/libfvalue/libfvalue_libfdatetime.h --- libbde-20190102/libfvalue/libfvalue_libfdatetime.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libfdatetime.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfdatetime header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBFDATETIME_H ) @@ -41,7 +41,7 @@ /* Note that libfvalue does not require to have libfdatetime support */ -#elif defined( HAVE_LIBFDATETIME_H ) +#elif defined( HAVE_LIBFDATETIME ) /* If libtool DLL support is enabled set LIBFDATETIME_DLL_IMPORT * before including libfdatetime.h diff -Nru libbde-20190102/libfvalue/libfvalue_libfguid.h libbde-20240223/libfvalue/libfvalue_libfguid.h --- libbde-20190102/libfvalue/libfvalue_libfguid.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libfguid.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfguid header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBFGUID_H ) @@ -34,7 +34,7 @@ /* Note that libfvalue does not require to have libfguid support */ -#elif defined( HAVE_LIBFGUID_H ) +#elif defined( HAVE_LIBFGUID ) /* If libtool DLL support is enabled set LIBFGUID_DLL_IMPORT * before including libfguid.h diff -Nru libbde-20190102/libfvalue/libfvalue_libfwnt.h libbde-20240223/libfvalue/libfvalue_libfwnt.h --- libbde-20190102/libfvalue/libfvalue_libfwnt.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libfwnt.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfwnt header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBFWNT_H ) @@ -40,7 +40,7 @@ /* Note that libfvalue does not require to have libfwnt support */ -#elif defined( HAVE_LIBFWNT_H ) +#elif defined( HAVE_LIBFWNT ) /* If libtool DLL support is enabled set LIBFWNT_DLL_IMPORT * before including libfwnt.h diff -Nru libbde-20190102/libfvalue/libfvalue_libuna.h libbde-20240223/libfvalue/libfvalue_libuna.h --- libbde-20190102/libfvalue/libfvalue_libuna.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_libuna.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_LIBUNA_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_split_utf16_string.c libbde-20240223/libfvalue/libfvalue_split_utf16_string.c --- libbde-20190102/libfvalue/libfvalue_split_utf16_string.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_split_utf16_string.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split UTF-16 string functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfvalue/libfvalue_split_utf16_string.h libbde-20240223/libfvalue/libfvalue_split_utf16_string.h --- libbde-20190102/libfvalue/libfvalue_split_utf16_string.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_split_utf16_string.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split UTF-16 string functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_SPLIT_UTF16_STRING_H ) @@ -29,6 +29,13 @@ #include "libfvalue_libcerror.h" #include "libfvalue_types.h" +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) + +/* This inclusion is needed otherwise some linkers mess up exporting the UTF-16 string functions. + */ +#include "libfvalue_utf16_string.h" +#endif + #if defined( __cplusplus ) extern "C" { #endif diff -Nru libbde-20190102/libfvalue/libfvalue_split_utf8_string.c libbde-20240223/libfvalue/libfvalue_split_utf8_string.c --- libbde-20190102/libfvalue/libfvalue_split_utf8_string.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_split_utf8_string.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split UTF-8 string functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfvalue/libfvalue_split_utf8_string.h libbde-20240223/libfvalue/libfvalue_split_utf8_string.h --- libbde-20190102/libfvalue/libfvalue_split_utf8_string.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_split_utf8_string.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Split UTF-8 string functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_SPLIT_UTF8_STRING_H ) @@ -29,6 +29,13 @@ #include "libfvalue_libcerror.h" #include "libfvalue_types.h" +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) + +/* This inclusion is needed otherwise some linkers mess up exporting the UTF-8 string functions. + */ +#include "libfvalue_utf8_string.h" +#endif + #if defined( __cplusplus ) extern "C" { #endif diff -Nru libbde-20190102/libfvalue/libfvalue_string.c libbde-20240223/libfvalue/libfvalue_string.c --- libbde-20190102/libfvalue/libfvalue_string.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_string.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * String value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -347,6 +347,7 @@ && ( encoding != LIBFVALUE_CODEPAGE_UTF32_LITTLE_ENDIAN ) && ( encoding != LIBFVALUE_CODEPAGE_UTF7 ) && ( encoding != LIBFVALUE_CODEPAGE_UTF8 ) + && ( encoding != LIBFVALUE_CODEPAGE_SCSU ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_874 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_932 ) && ( encoding != LIBFVALUE_CODEPAGE_WINDOWS_936 ) @@ -510,6 +511,7 @@ switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: + case LIBFVALUE_CODEPAGE_SCSU: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, @@ -887,6 +889,24 @@ } break; + case LIBFVALUE_CODEPAGE_SCSU: + if( libuna_utf8_string_size_from_scsu_stream( + string->data, + string->data_size, + utf8_string_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine UTF-8 string size of SCSU stream.", + function ); + + return( -1 ); + } + break; + case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) @@ -1148,6 +1168,26 @@ } break; + case LIBFVALUE_CODEPAGE_SCSU: + if( libuna_utf8_string_with_index_copy_from_scsu_stream( + utf8_string, + utf8_string_size, + utf8_string_index, + string->data, + string->data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to copy SCSU stream to UTF-8 string.", + function ); + + return( -1 ); + } + break; + case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) @@ -1349,6 +1389,7 @@ switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: + case LIBFVALUE_CODEPAGE_SCSU: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, @@ -1726,6 +1767,24 @@ } break; + case LIBFVALUE_CODEPAGE_SCSU: + if( libuna_utf16_string_size_from_scsu_stream( + string->data, + string->data_size, + utf16_string_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine UTF-16 string size of SCSU stream.", + function ); + + return( -1 ); + } + break; + case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) @@ -1987,6 +2046,26 @@ } break; + case LIBFVALUE_CODEPAGE_SCSU: + if( libuna_utf16_string_with_index_copy_from_scsu_stream( + utf16_string, + utf16_string_size, + utf16_string_index, + string->data, + string->data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to copy SCSU stream to UTF-16 string.", + function ); + + return( -1 ); + } + break; + case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) @@ -2188,6 +2267,7 @@ switch( string->codepage ) { case LIBFVALUE_CODEPAGE_1200_MIXED: + case LIBFVALUE_CODEPAGE_SCSU: libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, @@ -2565,6 +2645,24 @@ } break; + case LIBFVALUE_CODEPAGE_SCSU: + if( libuna_utf32_string_size_from_scsu_stream( + string->data, + string->data_size, + utf32_string_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_GET_FAILED, + "%s: unable to determine UTF-32 string size of SCSU stream.", + function ); + + return( -1 ); + } + break; + case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) @@ -2826,6 +2924,26 @@ } break; + case LIBFVALUE_CODEPAGE_SCSU: + if( libuna_utf32_string_with_index_copy_from_scsu_stream( + utf32_string, + utf32_string_size, + utf32_string_index, + string->data, + string->data_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to copy SCSU stream to UTF-32 string.", + function ); + + return( -1 ); + } + break; + case LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN: case LIBFVALUE_CODEPAGE_UTF16_LITTLE_ENDIAN: if( string->codepage == LIBFVALUE_CODEPAGE_UTF16_BIG_ENDIAN ) diff -Nru libbde-20190102/libfvalue/libfvalue_string.h libbde-20240223/libfvalue/libfvalue_string.h --- libbde-20190102/libfvalue/libfvalue_string.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_string.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * String value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBVALUE_STRING_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_support.c libbde-20240223/libfvalue/libfvalue_support.c --- libbde-20190102/libfvalue/libfvalue_support.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_support.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfvalue/libfvalue_support.h libbde-20240223/libfvalue/libfvalue_support.h --- libbde-20190102/libfvalue/libfvalue_support.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_support.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_SUPPORT_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_table.c libbde-20240223/libfvalue/libfvalue_table.c --- libbde-20190102/libfvalue/libfvalue_table.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_table.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Values table functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -93,7 +93,10 @@ "%s: unable to clear values table.", function ); - goto on_error; + memory_free( + internal_table ); + + return( -1 ); } if( libcdata_array_initialize( &( internal_table->values ), @@ -952,7 +955,8 @@ return( -1 ); } - if( utf8_string_size > (size_t) SSIZE_MAX ) + if( ( utf8_string_size == 0 ) + || ( utf8_string_size > (size_t) SSIZE_MAX ) ) { libcerror_error_set( error, @@ -1014,6 +1018,10 @@ { continue; } + if( string_index >= utf8_string_size ) + { + break; + } /* Determine if the XML tag is an open or close tag: '/' */ if( utf8_string[ string_index ] != 0x2f ) @@ -1025,6 +1033,11 @@ xml_tag_type = LIBFVALUE_XML_TAG_TYPE_CLOSE; string_index++; + + if( string_index >= utf8_string_size ) + { + break; + } } xml_tag_name = &( utf8_string[ string_index ] ); xml_tag_name_length = 0; @@ -1049,6 +1062,10 @@ } string_index++; } + if( string_index >= utf8_string_size ) + { + break; + } /* TODO add support for XML tag attributes but ignore them for now */ while( string_index < utf8_string_size ) @@ -1061,12 +1078,20 @@ } string_index++; } + if( string_index >= utf8_string_size ) + { + break; + } /* Look for the end of the XML tag: '>' */ if( utf8_string[ string_index++ ] != 0x3e ) { continue; } + if( string_index >= utf8_string_size ) + { + break; + } if( ( xml_tag_name == NULL ) || ( xml_tag_name_length == 0 ) ) { diff -Nru libbde-20190102/libfvalue/libfvalue_table.h libbde-20240223/libfvalue/libfvalue_table.h --- libbde-20190102/libfvalue/libfvalue_table.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_table.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Values table functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_TABLE_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_types.h libbde-20240223/libfvalue/libfvalue_types.h --- libbde-20190102/libfvalue/libfvalue_types.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_types.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_unused.h libbde-20240223/libfvalue/libfvalue_unused.h --- libbde-20190102/libfvalue/libfvalue_unused.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_unused.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBFVALUE_INTERNAL_UNUSED_H ) -#define _LIBFVALUE_INTERNAL_UNUSED_H +#if !defined( _LIBFVALUE_UNUSED_H ) +#define _LIBFVALUE_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBFVALUE_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBFVALUE_UNUSED_H ) */ diff -Nru libbde-20190102/libfvalue/libfvalue_utf16_string.c libbde-20240223/libfvalue/libfvalue_utf16_string.c --- libbde-20190102/libfvalue/libfvalue_utf16_string.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_utf16_string.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-16 string value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -36,14 +36,14 @@ libfvalue_split_utf16_string_t **split_string, libcerror_error_t **error ) { - uint16_t *segment_start = NULL; - uint16_t *segment_end = NULL; - uint16_t *string_end = NULL; - static char *function = "libfvalue_utf16_string_split"; - size_t string_size = 0; - ssize_t segment_length = 0; - int number_of_segments = 0; - int segment_index = 0; + uint16_t *segment_end = NULL; + uint16_t *segment_start = NULL; + const uint16_t *string_end = NULL; + static char *function = "libfvalue_utf16_string_split"; + size_t string_size = 0; + ssize_t segment_length = 0; + int number_of_segments = 0; + int segment_index = 0; if( utf16_string == NULL ) { @@ -96,10 +96,14 @@ { return( 1 ); } + if( utf16_string[ utf16_string_size - 1 ] == 0 ) + { + utf16_string_size--; + } /* Determine the number of segments */ segment_start = (uint16_t *) utf16_string; - string_end = (uint16_t *) &( utf16_string[ utf16_string_size - 1 ] ); + string_end = utf16_string + utf16_string_size; do { @@ -146,7 +150,7 @@ if( libfvalue_split_utf16_string_initialize( split_string, utf16_string, - utf16_string_size, + utf16_string_size + 1, number_of_segments, error ) != 1 ) { @@ -154,7 +158,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize split string.", + "%s: unable to initialize split string.", function ); goto on_error; @@ -216,7 +220,7 @@ goto on_error; } - string_end = &( segment_start[ string_size - 1 ] ); + string_end = segment_start + utf16_string_size; for( segment_index = 0; segment_index < number_of_segments; diff -Nru libbde-20190102/libfvalue/libfvalue_utf16_string.h libbde-20240223/libfvalue/libfvalue_utf16_string.h --- libbde-20190102/libfvalue/libfvalue_utf16_string.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_utf16_string.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-16 string value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBVALUE_UTF16_STRING_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_utf8_string.c libbde-20240223/libfvalue/libfvalue_utf8_string.c --- libbde-20190102/libfvalue/libfvalue_utf8_string.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_utf8_string.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-8 string value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -36,14 +36,14 @@ libfvalue_split_utf8_string_t **split_string, libcerror_error_t **error ) { - uint8_t *segment_start = NULL; - uint8_t *segment_end = NULL; - uint8_t *string_end = NULL; - static char *function = "libfvalue_utf8_string_split"; - size_t string_size = 0; - ssize_t segment_length = 0; - int number_of_segments = 0; - int segment_index = 0; + uint8_t *segment_end = NULL; + uint8_t *segment_start = NULL; + const uint8_t *string_end = NULL; + static char *function = "libfvalue_utf8_string_split"; + size_t string_size = 0; + ssize_t segment_length = 0; + int number_of_segments = 0; + int segment_index = 0; if( utf8_string == NULL ) { @@ -96,10 +96,14 @@ { return( 1 ); } + if( utf8_string[ utf8_string_size - 1 ] == 0 ) + { + utf8_string_size--; + } /* Determine the number of segments */ segment_start = (uint8_t *) utf8_string; - string_end = (uint8_t *) &( utf8_string[ utf8_string_size - 1 ] ); + string_end = utf8_string + utf8_string_size; do { @@ -146,7 +150,7 @@ if( libfvalue_split_utf8_string_initialize( split_string, utf8_string, - utf8_string_size, + utf8_string_size + 1, number_of_segments, error ) != 1 ) { @@ -154,7 +158,7 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to intialize split string.", + "%s: unable to initialize split string.", function ); goto on_error; @@ -216,7 +220,7 @@ goto on_error; } - string_end = &( segment_start[ string_size - 1 ] ); + string_end = segment_start + utf8_string_size; for( segment_index = 0; segment_index < number_of_segments; diff -Nru libbde-20190102/libfvalue/libfvalue_utf8_string.h libbde-20240223/libfvalue/libfvalue_utf8_string.h --- libbde-20190102/libfvalue/libfvalue_utf8_string.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_utf8_string.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-8 string value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBVALUE_UTF8_STRING_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_value.c libbde-20240223/libfvalue/libfvalue_value.c --- libbde-20190102/libfvalue/libfvalue_value.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_value.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -1823,6 +1823,28 @@ } internal_value = (libfvalue_internal_value_t *) value; + if( entry_data_offset == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid entry data offset.", + function ); + + return( -1 ); + } + if( entry_data_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid entry data size.", + function ); + + return( -1 ); + } result = libfvalue_value_has_data( value, error ); @@ -2162,6 +2184,39 @@ } internal_value = (libfvalue_internal_value_t *) value; + if( entry_data == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid entry data.", + function ); + + return( -1 ); + } + if( entry_data_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid entry data size.", + function ); + + return( -1 ); + } + if( encoding == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid encoding.", + function ); + + return( -1 ); + } result = libfvalue_value_has_data( value, error ); diff -Nru libbde-20190102/libfvalue/libfvalue_value.h libbde-20240223/libfvalue/libfvalue_value.h --- libbde-20190102/libfvalue/libfvalue_value.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_value.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_VALUE_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_value_entry.c libbde-20240223/libfvalue/libfvalue_value_entry.c --- libbde-20190102/libfvalue/libfvalue_value_entry.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_value_entry.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Value entry functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libfvalue/libfvalue_value_entry.h libbde-20240223/libfvalue/libfvalue_value_entry.h --- libbde-20190102/libfvalue/libfvalue_value_entry.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_value_entry.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Value entry functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_VALUE_ENTRY_H ) diff -Nru libbde-20190102/libfvalue/libfvalue_value_type.c libbde-20240223/libfvalue/libfvalue_value_type.c --- libbde-20190102/libfvalue/libfvalue_value_type.c 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_value_type.c 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Value functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -36,15 +36,15 @@ #include "libfvalue_value.h" #include "libfvalue_value_type.h" -#if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) +#if defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) #include "libfvalue_libfdatetime.h" #endif -#if defined( HAVE_LIBFGUID_H ) || defined( HAVE_LOCAL_LIBFGUID ) +#if defined( HAVE_LIBFGUID ) || defined( HAVE_LOCAL_LIBFGUID ) #include "libfvalue_libfguid.h" #endif -#if defined( HAVE_LIBFWNT_H ) || defined( HAVE_LOCAL_LIBFWNT ) +#if defined( HAVE_LIBFWNT ) || defined( HAVE_LOCAL_LIBFWNT ) #include "libfvalue_libfwnt.h" #endif @@ -383,7 +383,7 @@ error ); break; -#if defined( HAVE_LIBFDATETIME_H ) || defined( HAVE_LOCAL_LIBFDATETIME ) +#if defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) case LIBFVALUE_VALUE_TYPE_FAT_DATE_TIME: result = libfvalue_value_initialize( value, @@ -544,7 +544,7 @@ (int (*)(intptr_t **, libcerror_error_t **)) &libfdatetime_posix_time_free, NULL, - (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfdatetime_posix_time_copy_from_byte_stream, + (int (*)(intptr_t *, const uint8_t *, size_t, int, libcerror_error_t **)) &libfvalue_value_type_posix_time_copy_from_byte_stream, NULL, NULL, @@ -605,8 +605,9 @@ flags, error ); break; -#endif -#if defined( HAVE_LIBFGUID_H ) || defined( HAVE_LOCAL_LIBFGUID ) +#endif /* defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ + +#if defined( HAVE_LIBFGUID ) || defined( HAVE_LOCAL_LIBFGUID ) case LIBFVALUE_VALUE_TYPE_GUID: result = libfvalue_value_initialize( value, @@ -643,8 +644,9 @@ flags, error ); break; -#endif -#if defined( HAVE_LIBFWNT_H ) || defined( HAVE_LOCAL_LIBFWNT ) +#endif /* defined( HAVE_LIBFGUID ) || defined( HAVE_LOCAL_LIBFGUID ) */ + +#if defined( HAVE_LIBFWNT ) || defined( HAVE_LOCAL_LIBFWNT ) case LIBFVALUE_VALUE_TYPE_NT_SECURITY_IDENTIFIER: result = libfvalue_value_initialize( value, @@ -681,7 +683,8 @@ flags, error ); break; -#endif +#endif /* defined( HAVE_LIBFWNT ) || defined( HAVE_LOCAL_LIBFWNT ) */ + default: libcerror_error_set( error, @@ -853,7 +856,7 @@ data_index, 0 ); } -#endif +#endif /* defined( HAVE_DEBUG_OUTPUT ) */ } return( (ssize_t) data_index ); } @@ -1033,6 +1036,10 @@ return( -1 ); } + if( data_index == 0 ) + { + break; + } #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { @@ -1074,3 +1081,103 @@ return( last_data_index ); } +#if defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) + +/* Helper function for libfvalue value type to covert a byte stream into a POSIX time using libfdatetime + * Returns 1 if successful or -1 on error + */ +int libfvalue_value_type_posix_time_copy_from_byte_stream( + libfdatetime_posix_time_t *posix_time, + const uint8_t *byte_stream, + size_t byte_stream_size, + int encoding, + libcerror_error_t **error ) +{ + static char *function = "libfvalue_value_type_posix_time_copy_from_byte_stream"; + int byte_order = 0; + uint8_t value_type = 0; + + byte_order = encoding & 0xff; + + if( ( byte_order != LIBFVALUE_ENDIAN_BIG ) + && ( byte_order != LIBFVALUE_ENDIAN_LITTLE ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported byte order: 0x%02x in encoding: 0x%08x.", + function, + byte_order, + encoding ); + + return( -1 ); + } + switch( encoding & 0xffffff00UL ) + { + case LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_32BIT_SIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_SECONDS_32BIT_SIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_32BIT_UNSIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_SECONDS_32BIT_UNSIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_64BIT_SIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_SECONDS_64BIT_SIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_SECONDS_64BIT_UNSIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_SECONDS_64BIT_UNSIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_MICRO_SECONDS_64BIT_SIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_MICRO_SECONDS_64BIT_SIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_MICRO_SECONDS_64BIT_UNSIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_MICRO_SECONDS_64BIT_UNSIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_NANO_SECONDS_64BIT_SIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_NANO_SECONDS_64BIT_SIGNED; + break; + + case LIBFVALUE_POSIX_TIME_ENCODING_NANO_SECONDS_64BIT_UNSIGNED: + value_type = LIBFDATETIME_POSIX_TIME_VALUE_TYPE_NANO_SECONDS_64BIT_UNSIGNED; + break; + + default: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported value type: 0x%08x in encoding: 0x%08x.", + function, + encoding & 0xffffff00UL, + encoding ); + + return( -1 ); + } + if( libfdatetime_posix_time_copy_from_byte_stream( + posix_time, + byte_stream, + byte_stream_size, + byte_order, + value_type, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to copy POSIX time from byte stream.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ + diff -Nru libbde-20190102/libfvalue/libfvalue_value_type.h libbde-20240223/libfvalue/libfvalue_value_type.h --- libbde-20190102/libfvalue/libfvalue_value_type.h 2019-01-02 15:57:29.000000000 +0000 +++ libbde-20240223/libfvalue/libfvalue_value_type.h 2024-02-23 03:03:37.000000000 +0000 @@ -1,22 +1,22 @@ /* * Value type functions * - * Copyright (C) 2010-2018, Joachim Metz + * Copyright (C) 2010-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBFVALUE_INTERNAL_VALUE_TYPE_H ) @@ -29,6 +29,7 @@ #include "libfvalue_extern.h" #include "libfvalue_libcerror.h" +#include "libfvalue_libfdatetime.h" #include "libfvalue_types.h" #if defined( __cplusplus ) @@ -80,6 +81,17 @@ int encoding, libcerror_error_t **error ); +#if defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) + +int libfvalue_value_type_posix_time_copy_from_byte_stream( + libfdatetime_posix_time_t *posix_time, + const uint8_t *byte_stream, + size_t byte_stream_size, + int encoding, + libcerror_error_t **error ); + +#endif /* defined( HAVE_LIBFDATETIME ) || defined( HAVE_LOCAL_LIBFDATETIME ) */ + #if defined( __cplusplus ) } #endif diff -Nru libbde-20190102/libhmac/Makefile.am libbde-20240223/libhmac/Makefile.am --- libbde-20190102/libhmac/Makefile.am 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/Makefile.am 2024-02-23 03:03:39.000000000 +0000 @@ -2,7 +2,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ + @LIBCERROR_CPPFLAGS@ \ + @LIBCRYPTO_CPPFLAGS@ \ + @PTHREAD_CPPFLAGS@ noinst_LTLIBRARIES = libhmac.la @@ -13,10 +15,15 @@ libhmac_error.c libhmac_error.h \ libhmac_libcerror.h \ libhmac_md5.c libhmac_md5.h \ + libhmac_md5_context.c libhmac_md5_context.h \ libhmac_sha1.c libhmac_sha1.h \ + libhmac_sha1_context.c libhmac_sha1_context.h \ libhmac_sha224.c libhmac_sha224.h \ + libhmac_sha224_context.c libhmac_sha224_context.h \ libhmac_sha256.c libhmac_sha256.h \ + libhmac_sha256_context.c libhmac_sha256_context.h \ libhmac_sha512.c libhmac_sha512.h \ + libhmac_sha512_context.c libhmac_sha512_context.h \ libhmac_support.c libhmac_support.h \ libhmac_types.h \ libhmac_unused.h @@ -26,9 +33,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libhmac ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libhmac_la_SOURCES) diff -Nru libbde-20190102/libhmac/Makefile.in libbde-20240223/libhmac/Makefile.in --- libbde-20190102/libhmac/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libhmac/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libhmac ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -123,14 +123,26 @@ am__libhmac_la_SOURCES_DIST = libhmac_byte_stream.h \ libhmac_definitions.h libhmac_extern.h libhmac_error.c \ libhmac_error.h libhmac_libcerror.h libhmac_md5.c \ - libhmac_md5.h libhmac_sha1.c libhmac_sha1.h libhmac_sha224.c \ - libhmac_sha224.h libhmac_sha256.c libhmac_sha256.h \ - libhmac_sha512.c libhmac_sha512.h libhmac_support.c \ - libhmac_support.h libhmac_types.h libhmac_unused.h + libhmac_md5.h libhmac_md5_context.c libhmac_md5_context.h \ + libhmac_sha1.c libhmac_sha1.h libhmac_sha1_context.c \ + libhmac_sha1_context.h libhmac_sha224.c libhmac_sha224.h \ + libhmac_sha224_context.c libhmac_sha224_context.h \ + libhmac_sha256.c libhmac_sha256.h libhmac_sha256_context.c \ + libhmac_sha256_context.h libhmac_sha512.c libhmac_sha512.h \ + libhmac_sha512_context.c libhmac_sha512_context.h \ + libhmac_support.c libhmac_support.h libhmac_types.h \ + libhmac_unused.h @HAVE_LOCAL_LIBHMAC_TRUE@am_libhmac_la_OBJECTS = libhmac_error.lo \ -@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_md5.lo libhmac_sha1.lo \ -@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224.lo libhmac_sha256.lo \ -@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512.lo libhmac_support.lo +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_md5.lo libhmac_md5_context.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha1.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha1_context.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224_context.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha256.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha256_context.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512_context.lo \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_support.lo libhmac_la_OBJECTS = $(am_libhmac_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -153,9 +165,17 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libhmac_error.Plo \ - ./$(DEPDIR)/libhmac_md5.Plo ./$(DEPDIR)/libhmac_sha1.Plo \ - ./$(DEPDIR)/libhmac_sha224.Plo ./$(DEPDIR)/libhmac_sha256.Plo \ - ./$(DEPDIR)/libhmac_sha512.Plo ./$(DEPDIR)/libhmac_support.Plo + ./$(DEPDIR)/libhmac_md5.Plo \ + ./$(DEPDIR)/libhmac_md5_context.Plo \ + ./$(DEPDIR)/libhmac_sha1.Plo \ + ./$(DEPDIR)/libhmac_sha1_context.Plo \ + ./$(DEPDIR)/libhmac_sha224.Plo \ + ./$(DEPDIR)/libhmac_sha224_context.Plo \ + ./$(DEPDIR)/libhmac_sha256.Plo \ + ./$(DEPDIR)/libhmac_sha256_context.Plo \ + ./$(DEPDIR)/libhmac_sha512.Plo \ + ./$(DEPDIR)/libhmac_sha512_context.Plo \ + ./$(DEPDIR)/libhmac_support.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -182,6 +202,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -199,8 +220,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -217,6 +236,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -228,8 +253,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -247,7 +274,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -265,7 +291,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -319,8 +344,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -339,6 +362,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -349,8 +373,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -373,26 +397,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -401,7 +405,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -420,6 +423,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -462,9 +466,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -533,8 +534,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -557,11 +556,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -573,7 +569,9 @@ @HAVE_LOCAL_LIBHMAC_TRUE@AM_CPPFLAGS = \ @HAVE_LOCAL_LIBHMAC_TRUE@ -I$(top_srcdir)/include \ @HAVE_LOCAL_LIBHMAC_TRUE@ -I$(top_srcdir)/common \ -@HAVE_LOCAL_LIBHMAC_TRUE@ @LIBCERROR_CPPFLAGS@ +@HAVE_LOCAL_LIBHMAC_TRUE@ @LIBCERROR_CPPFLAGS@ \ +@HAVE_LOCAL_LIBHMAC_TRUE@ @LIBCRYPTO_CPPFLAGS@ \ +@HAVE_LOCAL_LIBHMAC_TRUE@ @PTHREAD_CPPFLAGS@ @HAVE_LOCAL_LIBHMAC_TRUE@noinst_LTLIBRARIES = libhmac.la @HAVE_LOCAL_LIBHMAC_TRUE@libhmac_la_SOURCES = \ @@ -583,10 +581,15 @@ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_error.c libhmac_error.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_libcerror.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_md5.c libhmac_md5.h \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_md5_context.c libhmac_md5_context.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha1.c libhmac_sha1.h \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha1_context.c libhmac_sha1_context.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224.c libhmac_sha224.h \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha224_context.c libhmac_sha224_context.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha256.c libhmac_sha256.h \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha256_context.c libhmac_sha256_context.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512.c libhmac_sha512.h \ +@HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_sha512_context.c libhmac_sha512_context.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_support.c libhmac_support.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_types.h \ @HAVE_LOCAL_LIBHMAC_TRUE@ libhmac_unused.h @@ -650,10 +653,15 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_md5.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_md5_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha1_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha224.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha224_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha256.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha256_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha512.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_sha512_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhmac_support.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @@ -688,6 +696,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -740,7 +750,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -860,10 +869,15 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libhmac_error.Plo -rm -f ./$(DEPDIR)/libhmac_md5.Plo + -rm -f ./$(DEPDIR)/libhmac_md5_context.Plo -rm -f ./$(DEPDIR)/libhmac_sha1.Plo + -rm -f ./$(DEPDIR)/libhmac_sha1_context.Plo -rm -f ./$(DEPDIR)/libhmac_sha224.Plo + -rm -f ./$(DEPDIR)/libhmac_sha224_context.Plo -rm -f ./$(DEPDIR)/libhmac_sha256.Plo + -rm -f ./$(DEPDIR)/libhmac_sha256_context.Plo -rm -f ./$(DEPDIR)/libhmac_sha512.Plo + -rm -f ./$(DEPDIR)/libhmac_sha512_context.Plo -rm -f ./$(DEPDIR)/libhmac_support.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -881,6 +895,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -897,15 +919,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libhmac ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libhmac_la_SOURCES) diff -Nru libbde-20190102/libhmac/libhmac_byte_stream.h libbde-20240223/libhmac/libhmac_byte_stream.h --- libbde-20190102/libhmac/libhmac_byte_stream.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_byte_stream.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * Byte stream functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_BYTE_STREAM_H ) diff -Nru libbde-20190102/libhmac/libhmac_definitions.h libbde-20240223/libhmac/libhmac_definitions.h --- libbde-20190102/libhmac/libhmac_definitions.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_definitions.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( LIBHMAC_INTERNAL_DEFINITIONS_H ) @@ -34,11 +34,11 @@ * for local use of libhmac */ #else -#define LIBHMAC_VERSION 20180731 +#define LIBHMAC_VERSION 20240129 /* The libhmac version string */ -#define LIBHMAC_VERSION_STRING "20180731" +#define LIBHMAC_VERSION_STRING "20240129" /* The digest hash sizes */ @@ -48,15 +48,7 @@ #define LIBHMAC_SHA256_HASH_SIZE 32 #define LIBHMAC_SHA512_HASH_SIZE 64 -#endif - -#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) - -#if !defined( PROV_RSA_AES ) -#define PROV_RSA_AES 24 -#endif - -#endif /* defined( WINAPI ) && defined( HAVE_WINCRYPT ) */ +#endif /* !defined( HAVE_LOCAL_LIBHMAC ) */ #define LIBHMAC_UNFOLLED_LOOPS diff -Nru libbde-20190102/libhmac/libhmac_error.c libbde-20240223/libhmac/libhmac_error.c --- libbde-20190102/libhmac/libhmac_error.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_error.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libhmac/libhmac_error.h libbde-20240223/libhmac/libhmac_error.h --- libbde-20190102/libhmac/libhmac_error.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_error.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libhmac/libhmac_extern.h libbde-20240223/libhmac/libhmac_extern.h --- libbde-20190102/libhmac/libhmac_extern.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_extern.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBHMAC_EXTERN_VARIABLE extern +#else #define LIBHMAC_EXTERN_VARIABLE LIBHMAC_EXTERN +#endif #else #define LIBHMAC_EXTERN /* extern */ diff -Nru libbde-20190102/libhmac/libhmac_libcerror.h libbde-20240223/libhmac/libhmac_libcerror.h --- libbde-20190102/libhmac/libhmac_libcerror.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_libcerror.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_LIBCERROR_H ) diff -Nru libbde-20190102/libhmac/libhmac_md5.c libbde-20240223/libhmac/libhmac_md5.c --- libbde-20190102/libhmac/libhmac_md5.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_md5.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,424 +1,32 @@ /* * MD5 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include -#include #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include -#include - -#endif - -#include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_md5.h" - -#if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) - -/* RFC 1321 based MD5 functions - */ - -/* TODO decription what these values are based on - */ -uint32_t libhmac_md5_fixed_constants[ 4 ] = { - 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL -}; - -/* The first 32-bits of the sines (in radians) of the first 64 integers [ 0, 63 ] - */ -uint32_t libhmac_md5_sines[ 64 ] = { - 0xd76aa478UL, 0xe8c7b756UL, 0x242070dbUL, 0xc1bdceeeUL, - 0xf57c0fafUL, 0x4787c62aUL, 0xa8304613UL, 0xfd469501UL, - 0x698098d8UL, 0x8b44f7afUL, 0xffff5bb1UL, 0x895cd7beUL, - 0x6b901122UL, 0xfd987193UL, 0xa679438eUL, 0x49b40821UL, - 0xf61e2562UL, 0xc040b340UL, 0x265e5a51UL, 0xe9b6c7aaUL, - 0xd62f105dUL, 0x02441453UL, 0xd8a1e681UL, 0xe7d3fbc8UL, - 0x21e1cde6UL, 0xc33707d6UL, 0xf4d50d87UL, 0x455a14edUL, - 0xa9e3e905UL, 0xfcefa3f8UL, 0x676f02d9UL, 0x8d2a4c8aUL, - 0xfffa3942UL, 0x8771f681UL, 0x6d9d6122UL, 0xfde5380cUL, - 0xa4beea44UL, 0x4bdecfa9UL, 0xf6bb4b60UL, 0xbebfbc70UL, - 0x289b7ec6UL, 0xeaa127faUL, 0xd4ef3085UL, 0x04881d05UL, - 0xd9d4d039UL, 0xe6db99e5UL, 0x1fa27cf8UL, 0xc4ac5665UL, - 0xf4292244UL, 0x432aff97UL, 0xab9423a7UL, 0xfc93a039UL, - 0x655b59c3UL, 0x8f0ccc92UL, 0xffeff47dUL, 0x85845dd1UL, - 0x6fa87e4fUL, 0xfe2ce6e0UL, 0xa3014314UL, 0x4e0811a1UL, - 0xf7537e82UL, 0xbd3af235UL, 0x2ad7d2bbUL, 0xeb86d391UL -}; - -/* The bit shifts - */ -uint8_t libhmac_md5_bit_shifts[ 64 ] = { - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 -}; - -/* The 32-bit values indexes - * [ 0, 15 ] => index - * [ 16, 31 ] => ( ( 5 x index ) + 1 ) mod 16 - * [ 32, 47 ] => ( ( 3 x index ) + 5 ) mod 16 - * [ 48, 63 ] => ( 7 x index ) mod 16 - */ -uint8_t libhmac_md5_values_32bit_index[ 64 ] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, - 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, - 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 -}; - -#define libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ - hash_values[ hash_value_index0 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ - | ( ~( hash_values[ hash_value_index1 ] ) & hash_values[ hash_value_index3 ] ); \ - hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ - hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ -\ - hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - libhmac_md5_bit_shifts[ block_index ] ); \ -\ - hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; - -#define libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ - hash_values[ hash_value_index0 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index3 ] ) \ - | ( hash_values[ hash_value_index2 ] & ~( hash_values[ hash_value_index3 ] ) ); \ - hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ - hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ -\ - hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - libhmac_md5_bit_shifts[ block_index ] ); \ -\ - hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; - -#define libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ - hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ] \ - ^ hash_values[ hash_value_index2 ] \ - ^ hash_values[ hash_value_index3 ]; \ - hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ - hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ -\ - hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - libhmac_md5_bit_shifts[ block_index ] ); \ -\ - hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; - -#define libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ - hash_values[ hash_value_index0 ] += hash_values[ hash_value_index2 ] \ - ^ ( hash_values[ hash_value_index1 ] | ~( hash_values[ hash_value_index3 ] ) ); \ - hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ - hash_values[ hash_value_index0 ] += libhmac_md5_sines[ block_index ]; \ -\ - hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - libhmac_md5_bit_shifts[ block_index ] ); \ -\ - hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; - -#define libhmac_md5_transform_unfolded_calculate_hash_values( values_32bit, hash_values ) \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 0, hash_values, 0, 1, 2, 3, 0 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 1, hash_values, 3, 0, 1, 2, 1 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 2, hash_values, 2, 3, 0, 1, 2 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 3, hash_values, 1, 2, 3, 0, 3 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 4, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 5, hash_values, 3, 0, 1, 2, 5 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 6, hash_values, 2, 3, 0, 1, 6 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 7, hash_values, 1, 2, 3, 0, 7 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 8, hash_values, 0, 1, 2, 3, 8 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 9, hash_values, 3, 0, 1, 2, 9 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 10, hash_values, 2, 3, 0, 1, 10 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 11, hash_values, 1, 2, 3, 0, 11 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 12, hash_values, 0, 1, 2, 3, 12 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 13, hash_values, 3, 0, 1, 2, 13 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 14, hash_values, 2, 3, 0, 1, 14 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round1( values_32bit, 15, hash_values, 1, 2, 3, 0, 15 ); \ -\ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 1, hash_values, 0, 1, 2, 3, 16 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 6, hash_values, 3, 0, 1, 2, 17 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 11, hash_values, 2, 3, 0, 1, 18 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 0, hash_values, 1, 2, 3, 0, 19 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 5, hash_values, 0, 1, 2, 3, 20 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 10, hash_values, 3, 0, 1, 2, 21 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 15, hash_values, 2, 3, 0, 1, 22 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 4, hash_values, 1, 2, 3, 0, 23 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 9, hash_values, 0, 1, 2, 3, 24 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 14, hash_values, 3, 0, 1, 2, 25 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 3, hash_values, 2, 3, 0, 1, 26 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 8, hash_values, 1, 2, 3, 0, 27 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 13, hash_values, 0, 1, 2, 3, 28 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 2, hash_values, 3, 0, 1, 2, 29 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 7, hash_values, 2, 3, 0, 1, 30 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round2( values_32bit, 12, hash_values, 1, 2, 3, 0, 31 ); \ -\ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 5, hash_values, 0, 1, 2, 3, 32 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 8, hash_values, 3, 0, 1, 2, 33 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 11, hash_values, 2, 3, 0, 1, 34 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 14, hash_values, 1, 2, 3, 0, 35 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 1, hash_values, 0, 1, 2, 3, 36 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 4, hash_values, 3, 0, 1, 2, 37 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 7, hash_values, 2, 3, 0, 1, 38 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 10, hash_values, 1, 2, 3, 0, 39 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 13, hash_values, 0, 1, 2, 3, 40 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 0, hash_values, 3, 0, 1, 2, 41 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 3, hash_values, 2, 3, 0, 1, 42 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 6, hash_values, 1, 2, 3, 0, 43 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 9, hash_values, 0, 1, 2, 3, 44 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 12, hash_values, 3, 0, 1, 2, 45 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 15, hash_values, 2, 3, 0, 1, 46 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round3( values_32bit, 2, hash_values, 1, 2, 3, 0, 47 ); \ -\ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 0, hash_values, 0, 1, 2, 3, 48 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 7, hash_values, 3, 0, 1, 2, 49 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 14, hash_values, 2, 3, 0, 1, 50 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 5, hash_values, 1, 2, 3, 0, 51 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 12, hash_values, 0, 1, 2, 3, 52 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 3, hash_values, 3, 0, 1, 2, 53 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 10, hash_values, 2, 3, 0, 1, 54 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 1, hash_values, 1, 2, 3, 0, 55 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 8, hash_values, 0, 1, 2, 3, 56 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 15, hash_values, 3, 0, 1, 2, 57 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 6, hash_values, 2, 3, 0, 1, 58 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 13, hash_values, 1, 2, 3, 0, 59 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 4, hash_values, 0, 1, 2, 3, 60 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 11, hash_values, 3, 0, 1, 2, 61 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 2, hash_values, 2, 3, 0, 1, 62 ); \ - libhmac_md5_transform_unfolded_calculate_hash_value_round4( values_32bit, 9, hash_values, 1, 2, 3, 0, 63 ); - -/* Calculates the MD5 of 64 byte sized blocks of data in a buffer - * Returns the number of bytes used if successful or -1 on error - */ -ssize_t libhmac_md5_transform( - libhmac_internal_md5_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - uint32_t hash_values[ 4 ]; - uint32_t values_32bit[ 16 ]; - - static char *function = "libhmac_md5_transform"; - size_t buffer_offset = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - uint32_t hash_value = 0; - uint8_t block_index = 0; - uint8_t hash_values_index = 0; - uint8_t value_32bit_index = 0; -#endif - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid internal context.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - while( size >= LIBHMAC_MD5_BLOCK_SIZE ) - { - if( memory_copy( - hash_values, - internal_context->hash_values, - sizeof( uint32_t ) * 4 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy hash values.", - function ); - - goto on_error; - } -#if defined( LIBHMAC_UNFOLLED_LOOPS ) - /* Break the block into 16 x 32-bit values - */ - libhmac_byte_stream_copy_to_16x_uint32_little_endian( - &( buffer[ buffer_offset ] ), - values_32bit ); - - buffer_offset += LIBHMAC_MD5_BLOCK_SIZE; - - /* Calculate the hash values for the 32-bit values - */ - libhmac_md5_transform_unfolded_calculate_hash_values( - values_32bit, - hash_values ); - - /* Update the hash values in the context - */ - internal_context->hash_values[ 0 ] += hash_values[ 0 ]; - internal_context->hash_values[ 1 ] += hash_values[ 1 ]; - internal_context->hash_values[ 2 ] += hash_values[ 2 ]; - internal_context->hash_values[ 3 ] += hash_values[ 3 ]; - -#else - /* Break the block into 16 x 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 16; - value_32bit_index++ ) - { - byte_stream_copy_to_uint32_little_endian( - &( buffer[ buffer_offset ] ), - values_32bit[ value_32bit_index ] ); - - buffer_offset += sizeof( uint32_t ); - } - /* Calculate the hash values for the 32-bit values - */ - for( block_index = 0; - block_index < 64; - block_index++ ) - { - if( block_index < 16 ) - { - hash_values[ 0 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) - | ( ~( hash_values[ 1 ] ) & hash_values[ 3 ] ); - } - else if( block_index < 32 ) - { - hash_values[ 0 ] += ( hash_values[ 1 ] & hash_values[ 3 ] ) - | ( hash_values[ 2 ] & ~( hash_values[ 3 ] ) ); - } - else if( block_index < 48 ) - { - hash_values[ 0 ] += hash_values[ 1 ] - ^ hash_values[ 2 ] - ^ hash_values[ 3 ]; - } - else - { - hash_values[ 0 ] += hash_values[ 2 ] - ^ ( hash_values[ 1 ] | ~( hash_values[ 3 ] ) ); - } - value_32bit_index = libhmac_md5_values_32bit_index[ block_index ]; - - hash_values[ 0 ] += values_32bit[ value_32bit_index ]; - hash_values[ 0 ] += libhmac_md5_sines[ block_index ]; - hash_values[ 0 ] = byte_stream_bit_rotate_left_32bit( - hash_values[ 0 ], - libhmac_md5_bit_shifts[ block_index ] ); - - hash_value = hash_values[ 3 ]; - hash_values[ 3 ] = hash_values[ 2 ]; - hash_values[ 2 ] = hash_values[ 1 ]; - hash_values[ 1 ] += hash_values[ 0 ]; - hash_values[ 0 ] = hash_value; - } - /* Update the hash values in the context - */ - for( hash_values_index = 0; - hash_values_index < 4; - hash_values_index++ ) - { - internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; - } -#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - size -= LIBHMAC_MD5_BLOCK_SIZE; - } - /* Prevent sensitive data from leaking - */ - if( memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 4 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear hash values.", - function ); - - goto on_error; - } - if( memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 16 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear 32-bit values.", - function ); - - goto on_error; - } - return( (ssize_t) buffer_offset ); - -on_error: - memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 16 ); - - memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 4 ); - - return( -1 ); -} - -#endif /* !defined( LIBHMAC_HAVE_MD5_SUPPORT ) */ +#include "libhmac_md5_context.h" /* Creates a MD5 context * Make sure the value context is referencing, is set to NULL @@ -428,124 +36,11 @@ libhmac_md5_context_t **context, libcerror_error_t **error ) { - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_initialize"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid context value already set.", - function ); - - return( -1 ); - } - internal_context = memory_allocate_structure( - libhmac_internal_md5_context_t ); - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create context.", - function ); - - goto on_error; - } - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_md5_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - memory_free( - internal_context ); + static char *function = "libhmac_md5_initialize"; - return( -1 ); - } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) - /* Request the AES crypt provider, fail back to the RSA crypt provider - */ - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_AES, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create AES or RSA crypt provider.", - function ); - - goto on_error; - } - } - if( internal_context->crypt_provider == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: unable to create crypt provider.", - function ); - - goto on_error; - } - if( CryptCreateHash( - internal_context->crypt_provider, - CALG_MD5, - 0, - 0, - &( internal_context->hash ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create hash object.", - function ); - - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) - if( MD5_Init( - &( internal_context->md5_context ) ) != 1 ) + if( libhmac_md5_context_initialize( + context, + error ) != 1 ) { libcerror_error_set( error, @@ -554,84 +49,9 @@ "%s: unable to initialize context.", function ); - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX_init( - &( internal_context->internal_evp_md_context ) ); - - internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); -#else - internal_context->evp_md_context = EVP_MD_CTX_new(); - - if( internal_context->evp_md_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP message digest context.", - function ); - - goto on_error; - } -#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ - - if( EVP_DigestInit_ex( - internal_context->evp_md_context, - EVP_md5(), - NULL ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize EVP message digest context.", - function ); - -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); -#endif - internal_context->evp_md_context = NULL; - - goto on_error; - } -#else - if( memory_copy( - internal_context->hash_values, - libhmac_md5_fixed_constants, - sizeof( uint32_t ) * 4 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy fixed constants to hash values.", - function ); - - goto on_error; + return( -1 ); } -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ - - *context = (libhmac_md5_context_t *) internal_context; - return( 1 ); - -on_error: - if( internal_context != NULL ) - { - memory_free( - internal_context ); - } - return( -1 ); } /* Frees a MD5 context @@ -641,230 +61,17 @@ libhmac_md5_context_t **context, libcerror_error_t **error ) { - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_free"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - internal_context = (libhmac_internal_md5_context_t *) *context; - *context = NULL; - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) - if( internal_context->crypt_provider != 0 ) - { - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - } - if( internal_context->hash != 0 ) - { - CryptDestroyHash( - internal_context->hash ); - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) - /* No additional clean up necessary - */ - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - if( EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP message digest context.", - function ); - } - /* Make sure the error state is removed otherwise OpenSSL will leak memory - */ - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); - -#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ - - internal_context->evp_md_context = NULL; -#else - /* No additional clean up necessary - */ -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ - - memory_free( - internal_context ); - } - return( 1 ); -} - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) - -/* Updates the MD5 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_md5_update( - libhmac_md5_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_update"; + static char *function = "libhmac_md5_free"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( size == 0 ) - { - return( 1 ); - } - if( CryptHashData( - internal_context->hash, - (BYTE *) buffer, - (DWORD) size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) - -/* Updates the MD5 context using OpenSSL - * Returns 1 if successful or -1 on error - */ -int libhmac_md5_update( - libhmac_md5_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_update"; - unsigned long safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) - if( size > (size_t) ULONG_MAX ) -#else - if( size > (size_t) SSIZE_MAX ) -#endif - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - safe_hash_size = (unsigned long) size; - - if( MD5_Update( - &( internal_context->md5_context ), - (const void *) buffer, - size ) != 1 ) + if( libhmac_md5_context_free( + context, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update context.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free context.", function ); return( -1 ); @@ -872,9 +79,7 @@ return( 1 ); } -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) - -/* Updates the MD5 context using OpenSSL EVP +/* Updates the MD5 context * Returns 1 if successful or -1 on error */ int libhmac_md5_update( @@ -883,52 +88,13 @@ size_t size, libcerror_error_t **error ) { - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; + static char *function = "libhmac_md5_update"; - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( EVP_DigestUpdate( - internal_context->evp_md_context, - (const void *) buffer, - size ) != 1 ) + if( libhmac_md5_context_update( + context, + buffer, + size, + error ) != 1 ) { libcerror_error_set( error, @@ -942,174 +108,7 @@ return( 1 ); } -#else - -/* Updates the MD5 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_md5_update( - libhmac_md5_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_update"; - size_t buffer_offset = 0; - size_t remaining_block_size = 0; - ssize_t process_count = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( internal_context->block_offset > 0 ) - { - remaining_block_size = LIBHMAC_MD5_BLOCK_SIZE - internal_context->block_offset; - - if( remaining_block_size > size ) - { - remaining_block_size = size; - } - if( memory_copy( - &( internal_context->block[ internal_context->block_offset ] ), - buffer, - remaining_block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset += remaining_block_size; - - if( internal_context->block_offset < LIBHMAC_MD5_BLOCK_SIZE ) - { - return( 1 ); - } - buffer_offset += remaining_block_size; - size -= remaining_block_size; - - process_count = libhmac_md5_transform( - internal_context, - internal_context->block, - LIBHMAC_MD5_BLOCK_SIZE, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - internal_context->block_offset = 0; - } - if( size > 0 ) - { - process_count = libhmac_md5_transform( - internal_context, - &( buffer[ buffer_offset ] ), - size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform buffer.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - - buffer_offset += process_count; - size -= process_count; - } - if( size > 0 ) - { - if( size >= LIBHMAC_MD5_BLOCK_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid size value out of bounds.", - function ); - - return( -1 ); - } - if( memory_copy( - internal_context->block, - &( buffer[ buffer_offset ] ), - size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy remaining data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset = size; - } - return( 1 ); -} - -#endif /* if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) - -/* Finalizes the MD5 context using the Windows Crypto API +/* Finalizes the MD5 context * Returns 1 if successful or -1 on error */ int libhmac_md5_finalize( @@ -1118,233 +117,13 @@ size_t hash_size, libcerror_error_t **error ) { - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_finalize"; - DWORD safe_hash_size = 0; + static char *function = "libhmac_md5_finalize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( hash_size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (DWORD) hash_size; - - if( CryptGetHashParam( - internal_context->hash, - HP_HASHVAL, - (BYTE *) hash, - &safe_hash_size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) - -/* Finalizes the MD5 context using OpenSSL - * Returns 1 if successful or -1 on error - */ -int libhmac_md5_finalize( - libhmac_md5_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_finalize"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - if( MD5_Final( + if( libhmac_md5_context_finalize( + context, hash, - &( internal_context->md5_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) - -/* Finalizes the MD5 context using OpenSSL EVP - * Returns 1 if successful or -1 on error - */ -int libhmac_md5_finalize( - libhmac_md5_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_finalize"; - unsigned int safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) UINT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (unsigned int) hash_size; - - if( EVP_DigestFinal_ex( - internal_context->evp_md_context, - (unsigned char *) hash, - &safe_hash_size ) != 1 ) + hash_size, + error ) != 1 ) { libcerror_error_set( error, @@ -1358,177 +137,6 @@ return( 1 ); } -#else - -/* Finalizes the MD5 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_md5_finalize( - libhmac_md5_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_md5_context_t *internal_context = NULL; - static char *function = "libhmac_md5_finalize"; - size_t block_size = 0; - size_t number_of_blocks = 0; - ssize_t process_count = 0; - uint64_t bit_size = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - size_t hash_index = 0; - int hash_values_index = 0; -#endif - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_md5_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - /* Add padding with a size of 56 mod 64 - */ - number_of_blocks = 1; - - if( internal_context->block_offset > 55 ) - { - number_of_blocks += 1; - } - block_size = number_of_blocks * LIBHMAC_MD5_BLOCK_SIZE; - - if( memory_set( - &( internal_context->block[ internal_context->block_offset ] ), - 0, - block_size - internal_context->block_offset ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context block.", - function ); - - return( -1 ); - } - /* The first byte of the padding contains 0x80 - */ - internal_context->block[ internal_context->block_offset ] = 0x80; - - bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; - - byte_stream_copy_from_uint64_little_endian( - &( internal_context->block[ block_size - 8 ] ), - bit_size ); - - process_count = libhmac_md5_transform( - internal_context, - internal_context->block, - block_size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - for( hash_values_index = 0; - hash_values_index < 4; - hash_values_index++ ) - { - byte_stream_copy_from_uint32_little_endian( - &( hash[ hash_index ] ), - internal_context->hash_values[ hash_values_index ] ); - - hash_index += sizeof( uint32_t ); - } -#else - byte_stream_copy_from_uint32_little_endian( - &( hash[ 0 ] ), - internal_context->hash_values[ 0 ] ); - - byte_stream_copy_from_uint32_little_endian( - &( hash[ 4 ] ), - internal_context->hash_values[ 1 ] ); - - byte_stream_copy_from_uint32_little_endian( - &( hash[ 8 ] ), - internal_context->hash_values[ 2 ] ); - - byte_stream_copy_from_uint32_little_endian( - &( hash[ 12 ] ), - internal_context->hash_values[ 3 ] ); - -#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - /* Prevent sensitive data from leaking - */ - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_md5_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#endif /* if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ - /* Calculates the MD5 of the buffer * Returns 1 if successful or -1 on error */ @@ -1542,7 +150,7 @@ libhmac_md5_context_t *context = NULL; static char *function = "libhmac_md5_calculate"; - if( libhmac_md5_initialize( + if( libhmac_md5_context_initialize( &context, error ) != 1 ) { @@ -1555,7 +163,7 @@ goto on_error; } - if( libhmac_md5_update( + if( libhmac_md5_context_update( context, buffer, size, @@ -1570,7 +178,7 @@ goto on_error; } - if( libhmac_md5_finalize( + if( libhmac_md5_context_finalize( context, hash, hash_size, @@ -1585,7 +193,7 @@ goto on_error; } - if( libhmac_md5_free( + if( libhmac_md5_context_free( &context, error ) != 1 ) { @@ -1603,7 +211,7 @@ on_error: if( context != NULL ) { - libhmac_md5_free( + libhmac_md5_context_free( &context, NULL ); } @@ -1713,7 +321,7 @@ } else { - if( libhmac_md5_initialize( + if( libhmac_md5_context_initialize( &context, error ) != 1 ) { @@ -1726,7 +334,7 @@ goto on_error; } - if( libhmac_md5_update( + if( libhmac_md5_context_update( context, key, key_size, @@ -1741,7 +349,7 @@ goto on_error; } - if( libhmac_md5_finalize( + if( libhmac_md5_context_finalize( context, key_hash, LIBHMAC_MD5_HASH_SIZE, @@ -1756,7 +364,7 @@ goto on_error; } - if( libhmac_md5_free( + if( libhmac_md5_context_free( &context, error ) != 1 ) { @@ -1864,7 +472,7 @@ inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } - if( libhmac_md5_initialize( + if( libhmac_md5_context_initialize( &context, error ) != 1 ) { @@ -1877,7 +485,7 @@ goto on_error; } - if( libhmac_md5_update( + if( libhmac_md5_context_update( context, inner_padding, block_size, @@ -1892,7 +500,7 @@ goto on_error; } - if( libhmac_md5_update( + if( libhmac_md5_context_update( context, buffer, size, @@ -1907,7 +515,7 @@ goto on_error; } - if( libhmac_md5_finalize( + if( libhmac_md5_context_finalize( context, hmac, hmac_size, @@ -1922,7 +530,7 @@ goto on_error; } - if( libhmac_md5_free( + if( libhmac_md5_context_free( &context, error ) != 1 ) { @@ -1935,7 +543,7 @@ goto on_error; } - if( libhmac_md5_initialize( + if( libhmac_md5_context_initialize( &context, error ) != 1 ) { @@ -1948,7 +556,7 @@ goto on_error; } - if( libhmac_md5_update( + if( libhmac_md5_context_update( context, outer_padding, block_size, @@ -1963,7 +571,7 @@ goto on_error; } - if( libhmac_md5_update( + if( libhmac_md5_context_update( context, hmac, LIBHMAC_MD5_HASH_SIZE, @@ -1978,7 +586,7 @@ goto on_error; } - if( libhmac_md5_finalize( + if( libhmac_md5_context_finalize( context, hmac, hmac_size, @@ -1993,7 +601,7 @@ goto on_error; } - if( libhmac_md5_free( + if( libhmac_md5_context_free( &context, error ) != 1 ) { @@ -2068,7 +676,7 @@ on_error: if( context != NULL ) { - libhmac_md5_free( + libhmac_md5_context_free( &context, NULL ); } diff -Nru libbde-20190102/libhmac/libhmac_md5.h libbde-20240223/libhmac/libhmac_md5.h --- libbde-20190102/libhmac/libhmac_md5.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_md5.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * MD5 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_MD5_H ) @@ -25,97 +25,15 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include - -#endif - #include "libhmac_extern.h" #include "libhmac_libcerror.h" +#include "libhmac_md5_context.h" #include "libhmac_types.h" #if defined( __cplusplus ) extern "C" { #endif -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) -#define LIBHMAC_HAVE_MD5_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) -#define LIBHMAC_HAVE_MD5_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) -#define LIBHMAC_HAVE_MD5_SUPPORT - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ - -#if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) -#define LIBHMAC_MD5_BLOCK_SIZE 64 -#endif - -typedef struct libhmac_internal_md5_context libhmac_internal_md5_context_t; - -struct libhmac_internal_md5_context -{ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) - /* The crypto provider handle - */ - HCRYPTPROV crypt_provider; - - /* The crypto hash handle - */ - HCRYPTHASH hash; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) - /* The MD5 context - */ - MD5_CTX md5_context; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) - /* The EVP message digest context - */ -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX internal_evp_md_context; -#endif - - EVP_MD_CTX *evp_md_context; - -#else - /* The number of bytes hashed - */ - uint64_t hash_count; - - /* The hash values - */ - uint32_t hash_values[ 4 ]; - - /* The block offset - */ - size_t block_offset; - - /* The (data) block - */ - uint8_t block[ 128 ]; - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) */ -}; - -#if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) - -ssize_t libhmac_md5_transform( - libhmac_internal_md5_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ); - -#endif /* !defined( LIBHMAC_HAVE_MD5_SUPPORT ) */ - LIBHMAC_EXTERN \ int libhmac_md5_initialize( libhmac_md5_context_t **context, diff -Nru libbde-20190102/libhmac/libhmac_md5_context.c libbde-20240223/libhmac/libhmac_md5_context.c --- libbde-20190102/libhmac/libhmac_md5_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_md5_context.c 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,1292 @@ +/* + * MD5 functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#include + +#endif + +#include "libhmac_byte_stream.h" +#include "libhmac_definitions.h" +#include "libhmac_libcerror.h" +#include "libhmac_md5_context.h" + +#if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) + +/* RFC 1321 based MD5 functions + */ + +/* TODO decription what these values are based on + */ +uint32_t libhmac_md5_context_fixed_constants[ 4 ] = { + 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL +}; + +/* The first 32-bits of the sines (in radians) of the first 64 integers [ 0, 63 ] + */ +uint32_t libhmac_md5_context_sines[ 64 ] = { + 0xd76aa478UL, 0xe8c7b756UL, 0x242070dbUL, 0xc1bdceeeUL, + 0xf57c0fafUL, 0x4787c62aUL, 0xa8304613UL, 0xfd469501UL, + 0x698098d8UL, 0x8b44f7afUL, 0xffff5bb1UL, 0x895cd7beUL, + 0x6b901122UL, 0xfd987193UL, 0xa679438eUL, 0x49b40821UL, + 0xf61e2562UL, 0xc040b340UL, 0x265e5a51UL, 0xe9b6c7aaUL, + 0xd62f105dUL, 0x02441453UL, 0xd8a1e681UL, 0xe7d3fbc8UL, + 0x21e1cde6UL, 0xc33707d6UL, 0xf4d50d87UL, 0x455a14edUL, + 0xa9e3e905UL, 0xfcefa3f8UL, 0x676f02d9UL, 0x8d2a4c8aUL, + 0xfffa3942UL, 0x8771f681UL, 0x6d9d6122UL, 0xfde5380cUL, + 0xa4beea44UL, 0x4bdecfa9UL, 0xf6bb4b60UL, 0xbebfbc70UL, + 0x289b7ec6UL, 0xeaa127faUL, 0xd4ef3085UL, 0x04881d05UL, + 0xd9d4d039UL, 0xe6db99e5UL, 0x1fa27cf8UL, 0xc4ac5665UL, + 0xf4292244UL, 0x432aff97UL, 0xab9423a7UL, 0xfc93a039UL, + 0x655b59c3UL, 0x8f0ccc92UL, 0xffeff47dUL, 0x85845dd1UL, + 0x6fa87e4fUL, 0xfe2ce6e0UL, 0xa3014314UL, 0x4e0811a1UL, + 0xf7537e82UL, 0xbd3af235UL, 0x2ad7d2bbUL, 0xeb86d391UL +}; + +/* The bit shifts + */ +uint8_t libhmac_md5_context_bit_shifts[ 64 ] = { + 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, + 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, + 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, + 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 +}; + +/* The 32-bit values indexes + * [ 0, 15 ] => index + * [ 16, 31 ] => ( ( 5 x index ) + 1 ) mod 16 + * [ 32, 47 ] => ( ( 3 x index ) + 5 ) mod 16 + * [ 48, 63 ] => ( 7 x index ) mod 16 + */ +uint8_t libhmac_md5_context_values_32bit_index[ 64 ] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, + 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, + 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 +}; + +#define libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ + hash_values[ hash_value_index0 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ + | ( ~( hash_values[ hash_value_index1 ] ) & hash_values[ hash_value_index3 ] ); \ + hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ + hash_values[ hash_value_index0 ] += libhmac_md5_context_sines[ block_index ]; \ +\ + hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + libhmac_md5_context_bit_shifts[ block_index ] ); \ +\ + hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; + +#define libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ + hash_values[ hash_value_index0 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index3 ] ) \ + | ( hash_values[ hash_value_index2 ] & ~( hash_values[ hash_value_index3 ] ) ); \ + hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ + hash_values[ hash_value_index0 ] += libhmac_md5_context_sines[ block_index ]; \ +\ + hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + libhmac_md5_context_bit_shifts[ block_index ] ); \ +\ + hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; + +#define libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ + hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ] \ + ^ hash_values[ hash_value_index2 ] \ + ^ hash_values[ hash_value_index3 ]; \ + hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ + hash_values[ hash_value_index0 ] += libhmac_md5_context_sines[ block_index ]; \ +\ + hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + libhmac_md5_context_bit_shifts[ block_index ] ); \ +\ + hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; + +#define libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, block_index ) \ + hash_values[ hash_value_index0 ] += hash_values[ hash_value_index2 ] \ + ^ ( hash_values[ hash_value_index1 ] | ~( hash_values[ hash_value_index3 ] ) ); \ + hash_values[ hash_value_index0 ] += values_32bit[ value_32bit_index ]; \ + hash_values[ hash_value_index0 ] += libhmac_md5_context_sines[ block_index ]; \ +\ + hash_values[ hash_value_index0 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + libhmac_md5_context_bit_shifts[ block_index ] ); \ +\ + hash_values[ hash_value_index0 ] += hash_values[ hash_value_index1 ]; + +#define libhmac_md5_context_transform_unfolded_calculate_hash_values( values_32bit, hash_values ) \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 0, hash_values, 0, 1, 2, 3, 0 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 1, hash_values, 3, 0, 1, 2, 1 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 2, hash_values, 2, 3, 0, 1, 2 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 3, hash_values, 1, 2, 3, 0, 3 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 4, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 5, hash_values, 3, 0, 1, 2, 5 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 6, hash_values, 2, 3, 0, 1, 6 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 7, hash_values, 1, 2, 3, 0, 7 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 8, hash_values, 0, 1, 2, 3, 8 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 9, hash_values, 3, 0, 1, 2, 9 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 10, hash_values, 2, 3, 0, 1, 10 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 11, hash_values, 1, 2, 3, 0, 11 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 12, hash_values, 0, 1, 2, 3, 12 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 13, hash_values, 3, 0, 1, 2, 13 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 14, hash_values, 2, 3, 0, 1, 14 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 15, hash_values, 1, 2, 3, 0, 15 ); \ +\ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 1, hash_values, 0, 1, 2, 3, 16 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 6, hash_values, 3, 0, 1, 2, 17 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 11, hash_values, 2, 3, 0, 1, 18 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 0, hash_values, 1, 2, 3, 0, 19 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 5, hash_values, 0, 1, 2, 3, 20 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 10, hash_values, 3, 0, 1, 2, 21 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 15, hash_values, 2, 3, 0, 1, 22 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 4, hash_values, 1, 2, 3, 0, 23 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 9, hash_values, 0, 1, 2, 3, 24 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 14, hash_values, 3, 0, 1, 2, 25 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 3, hash_values, 2, 3, 0, 1, 26 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 8, hash_values, 1, 2, 3, 0, 27 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 13, hash_values, 0, 1, 2, 3, 28 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 2, hash_values, 3, 0, 1, 2, 29 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 7, hash_values, 2, 3, 0, 1, 30 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 12, hash_values, 1, 2, 3, 0, 31 ); \ +\ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 5, hash_values, 0, 1, 2, 3, 32 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 8, hash_values, 3, 0, 1, 2, 33 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 11, hash_values, 2, 3, 0, 1, 34 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 14, hash_values, 1, 2, 3, 0, 35 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 1, hash_values, 0, 1, 2, 3, 36 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 4, hash_values, 3, 0, 1, 2, 37 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 7, hash_values, 2, 3, 0, 1, 38 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 10, hash_values, 1, 2, 3, 0, 39 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 13, hash_values, 0, 1, 2, 3, 40 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 0, hash_values, 3, 0, 1, 2, 41 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 3, hash_values, 2, 3, 0, 1, 42 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 6, hash_values, 1, 2, 3, 0, 43 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 9, hash_values, 0, 1, 2, 3, 44 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 12, hash_values, 3, 0, 1, 2, 45 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 15, hash_values, 2, 3, 0, 1, 46 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 2, hash_values, 1, 2, 3, 0, 47 ); \ +\ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 0, hash_values, 0, 1, 2, 3, 48 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 7, hash_values, 3, 0, 1, 2, 49 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 14, hash_values, 2, 3, 0, 1, 50 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 5, hash_values, 1, 2, 3, 0, 51 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 12, hash_values, 0, 1, 2, 3, 52 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 3, hash_values, 3, 0, 1, 2, 53 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 10, hash_values, 2, 3, 0, 1, 54 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 1, hash_values, 1, 2, 3, 0, 55 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 8, hash_values, 0, 1, 2, 3, 56 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 15, hash_values, 3, 0, 1, 2, 57 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 6, hash_values, 2, 3, 0, 1, 58 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 13, hash_values, 1, 2, 3, 0, 59 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 4, hash_values, 0, 1, 2, 3, 60 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 11, hash_values, 3, 0, 1, 2, 61 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 2, hash_values, 2, 3, 0, 1, 62 ); \ + libhmac_md5_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 9, hash_values, 1, 2, 3, 0, 63 ); + +/* Calculates the MD5 of 64 byte sized blocks of data in a buffer + * Returns the number of bytes used if successful or -1 on error + */ +ssize_t libhmac_md5_context_transform( + libhmac_internal_md5_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + uint32_t hash_values[ 4 ]; + uint32_t values_32bit[ 16 ]; + + static char *function = "libhmac_md5_context_transform"; + size_t buffer_offset = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + uint32_t hash_value = 0; + uint8_t block_index = 0; + uint8_t hash_values_index = 0; + uint8_t value_32bit_index = 0; +#endif + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid internal context.", + function ); + + return( -1 ); + } + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + while( size >= LIBHMAC_MD5_BLOCK_SIZE ) + { + if( memory_copy( + hash_values, + internal_context->hash_values, + sizeof( uint32_t ) * 4 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy hash values.", + function ); + + goto on_error; + } +#if defined( LIBHMAC_UNFOLLED_LOOPS ) + /* Break the block into 16 x 32-bit values + */ + libhmac_byte_stream_copy_to_16x_uint32_little_endian( + &( buffer[ buffer_offset ] ), + values_32bit ); + + buffer_offset += LIBHMAC_MD5_BLOCK_SIZE; + + /* Calculate the hash values for the 32-bit values + */ + libhmac_md5_context_transform_unfolded_calculate_hash_values( + values_32bit, + hash_values ); + + /* Update the hash values in the context + */ + internal_context->hash_values[ 0 ] += hash_values[ 0 ]; + internal_context->hash_values[ 1 ] += hash_values[ 1 ]; + internal_context->hash_values[ 2 ] += hash_values[ 2 ]; + internal_context->hash_values[ 3 ] += hash_values[ 3 ]; + +#else + /* Break the block into 16 x 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 16; + value_32bit_index++ ) + { + byte_stream_copy_to_uint32_little_endian( + &( buffer[ buffer_offset ] ), + values_32bit[ value_32bit_index ] ); + + buffer_offset += sizeof( uint32_t ); + } + /* Calculate the hash values for the 32-bit values + */ + for( block_index = 0; + block_index < 64; + block_index++ ) + { + if( block_index < 16 ) + { + hash_values[ 0 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) + | ( ~( hash_values[ 1 ] ) & hash_values[ 3 ] ); + } + else if( block_index < 32 ) + { + hash_values[ 0 ] += ( hash_values[ 1 ] & hash_values[ 3 ] ) + | ( hash_values[ 2 ] & ~( hash_values[ 3 ] ) ); + } + else if( block_index < 48 ) + { + hash_values[ 0 ] += hash_values[ 1 ] + ^ hash_values[ 2 ] + ^ hash_values[ 3 ]; + } + else + { + hash_values[ 0 ] += hash_values[ 2 ] + ^ ( hash_values[ 1 ] | ~( hash_values[ 3 ] ) ); + } + value_32bit_index = libhmac_md5_context_values_32bit_index[ block_index ]; + + hash_values[ 0 ] += values_32bit[ value_32bit_index ]; + hash_values[ 0 ] += libhmac_md5_context_sines[ block_index ]; + hash_values[ 0 ] = byte_stream_bit_rotate_left_32bit( + hash_values[ 0 ], + libhmac_md5_context_bit_shifts[ block_index ] ); + + hash_value = hash_values[ 3 ]; + hash_values[ 3 ] = hash_values[ 2 ]; + hash_values[ 2 ] = hash_values[ 1 ]; + hash_values[ 1 ] += hash_values[ 0 ]; + hash_values[ 0 ] = hash_value; + } + /* Update the hash values in the context + */ + for( hash_values_index = 0; + hash_values_index < 4; + hash_values_index++ ) + { + internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; + } +#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + size -= LIBHMAC_MD5_BLOCK_SIZE; + } + /* Prevent sensitive data from leaking + */ + if( memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 4 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear hash values.", + function ); + + goto on_error; + } + if( memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear 32-bit values.", + function ); + + goto on_error; + } + return( (ssize_t) buffer_offset ); + +on_error: + memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 16 ); + + memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 4 ); + + return( -1 ); +} + +#endif /* !defined( LIBHMAC_HAVE_MD5_SUPPORT ) */ + +/* Creates a MD5 context + * Make sure the value context is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_initialize( + libhmac_md5_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_initialize"; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) + const EVP_MD *evp_md_type = NULL; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid context value already set.", + function ); + + return( -1 ); + } + internal_context = memory_allocate_structure( + libhmac_internal_md5_context_t ); + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create context.", + function ); + + goto on_error; + } + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_md5_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + memory_free( + internal_context ); + + return( -1 ); + } +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) + if( MD5_Init( + &( internal_context->md5_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + + goto on_error; + } + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX_init( + &( internal_context->internal_evp_md_context ) ); + + internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); +#else + internal_context->evp_md_context = EVP_MD_CTX_new(); + + if( internal_context->evp_md_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP message digest context.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ + +/* TODO use EVP_MD_fetch for EVP_DigestInit_ex2 */ + evp_md_type = EVP_md5(); + +#if defined( HAVE_EVP_DIGESTINIT_EX2 ) + if( EVP_DigestInit_ex2( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#else + if( EVP_DigestInit_ex( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize EVP message digest context.", + function ); + +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ); + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); +#endif + internal_context->evp_md_context = NULL; + + goto on_error; + } +#else + if( memory_copy( + internal_context->hash_values, + libhmac_md5_context_fixed_constants, + sizeof( uint32_t ) * 4 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy fixed constants to hash values.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) */ + + *context = (libhmac_md5_context_t *) internal_context; + + return( 1 ); + +on_error: + if( internal_context != NULL ) + { + memory_free( + internal_context ); + } + return( -1 ); +} + +/* Frees a MD5 context + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_free( + libhmac_md5_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_free"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + internal_context = (libhmac_internal_md5_context_t *) *context; + *context = NULL; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) + /* No additional clean up necessary + */ + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + if( EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to clean up EVP message digest context.", + function ); + } + /* Make sure the error state is removed otherwise OpenSSL will leak memory + */ + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); + +#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ + + internal_context->evp_md_context = NULL; +#else + /* No additional clean up necessary + */ +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) */ + + memory_free( + internal_context ); + } + return( 1 ); +} + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) + +/* Updates the MD5 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_update( + libhmac_md5_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_update"; + unsigned long safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_md5_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } +#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) + if( size > (size_t) ULONG_MAX ) +#else + if( size > (size_t) SSIZE_MAX ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + safe_hash_size = (unsigned long) size; + + if( MD5_Update( + &( internal_context->md5_context ), + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) + +/* Updates the MD5 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_update( + libhmac_md5_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_update"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_md5_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( EVP_DigestUpdate( + internal_context->evp_md_context, + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Updates the MD5 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_update( + libhmac_md5_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_update"; + size_t buffer_offset = 0; + size_t remaining_block_size = 0; + ssize_t process_count = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_md5_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( internal_context->block_offset > 0 ) + { + if( internal_context->block_offset >= LIBHMAC_MD5_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid context - block offset value out of bounds.", + function ); + + return( -1 ); + } + remaining_block_size = LIBHMAC_MD5_BLOCK_SIZE - internal_context->block_offset; + + if( remaining_block_size > size ) + { + remaining_block_size = size; + } + if( memory_copy( + &( internal_context->block[ internal_context->block_offset ] ), + buffer, + remaining_block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset += remaining_block_size; + + if( internal_context->block_offset < LIBHMAC_MD5_BLOCK_SIZE ) + { + return( 1 ); + } + buffer_offset += remaining_block_size; + size -= remaining_block_size; + + process_count = libhmac_md5_context_transform( + internal_context, + internal_context->block, + LIBHMAC_MD5_BLOCK_SIZE, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + internal_context->block_offset = 0; + } + if( size > 0 ) + { + process_count = libhmac_md5_context_transform( + internal_context, + &( buffer[ buffer_offset ] ), + size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform buffer.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + + buffer_offset += process_count; + size -= process_count; + } + if( size > 0 ) + { + if( size >= LIBHMAC_MD5_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid size value out of bounds.", + function ); + + return( -1 ); + } + if( memory_copy( + internal_context->block, + &( buffer[ buffer_offset ] ), + size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy remaining data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset = size; + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) */ + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) + +/* Finalizes the MD5 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_finalize( + libhmac_md5_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_finalize"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_md5_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + if( MD5_Final( + hash, + &( internal_context->md5_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) + +/* Finalizes the MD5 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_finalize( + libhmac_md5_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_finalize"; + unsigned int safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_md5_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( ( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) + || ( hash_size > (size_t) UINT_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid hash size value out of bounds.", + function ); + + return( -1 ); + } + safe_hash_size = (unsigned int) hash_size; + + if( EVP_DigestFinal_ex( + internal_context->evp_md_context, + (unsigned char *) hash, + &safe_hash_size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Finalizes the MD5 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_md5_context_finalize( + libhmac_md5_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_md5_context_t *internal_context = NULL; + static char *function = "libhmac_md5_context_finalize"; + size_t block_size = 0; + size_t number_of_blocks = 0; + ssize_t process_count = 0; + uint64_t bit_size = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + size_t hash_index = 0; + int hash_values_index = 0; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_md5_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + /* Add padding with a size of 56 mod 64 + */ + number_of_blocks = 1; + + if( internal_context->block_offset > 55 ) + { + number_of_blocks += 1; + } + block_size = number_of_blocks * LIBHMAC_MD5_BLOCK_SIZE; + + if( memory_set( + &( internal_context->block[ internal_context->block_offset ] ), + 0, + block_size - internal_context->block_offset ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context block.", + function ); + + return( -1 ); + } + /* The first byte of the padding contains 0x80 + */ + internal_context->block[ internal_context->block_offset ] = 0x80; + + bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; + + byte_stream_copy_from_uint64_little_endian( + &( internal_context->block[ block_size - 8 ] ), + bit_size ); + + process_count = libhmac_md5_context_transform( + internal_context, + internal_context->block, + block_size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + for( hash_values_index = 0; + hash_values_index < 4; + hash_values_index++ ) + { + byte_stream_copy_from_uint32_little_endian( + &( hash[ hash_index ] ), + internal_context->hash_values[ hash_values_index ] ); + + hash_index += sizeof( uint32_t ); + } +#else + byte_stream_copy_from_uint32_little_endian( + &( hash[ 0 ] ), + internal_context->hash_values[ 0 ] ); + + byte_stream_copy_from_uint32_little_endian( + &( hash[ 4 ] ), + internal_context->hash_values[ 1 ] ); + + byte_stream_copy_from_uint32_little_endian( + &( hash[ 8 ] ), + internal_context->hash_values[ 2 ] ); + + byte_stream_copy_from_uint32_little_endian( + &( hash[ 12 ] ), + internal_context->hash_values[ 3 ] ); + +#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + /* Prevent sensitive data from leaking + */ + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_md5_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) */ + diff -Nru libbde-20190102/libhmac/libhmac_md5_context.h libbde-20240223/libhmac/libhmac_md5_context.h --- libbde-20190102/libhmac/libhmac_md5_context.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_md5_context.h 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * MD5 context functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBHMAC_MD5_CONTEXT_H ) +#define _LIBHMAC_MD5_CONTEXT_H + +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#endif + +#include "libhmac_extern.h" +#include "libhmac_libcerror.h" +#include "libhmac_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) +#define LIBHMAC_HAVE_MD5_SUPPORT + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) +#define LIBHMAC_HAVE_MD5_SUPPORT + +#endif + +#define LIBHMAC_MD5_BLOCK_SIZE 64 + +typedef struct libhmac_internal_md5_context libhmac_internal_md5_context_t; + +struct libhmac_internal_md5_context +{ +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) + /* The MD5 context + */ + MD5_CTX md5_context; + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) + /* The EVP message digest context + */ +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX internal_evp_md_context; +#endif + + EVP_MD_CTX *evp_md_context; + +#else + /* The number of bytes hashed + */ + uint64_t hash_count; + + /* The hash values + */ + uint32_t hash_values[ 4 ]; + + /* The block offset + */ + size_t block_offset; + + /* The (data) block + */ + uint8_t block[ 2 * LIBHMAC_MD5_BLOCK_SIZE ]; + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) */ +}; + +#if !defined( LIBHMAC_HAVE_MD5_SUPPORT ) + +ssize_t libhmac_context_md5_transform( + libhmac_internal_md5_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +#endif /* !defined( LIBHMAC_HAVE_MD5_SUPPORT ) */ + +LIBHMAC_EXTERN \ +int libhmac_md5_context_initialize( + libhmac_md5_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_md5_context_free( + libhmac_md5_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_md5_context_update( + libhmac_md5_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_md5_context_finalize( + libhmac_md5_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBHMAC_MD5_CONTEXT_H ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha1.c libbde-20240223/libhmac/libhmac_sha1.c --- libbde-20190102/libhmac/libhmac_sha1.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha1.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,498 +1,32 @@ /* * SHA1 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include -#include #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include -#include - -#endif - -#include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha1.h" - -#if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) - -/* RFC 3174/FIPS 180-1 based SHA-1 functions - */ - -/* TODO decription what these values are based on - */ -uint32_t libhmac_sha1_fixed_constants[ 5 ] = { - 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL -}; - -#define libhmac_sha1_transform_extend_32bit_value( values_32bit, value_32bit_index ) \ - values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 3 ] \ - ^ values_32bit[ value_32bit_index - 8 ] \ - ^ values_32bit[ value_32bit_index - 14 ] \ - ^ values_32bit[ value_32bit_index - 16 ]; \ - values_32bit[ value_32bit_index ] = byte_stream_bit_rotate_left_32bit( \ - values_32bit[ value_32bit_index ], \ - 1 ); - -#define libhmac_sha1_transform_unfolded_extend_32bit_values( values_32bit ) \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 16 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 17 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 18 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 19 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 20 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 21 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 22 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 23 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 24 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 25 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 26 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 27 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 28 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 29 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 30 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 31 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 32 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 33 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 34 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 35 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 36 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 37 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 38 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 39 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 40 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 41 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 42 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 43 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 44 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 45 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 46 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 47 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 48 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 49 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 50 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 51 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 52 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 53 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 54 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 55 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 56 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 57 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 58 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 59 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 60 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 61 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 62 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 63 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 64 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 65 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 66 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 67 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 68 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 69 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 70 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 71 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 72 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 73 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 74 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 75 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 76 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 77 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 78 ); \ - libhmac_sha1_transform_extend_32bit_value( values_32bit, 79 ); - -#define libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ - hash_values[ hash_value_index4 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ - | ( ~( hash_values[ hash_value_index1 ] ) & hash_values[ hash_value_index3 ] ); \ - hash_values[ hash_value_index4 ] += 0x5a827999UL; \ - hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - 5 ); \ - hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ -\ - hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index1 ], \ - 30 ); - -#define libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ - hash_values[ hash_value_index4 ] += hash_values[ hash_value_index1 ] \ - ^ hash_values[ hash_value_index2 ] \ - ^ hash_values[ hash_value_index3 ]; \ - hash_values[ hash_value_index4 ] += 0x6ed9eba1UL; \ - hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - 5 ); \ - hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ -\ - hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index1 ], \ - 30 ); - -#define libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ - hash_values[ hash_value_index4 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ - | ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index3 ] ) \ - | ( hash_values[ hash_value_index2 ] & hash_values[ hash_value_index3 ] ); \ - hash_values[ hash_value_index4 ] += 0x8f1bbcdcUL; \ - hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - 5 ); \ - hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ -\ - hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index1 ], \ - 30 ); - -#define libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ - hash_values[ hash_value_index4 ] += hash_values[ hash_value_index1 ] \ - ^ hash_values[ hash_value_index2 ] \ - ^ hash_values[ hash_value_index3 ]; \ - hash_values[ hash_value_index4 ] += 0xca62c1d6UL; \ - hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index0 ], \ - 5 ); \ - hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ -\ - hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ - hash_values[ hash_value_index1 ], \ - 30 ); - -#define libhmac_sha1_transform_unfolded_calculate_hash_values( values_32bit, hash_values ) \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 0, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 1, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 2, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 3, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 4, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 5, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 6, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 7, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 8, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 9, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 10, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 11, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 12, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 13, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 14, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 15, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 16, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 17, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 18, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round1( values_32bit, 19, hash_values, 1, 2, 3, 4, 0 ); \ -\ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 20, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 21, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 22, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 23, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 24, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 25, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 26, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 27, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 28, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 29, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 30, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 31, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 32, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 33, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 34, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 35, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 36, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 37, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 38, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round2( values_32bit, 39, hash_values, 1, 2, 3, 4, 0 ); \ -\ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 40, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 41, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 42, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 43, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 44, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 45, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 46, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 47, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 48, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 49, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 50, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 51, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 52, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 53, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 54, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 55, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 56, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 57, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 58, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round3( values_32bit, 59, hash_values, 1, 2, 3, 4, 0 ); \ -\ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 60, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 61, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 62, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 63, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 64, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 65, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 66, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 67, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 68, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 69, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 70, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 71, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 72, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 73, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 74, hash_values, 1, 2, 3, 4, 0 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 75, hash_values, 0, 1, 2, 3, 4 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 76, hash_values, 4, 0, 1, 2, 3 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 77, hash_values, 3 ,4, 0, 1, 2 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 78, hash_values, 2, 3, 4, 0, 1 ); \ - libhmac_sha1_transform_unfolded_calculate_hash_value_round4( values_32bit, 79, hash_values, 1, 2, 3, 4, 0 ); - -/* Calculates the SHA1 of 64 byte sized blocks of data in a buffer - * Returns the number of bytes used if successful or -1 on error - */ -ssize_t libhmac_sha1_transform( - libhmac_internal_sha1_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - uint32_t hash_values[ 5 ]; - uint32_t values_32bit[ 80 ]; - - static char *function = "libhmac_sha1_transform"; - size_t buffer_offset = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - uint32_t hash_value = 0; - uint8_t hash_values_index = 0; - uint8_t value_32bit_index = 0; -#endif - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid internal context.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - while( size >= LIBHMAC_SHA1_BLOCK_SIZE ) - { - if( memory_copy( - hash_values, - internal_context->hash_values, - sizeof( uint32_t ) * 5 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy hash values.", - function ); - - goto on_error; - } -#if defined( LIBHMAC_UNFOLLED_LOOPS ) - /* Break the block into 16 x 32-bit values - */ - libhmac_byte_stream_copy_to_16x_uint32_big_endian( - &( buffer[ buffer_offset ] ), - values_32bit ); - - buffer_offset += LIBHMAC_SHA1_BLOCK_SIZE; - - /* Extend to 80 x 32-bit values - */ - libhmac_sha1_transform_unfolded_extend_32bit_values( - values_32bit ); - - /* Calculate the hash values for the 32-bit values - */ - libhmac_sha1_transform_unfolded_calculate_hash_values( - values_32bit, - hash_values ); - - /* Update the hash values in the context - */ - internal_context->hash_values[ 0 ] += hash_values[ 0 ]; - internal_context->hash_values[ 1 ] += hash_values[ 1 ]; - internal_context->hash_values[ 2 ] += hash_values[ 2 ]; - internal_context->hash_values[ 3 ] += hash_values[ 3 ]; - internal_context->hash_values[ 4 ] += hash_values[ 4 ]; -#else - /* Break the block into 16 x 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 16; - value_32bit_index++ ) - { - byte_stream_copy_to_uint32_big_endian( - &( buffer[ buffer_offset ] ), - values_32bit[ value_32bit_index ] ); - - buffer_offset += sizeof( uint32_t ); - } - /* Extend to 80 x 32-bit values - */ - for( value_32bit_index = 16; - value_32bit_index < 80; - value_32bit_index++ ) - { - libhmac_sha1_transform_extend_32bit_value( - values_32bit, - value_32bit_index ); - } - /* Calculate the hash values for the 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 80; - value_32bit_index++ ) - { - if( value_32bit_index < 20 ) - { - hash_values[ 4 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) - | ( ~( hash_values[ 1 ] ) & hash_values[ 3 ] ); - hash_values[ 4 ] += 0x5a827999UL; - } - else if( value_32bit_index < 40 ) - { - hash_values[ 4 ] += hash_values[ 1 ] - ^ hash_values[ 2 ] - ^ hash_values[ 3 ]; - hash_values[ 4 ] += 0x6ed9eba1UL; - } - else if( value_32bit_index < 60 ) - { - hash_values[ 4 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) - | ( hash_values[ 1 ] & hash_values[ 3 ] ) - | ( hash_values[ 2 ] & hash_values[ 3 ] ); - hash_values[ 4 ] += 0x8f1bbcdcUL; - } - else - { - hash_values[ 4 ] += hash_values[ 1 ] - ^ hash_values[ 2 ] - ^ hash_values[ 3 ]; - hash_values[ 4 ] += 0xca62c1d6UL; - } - hash_values[ 4 ] += byte_stream_bit_rotate_left_32bit( - hash_values[ 0 ], - 5 ); - hash_values[ 4 ] += values_32bit[ value_32bit_index ]; - - hash_value = hash_values[ 4 ]; - hash_values[ 4 ] = hash_values[ 3 ]; - hash_values[ 3 ] = hash_values[ 2 ]; - hash_values[ 2 ] = byte_stream_bit_rotate_left_32bit( - hash_values[ 1 ], - 30 ); - hash_values[ 1 ] = hash_values[ 0 ]; - hash_values[ 0 ] = hash_value; - } - /* Update the hash values in the context - */ - for( hash_values_index = 0; - hash_values_index < 5; - hash_values_index++ ) - { - internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; - } -#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - size -= LIBHMAC_SHA1_BLOCK_SIZE; - } - /* Prevent sensitive data from leaking - */ - if( memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 5 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear hash values.", - function ); - - goto on_error; - } - if( memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 16 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear 32-bit values.", - function ); - - goto on_error; - } - return( (ssize_t) buffer_offset ); - -on_error: - memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 64 ); - - memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 5 ); - - return( -1 ); -} - -#endif /* !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) */ +#include "libhmac_sha1_context.h" /* Creates a SHA1 context * Make sure the value context is referencing, is set to NULL @@ -502,161 +36,11 @@ libhmac_sha1_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_initialize"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid context value already set.", - function ); - - return( -1 ); - } - internal_context = memory_allocate_structure( - libhmac_internal_sha1_context_t ); - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create context.", - function ); - - goto on_error; - } - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha1_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - memory_free( - internal_context ); - - return( -1 ); - } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) - /* Request the AES crypt provider, fail back to the RSA crypt provider - */ - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_AES, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create AES or RSA crypt provider.", - function ); - - goto on_error; - } - } - if( internal_context->crypt_provider == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: unable to create crypt provider.", - function ); - - goto on_error; - } - if( CryptCreateHash( - internal_context->crypt_provider, - CALG_SHA1, - 0, - 0, - &( internal_context->hash ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create hash object.", - function ); - - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) - if( SHA1_Init( - &( internal_context->sha1_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize context.", - function ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX_init( - &( internal_context->internal_evp_md_context ) ); - - internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); -#else - internal_context->evp_md_context = EVP_MD_CTX_new(); - - if( internal_context->evp_md_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP message digest context.", - function ); - - goto on_error; - } -#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ + static char *function = "libhmac_sha1_initialize"; - if( EVP_DigestInit_ex( - internal_context->evp_md_context, - EVP_sha1(), - NULL ) != 1 ) + if( libhmac_sha1_context_initialize( + context, + error ) != 1 ) { libcerror_error_set( error, @@ -665,46 +49,9 @@ "%s: unable to initialize context.", function ); -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); -#endif - internal_context->evp_md_context = NULL; - - goto on_error; - } -#else - if( memory_copy( - internal_context->hash_values, - libhmac_sha1_fixed_constants, - sizeof( uint32_t ) * 5 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy fixed constants to hash values.", - function ); - - goto on_error; + return( -1 ); } -#endif - *context = (libhmac_sha1_context_t *) internal_context; - return( 1 ); - -on_error: - if( internal_context != NULL ) - { - memory_free( - internal_context ); - } - return( -1 ); } /* Frees a SHA1 context @@ -714,229 +61,17 @@ libhmac_sha1_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_free"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - internal_context = (libhmac_internal_sha1_context_t *) *context; - *context = NULL; - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) - if( internal_context->crypt_provider != 0 ) - { - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - } - if( internal_context->hash != 0 ) - { - CryptDestroyHash( - internal_context->hash ); - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) - /* No additional clean up necessary - */ - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - if( EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP message digest context.", - function ); - } - /* Make sure the error state is removed otherwise OpenSSL will leak memory - */ - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); - -#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ - - internal_context->evp_md_context = NULL; -#else - /* No additional clean up necessary - */ -#endif - memory_free( - internal_context ); - } - return( 1 ); -} - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) - -/* Updates the SHA1 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha1_update( - libhmac_sha1_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( size == 0 ) - { - return( 1 ); - } - if( CryptHashData( - internal_context->hash, - (BYTE *) buffer, - (DWORD) size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) - -/* Updates the SHA1 context using OpenSSL - * Returns 1 if successful or -1 on error - */ -int libhmac_sha1_update( - libhmac_sha1_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_update"; - unsigned long safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) - if( size > (size_t) ULONG_MAX ) -#else - if( size > (size_t) SSIZE_MAX ) -#endif - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - safe_hash_size = (unsigned long) size; + static char *function = "libhmac_sha1_free"; - if( SHA1_Update( - &( internal_context->sha1_context ), - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha1_context_free( + context, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update context.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free context.", function ); return( -1 ); @@ -944,9 +79,7 @@ return( 1 ); } -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) - -/* Updates the SHA1 context using OpenSSL EVP +/* Updates the SHA1 context * Returns 1 if successful or -1 on error */ int libhmac_sha1_update( @@ -955,52 +88,13 @@ size_t size, libcerror_error_t **error ) { - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_update"; + static char *function = "libhmac_sha1_update"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( EVP_DigestUpdate( - internal_context->evp_md_context, - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha1_context_update( + context, + buffer, + size, + error ) != 1 ) { libcerror_error_set( error, @@ -1014,269 +108,7 @@ return( 1 ); } -#else - -/* Updates the SHA1 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha1_update( - libhmac_sha1_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_update"; - size_t buffer_offset = 0; - size_t remaining_block_size = 0; - ssize_t process_count = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( internal_context->block_offset > 0 ) - { - remaining_block_size = LIBHMAC_SHA1_BLOCK_SIZE - internal_context->block_offset; - - if( remaining_block_size > size ) - { - remaining_block_size = size; - } - if( memory_copy( - &( internal_context->block[ internal_context->block_offset ] ), - buffer, - remaining_block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset += remaining_block_size; - - if( internal_context->block_offset < LIBHMAC_SHA1_BLOCK_SIZE ) - { - return( 1 ); - } - buffer_offset += remaining_block_size; - size -= remaining_block_size; - - process_count = libhmac_sha1_transform( - internal_context, - internal_context->block, - LIBHMAC_SHA1_BLOCK_SIZE, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - internal_context->block_offset = 0; - } - if( size > 0 ) - { - process_count = libhmac_sha1_transform( - internal_context, - &( buffer[ buffer_offset ] ), - size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform buffer.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - - buffer_offset += process_count; - size -= process_count; - } - if( size > 0 ) - { - if( size >= LIBHMAC_SHA1_BLOCK_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid size value out of bounds.", - function ); - - return( -1 ); - } - if( memory_copy( - internal_context->block, - &( buffer[ buffer_offset ] ), - size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy remaining data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset = size; - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) - -/* Finalizes the SHA1 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha1_finalize( - libhmac_sha1_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_finalize"; - DWORD safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( hash_size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (DWORD) hash_size; - - if( CryptGetHashParam( - internal_context->hash, - HP_HASHVAL, - (BYTE *) hash, - &safe_hash_size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) - -/* Finalizes the SHA1 context using OpenSSL +/* Finalizes the SHA1 context * Returns 1 if successful or -1 on error */ int libhmac_sha1_finalize( @@ -1285,138 +117,13 @@ size_t hash_size, libcerror_error_t **error ) { - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_finalize"; + static char *function = "libhmac_sha1_finalize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - if( SHA1_Final( + if( libhmac_sha1_context_finalize( + context, hash, - &( internal_context->sha1_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) - -/* Finalizes the SHA1 context using OpenSSL EVP - * Returns 1 if successful or -1 on error - */ -int libhmac_sha1_finalize( - libhmac_sha1_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_finalize"; - unsigned int safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) UINT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (unsigned int) hash_size; - - if( EVP_DigestFinal_ex( - internal_context->evp_md_context, - (unsigned char *) hash, - &safe_hash_size ) != 1 ) + hash_size, + error ) != 1 ) { libcerror_error_set( error, @@ -1430,192 +137,6 @@ return( 1 ); } -#else - -/* Finalizes the SHA1 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha1_finalize( - libhmac_sha1_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha1_context_t *internal_context = NULL; - static char *function = "libhmac_sha1_finalize"; - size_t block_size = 0; - size_t number_of_blocks = 0; - ssize_t process_count = 0; - uint64_t bit_size = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - size_t hash_index = 0; - int hash_values_index = 0; -#endif - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha1_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - /* Add padding with a size of 56 mod 64 - */ - number_of_blocks = 1; - - if( internal_context->block_offset > 55 ) - { - number_of_blocks += 1; - } - block_size = number_of_blocks * LIBHMAC_SHA1_BLOCK_SIZE; - - if( memory_set( - &( internal_context->block[ internal_context->block_offset ] ), - 0, - block_size - internal_context->block_offset ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context block.", - function ); - - return( -1 ); - } - /* The first byte of the padding contains 0x80 - */ - internal_context->block[ internal_context->block_offset ] = 0x80; - - bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; - - byte_stream_copy_from_uint64_big_endian( - &( internal_context->block[ block_size - 8 ] ), - bit_size ); - - process_count = libhmac_sha1_transform( - internal_context, - internal_context->block, - block_size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - for( hash_values_index = 0; - hash_values_index < 5; - hash_values_index++ ) - { - byte_stream_copy_from_uint32_big_endian( - &( hash[ hash_index ] ), - internal_context->hash_values[ hash_values_index ] ); - - hash_index += sizeof( uint32_t ); - } -#else - byte_stream_copy_from_uint32_big_endian( - &( hash[ 0 ] ), - internal_context->hash_values[ 0 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 4 ] ), - internal_context->hash_values[ 1 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 8 ] ), - internal_context->hash_values[ 2 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 12 ] ), - internal_context->hash_values[ 3 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 16 ] ), - internal_context->hash_values[ 4 ] ); - -#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - /* Prevent sensitive data from leaking - */ - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha1_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ - /* Calculates the SHA1 of the buffer * Returns 1 if successful or -1 on error */ @@ -1629,7 +150,7 @@ libhmac_sha1_context_t *context = NULL; static char *function = "libhmac_sha1_calculate"; - if( libhmac_sha1_initialize( + if( libhmac_sha1_context_initialize( &context, error ) != 1 ) { @@ -1642,7 +163,7 @@ goto on_error; } - if( libhmac_sha1_update( + if( libhmac_sha1_context_update( context, buffer, size, @@ -1657,7 +178,7 @@ goto on_error; } - if( libhmac_sha1_finalize( + if( libhmac_sha1_context_finalize( context, hash, hash_size, @@ -1672,7 +193,7 @@ goto on_error; } - if( libhmac_sha1_free( + if( libhmac_sha1_context_free( &context, error ) != 1 ) { @@ -1690,7 +211,7 @@ on_error: if( context != NULL ) { - libhmac_sha1_free( + libhmac_sha1_context_free( &context, NULL ); } @@ -1800,7 +321,7 @@ } else { - if( libhmac_sha1_initialize( + if( libhmac_sha1_context_initialize( &context, error ) != 1 ) { @@ -1813,7 +334,7 @@ goto on_error; } - if( libhmac_sha1_update( + if( libhmac_sha1_context_update( context, key, key_size, @@ -1828,7 +349,7 @@ goto on_error; } - if( libhmac_sha1_finalize( + if( libhmac_sha1_context_finalize( context, key_hash, LIBHMAC_SHA1_HASH_SIZE, @@ -1843,7 +364,7 @@ goto on_error; } - if( libhmac_sha1_free( + if( libhmac_sha1_context_free( &context, error ) != 1 ) { @@ -1951,7 +472,7 @@ inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } - if( libhmac_sha1_initialize( + if( libhmac_sha1_context_initialize( &context, error ) != 1 ) { @@ -1964,7 +485,7 @@ goto on_error; } - if( libhmac_sha1_update( + if( libhmac_sha1_context_update( context, inner_padding, block_size, @@ -1979,7 +500,7 @@ goto on_error; } - if( libhmac_sha1_update( + if( libhmac_sha1_context_update( context, buffer, size, @@ -1994,7 +515,7 @@ goto on_error; } - if( libhmac_sha1_finalize( + if( libhmac_sha1_context_finalize( context, hmac, hmac_size, @@ -2009,7 +530,7 @@ goto on_error; } - if( libhmac_sha1_free( + if( libhmac_sha1_context_free( &context, error ) != 1 ) { @@ -2022,7 +543,7 @@ goto on_error; } - if( libhmac_sha1_initialize( + if( libhmac_sha1_context_initialize( &context, error ) != 1 ) { @@ -2035,7 +556,7 @@ goto on_error; } - if( libhmac_sha1_update( + if( libhmac_sha1_context_update( context, outer_padding, block_size, @@ -2050,7 +571,7 @@ goto on_error; } - if( libhmac_sha1_update( + if( libhmac_sha1_context_update( context, hmac, LIBHMAC_SHA1_HASH_SIZE, @@ -2065,7 +586,7 @@ goto on_error; } - if( libhmac_sha1_finalize( + if( libhmac_sha1_context_finalize( context, hmac, hmac_size, @@ -2080,7 +601,7 @@ goto on_error; } - if( libhmac_sha1_free( + if( libhmac_sha1_context_free( &context, error ) != 1 ) { @@ -2155,7 +676,7 @@ on_error: if( context != NULL ) { - libhmac_sha1_free( + libhmac_sha1_context_free( &context, NULL ); } diff -Nru libbde-20190102/libhmac/libhmac_sha1.h libbde-20240223/libhmac/libhmac_sha1.h --- libbde-20190102/libhmac/libhmac_sha1.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha1.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * SHA1 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_SHA1_H ) @@ -25,17 +25,6 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include - -#endif - #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" @@ -44,78 +33,6 @@ extern "C" { #endif -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) -#define LIBHMAC_HAVE_SHA1_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) -#define LIBHMAC_HAVE_SHA1_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) -#define LIBHMAC_HAVE_SHA1_SUPPORT - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ - -#if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) -#define LIBHMAC_SHA1_BLOCK_SIZE 64 -#endif - -typedef struct libhmac_internal_sha1_context libhmac_internal_sha1_context_t; - -struct libhmac_internal_sha1_context -{ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) - /* The crypto provider handle - */ - HCRYPTPROV crypt_provider; - - /* The crypto hash handle - */ - HCRYPTHASH hash; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) - /* The SHA1 context - */ - SHA_CTX sha1_context; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) - /* The EVP message digest context - */ -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX internal_evp_md_context; -#endif - - EVP_MD_CTX *evp_md_context; - -#else - /* The number of bytes hashed - */ - uint64_t hash_count; - - /* The hash values - */ - uint32_t hash_values[ 5 ]; - - /* The block offset - */ - size_t block_offset; - - /* The (data) block - */ - uint8_t block[ 128 ]; - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) */ -}; - -#if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) - -ssize_t libhmac_sha1_transform( - libhmac_internal_sha1_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ); - -#endif /* !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) */ - LIBHMAC_EXTERN \ int libhmac_sha1_initialize( libhmac_sha1_context_t **context, diff -Nru libbde-20190102/libhmac/libhmac_sha1_context.c libbde-20240223/libhmac/libhmac_sha1_context.c --- libbde-20190102/libhmac/libhmac_sha1_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha1_context.c 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,1380 @@ +/* + * SHA1 context functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#include +#endif + +#include "libhmac_byte_stream.h" +#include "libhmac_definitions.h" +#include "libhmac_libcerror.h" +#include "libhmac_sha1_context.h" + +#if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) + +/* RFC 3174/FIPS 180-1 based SHA-1 functions + */ + +/* TODO decription what these values are based on + */ +uint32_t libhmac_sha1_context_fixed_constants[ 5 ] = { + 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL +}; + +#define libhmac_sha1_context_transform_extend_32bit_value( values_32bit, value_32bit_index ) \ + values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 3 ] \ + ^ values_32bit[ value_32bit_index - 8 ] \ + ^ values_32bit[ value_32bit_index - 14 ] \ + ^ values_32bit[ value_32bit_index - 16 ]; \ + values_32bit[ value_32bit_index ] = byte_stream_bit_rotate_left_32bit( \ + values_32bit[ value_32bit_index ], \ + 1 ); + +#define libhmac_sha1_context_transform_unfolded_extend_32bit_values( values_32bit ) \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 16 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 17 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 18 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 19 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 20 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 21 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 22 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 23 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 24 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 25 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 26 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 27 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 28 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 29 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 30 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 31 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 32 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 33 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 34 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 35 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 36 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 37 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 38 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 39 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 40 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 41 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 42 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 43 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 44 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 45 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 46 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 47 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 48 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 49 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 50 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 51 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 52 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 53 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 54 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 55 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 56 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 57 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 58 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 59 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 60 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 61 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 62 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 63 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 64 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 65 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 66 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 67 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 68 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 69 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 70 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 71 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 72 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 73 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 74 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 75 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 76 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 77 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 78 ); \ + libhmac_sha1_context_transform_extend_32bit_value( values_32bit, 79 ); + +#define libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ + hash_values[ hash_value_index4 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ + | ( ~( hash_values[ hash_value_index1 ] ) & hash_values[ hash_value_index3 ] ); \ + hash_values[ hash_value_index4 ] += 0x5a827999UL; \ + hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + 5 ); \ + hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ +\ + hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index1 ], \ + 30 ); + +#define libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ + hash_values[ hash_value_index4 ] += hash_values[ hash_value_index1 ] \ + ^ hash_values[ hash_value_index2 ] \ + ^ hash_values[ hash_value_index3 ]; \ + hash_values[ hash_value_index4 ] += 0x6ed9eba1UL; \ + hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + 5 ); \ + hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ +\ + hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index1 ], \ + 30 ); + +#define libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ + hash_values[ hash_value_index4 ] += ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ) \ + | ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index3 ] ) \ + | ( hash_values[ hash_value_index2 ] & hash_values[ hash_value_index3 ] ); \ + hash_values[ hash_value_index4 ] += 0x8f1bbcdcUL; \ + hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + 5 ); \ + hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ +\ + hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index1 ], \ + 30 ); + +#define libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4 ) \ + hash_values[ hash_value_index4 ] += hash_values[ hash_value_index1 ] \ + ^ hash_values[ hash_value_index2 ] \ + ^ hash_values[ hash_value_index3 ]; \ + hash_values[ hash_value_index4 ] += 0xca62c1d6UL; \ + hash_values[ hash_value_index4 ] += byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index0 ], \ + 5 ); \ + hash_values[ hash_value_index4 ] += values_32bit[ value_32bit_index ]; \ +\ + hash_values[ hash_value_index1 ] = byte_stream_bit_rotate_left_32bit( \ + hash_values[ hash_value_index1 ], \ + 30 ); + +#define libhmac_sha1_context_transform_unfolded_calculate_hash_values( values_32bit, hash_values ) \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 0, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 1, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 2, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 3, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 4, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 5, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 6, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 7, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 8, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 9, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 10, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 11, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 12, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 13, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 14, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 15, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 16, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 17, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 18, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round1( values_32bit, 19, hash_values, 1, 2, 3, 4, 0 ); \ +\ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 20, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 21, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 22, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 23, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 24, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 25, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 26, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 27, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 28, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 29, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 30, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 31, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 32, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 33, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 34, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 35, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 36, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 37, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 38, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round2( values_32bit, 39, hash_values, 1, 2, 3, 4, 0 ); \ +\ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 40, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 41, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 42, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 43, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 44, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 45, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 46, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 47, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 48, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 49, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 50, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 51, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 52, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 53, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 54, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 55, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 56, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 57, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 58, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round3( values_32bit, 59, hash_values, 1, 2, 3, 4, 0 ); \ +\ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 60, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 61, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 62, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 63, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 64, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 65, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 66, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 67, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 68, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 69, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 70, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 71, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 72, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 73, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 74, hash_values, 1, 2, 3, 4, 0 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 75, hash_values, 0, 1, 2, 3, 4 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 76, hash_values, 4, 0, 1, 2, 3 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 77, hash_values, 3 ,4, 0, 1, 2 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 78, hash_values, 2, 3, 4, 0, 1 ); \ + libhmac_sha1_context_transform_unfolded_calculate_hash_value_round4( values_32bit, 79, hash_values, 1, 2, 3, 4, 0 ); + +/* Calculates the SHA1 of 64 byte sized blocks of data in a buffer + * Returns the number of bytes used if successful or -1 on error + */ +ssize_t libhmac_sha1_context_transform( + libhmac_internal_sha1_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + uint32_t hash_values[ 5 ]; + uint32_t values_32bit[ 80 ]; + + static char *function = "libhmac_sha1_context_transform"; + size_t buffer_offset = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + uint32_t hash_value = 0; + uint8_t hash_values_index = 0; + uint8_t value_32bit_index = 0; +#endif + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid internal context.", + function ); + + return( -1 ); + } + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + while( size >= LIBHMAC_SHA1_BLOCK_SIZE ) + { + if( memory_copy( + hash_values, + internal_context->hash_values, + sizeof( uint32_t ) * 5 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy hash values.", + function ); + + goto on_error; + } +#if defined( LIBHMAC_UNFOLLED_LOOPS ) + /* Break the block into 16 x 32-bit values + */ + libhmac_byte_stream_copy_to_16x_uint32_big_endian( + &( buffer[ buffer_offset ] ), + values_32bit ); + + buffer_offset += LIBHMAC_SHA1_BLOCK_SIZE; + + /* Extend to 80 x 32-bit values + */ + libhmac_sha1_context_transform_unfolded_extend_32bit_values( + values_32bit ); + + /* Calculate the hash values for the 32-bit values + */ + libhmac_sha1_context_transform_unfolded_calculate_hash_values( + values_32bit, + hash_values ); + + /* Update the hash values in the context + */ + internal_context->hash_values[ 0 ] += hash_values[ 0 ]; + internal_context->hash_values[ 1 ] += hash_values[ 1 ]; + internal_context->hash_values[ 2 ] += hash_values[ 2 ]; + internal_context->hash_values[ 3 ] += hash_values[ 3 ]; + internal_context->hash_values[ 4 ] += hash_values[ 4 ]; +#else + /* Break the block into 16 x 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 16; + value_32bit_index++ ) + { + byte_stream_copy_to_uint32_big_endian( + &( buffer[ buffer_offset ] ), + values_32bit[ value_32bit_index ] ); + + buffer_offset += sizeof( uint32_t ); + } + /* Extend to 80 x 32-bit values + */ + for( value_32bit_index = 16; + value_32bit_index < 80; + value_32bit_index++ ) + { + libhmac_sha1_context_transform_extend_32bit_value( + values_32bit, + value_32bit_index ); + } + /* Calculate the hash values for the 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 80; + value_32bit_index++ ) + { + if( value_32bit_index < 20 ) + { + hash_values[ 4 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) + | ( ~( hash_values[ 1 ] ) & hash_values[ 3 ] ); + hash_values[ 4 ] += 0x5a827999UL; + } + else if( value_32bit_index < 40 ) + { + hash_values[ 4 ] += hash_values[ 1 ] + ^ hash_values[ 2 ] + ^ hash_values[ 3 ]; + hash_values[ 4 ] += 0x6ed9eba1UL; + } + else if( value_32bit_index < 60 ) + { + hash_values[ 4 ] += ( hash_values[ 1 ] & hash_values[ 2 ] ) + | ( hash_values[ 1 ] & hash_values[ 3 ] ) + | ( hash_values[ 2 ] & hash_values[ 3 ] ); + hash_values[ 4 ] += 0x8f1bbcdcUL; + } + else + { + hash_values[ 4 ] += hash_values[ 1 ] + ^ hash_values[ 2 ] + ^ hash_values[ 3 ]; + hash_values[ 4 ] += 0xca62c1d6UL; + } + hash_values[ 4 ] += byte_stream_bit_rotate_left_32bit( + hash_values[ 0 ], + 5 ); + hash_values[ 4 ] += values_32bit[ value_32bit_index ]; + + hash_value = hash_values[ 4 ]; + hash_values[ 4 ] = hash_values[ 3 ]; + hash_values[ 3 ] = hash_values[ 2 ]; + hash_values[ 2 ] = byte_stream_bit_rotate_left_32bit( + hash_values[ 1 ], + 30 ); + hash_values[ 1 ] = hash_values[ 0 ]; + hash_values[ 0 ] = hash_value; + } + /* Update the hash values in the context + */ + for( hash_values_index = 0; + hash_values_index < 5; + hash_values_index++ ) + { + internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; + } +#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + size -= LIBHMAC_SHA1_BLOCK_SIZE; + } + /* Prevent sensitive data from leaking + */ + if( memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 5 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear hash values.", + function ); + + goto on_error; + } + if( memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 16 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear 32-bit values.", + function ); + + goto on_error; + } + return( (ssize_t) buffer_offset ); + +on_error: + memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 64 ); + + memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 5 ); + + return( -1 ); +} + +#endif /* !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) */ + +/* Creates a SHA1 context + * Make sure the value context is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_initialize( + libhmac_sha1_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_initialize"; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) + const EVP_MD *evp_md_type = NULL; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid context value already set.", + function ); + + return( -1 ); + } + internal_context = memory_allocate_structure( + libhmac_internal_sha1_context_t ); + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create context.", + function ); + + goto on_error; + } + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha1_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + memory_free( + internal_context ); + + return( -1 ); + } +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) + if( SHA1_Init( + &( internal_context->sha1_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + + goto on_error; + } + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX_init( + &( internal_context->internal_evp_md_context ) ); + + internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); +#else + internal_context->evp_md_context = EVP_MD_CTX_new(); + + if( internal_context->evp_md_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP message digest context.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ + +/* TODO use EVP_MD_fetch for EVP_DigestInit_ex2 */ + evp_md_type = EVP_sha1(); + +#if defined( HAVE_EVP_DIGESTINIT_EX2 ) + if( EVP_DigestInit_ex2( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#else + if( EVP_DigestInit_ex( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ); + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); +#endif + internal_context->evp_md_context = NULL; + + goto on_error; + } +#else + if( memory_copy( + internal_context->hash_values, + libhmac_sha1_context_fixed_constants, + sizeof( uint32_t ) * 5 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy fixed constants to hash values.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) */ + + *context = (libhmac_sha1_context_t *) internal_context; + + return( 1 ); + +on_error: + if( internal_context != NULL ) + { + memory_free( + internal_context ); + } + return( -1 ); +} + +/* Frees a SHA1 context + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_free( + libhmac_sha1_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_free"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + internal_context = (libhmac_internal_sha1_context_t *) *context; + *context = NULL; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) + /* No additional clean up necessary + */ + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + if( EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to clean up EVP message digest context.", + function ); + } + /* Make sure the error state is removed otherwise OpenSSL will leak memory + */ + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); + +#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ + + internal_context->evp_md_context = NULL; +#else + /* No additional clean up necessary + */ + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) */ + memory_free( + internal_context ); + } + return( 1 ); +} + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) + +/* Updates the SHA1 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_update( + libhmac_sha1_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_update"; + unsigned long safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha1_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } +#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) + if( size > (size_t) ULONG_MAX ) +#else + if( size > (size_t) SSIZE_MAX ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + safe_hash_size = (unsigned long) size; + + if( SHA1_Update( + &( internal_context->sha1_context ), + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) + +/* Updates the SHA1 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_update( + libhmac_sha1_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_update"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha1_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( EVP_DigestUpdate( + internal_context->evp_md_context, + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Updates the SHA1 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_update( + libhmac_sha1_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_update"; + size_t buffer_offset = 0; + size_t remaining_block_size = 0; + ssize_t process_count = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha1_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( internal_context->block_offset > 0 ) + { + if( internal_context->block_offset >= LIBHMAC_SHA1_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid context - block offset value out of bounds.", + function ); + + return( -1 ); + } + remaining_block_size = LIBHMAC_SHA1_BLOCK_SIZE - internal_context->block_offset; + + if( remaining_block_size > size ) + { + remaining_block_size = size; + } + if( memory_copy( + &( internal_context->block[ internal_context->block_offset ] ), + buffer, + remaining_block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset += remaining_block_size; + + if( internal_context->block_offset < LIBHMAC_SHA1_BLOCK_SIZE ) + { + return( 1 ); + } + buffer_offset += remaining_block_size; + size -= remaining_block_size; + + process_count = libhmac_sha1_context_transform( + internal_context, + internal_context->block, + LIBHMAC_SHA1_BLOCK_SIZE, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + internal_context->block_offset = 0; + } + if( size > 0 ) + { + process_count = libhmac_sha1_context_transform( + internal_context, + &( buffer[ buffer_offset ] ), + size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform buffer.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + + buffer_offset += process_count; + size -= process_count; + } + if( size > 0 ) + { + if( size >= LIBHMAC_SHA1_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid size value out of bounds.", + function ); + + return( -1 ); + } + if( memory_copy( + internal_context->block, + &( buffer[ buffer_offset ] ), + size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy remaining data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset = size; + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) */ + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) + +/* Finalizes the SHA1 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_finalize( + libhmac_sha1_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_finalize"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha1_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + if( SHA1_Final( + hash, + &( internal_context->sha1_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) + +/* Finalizes the SHA1 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_finalize( + libhmac_sha1_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_finalize"; + unsigned int safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha1_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( ( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) + || ( hash_size > (size_t) UINT_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid hash size value out of bounds.", + function ); + + return( -1 ); + } + safe_hash_size = (unsigned int) hash_size; + + if( EVP_DigestFinal_ex( + internal_context->evp_md_context, + (unsigned char *) hash, + &safe_hash_size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Finalizes the SHA1 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha1_context_finalize( + libhmac_sha1_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha1_context_t *internal_context = NULL; + static char *function = "libhmac_sha1_context_finalize"; + size_t block_size = 0; + size_t number_of_blocks = 0; + ssize_t process_count = 0; + uint64_t bit_size = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + size_t hash_index = 0; + int hash_values_index = 0; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha1_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash value too small.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + /* Add padding with a size of 56 mod 64 + */ + number_of_blocks = 1; + + if( internal_context->block_offset > 55 ) + { + number_of_blocks += 1; + } + block_size = number_of_blocks * LIBHMAC_SHA1_BLOCK_SIZE; + + if( memory_set( + &( internal_context->block[ internal_context->block_offset ] ), + 0, + block_size - internal_context->block_offset ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context block.", + function ); + + return( -1 ); + } + /* The first byte of the padding contains 0x80 + */ + internal_context->block[ internal_context->block_offset ] = 0x80; + + bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; + + byte_stream_copy_from_uint64_big_endian( + &( internal_context->block[ block_size - 8 ] ), + bit_size ); + + process_count = libhmac_sha1_context_transform( + internal_context, + internal_context->block, + block_size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + for( hash_values_index = 0; + hash_values_index < 5; + hash_values_index++ ) + { + byte_stream_copy_from_uint32_big_endian( + &( hash[ hash_index ] ), + internal_context->hash_values[ hash_values_index ] ); + + hash_index += sizeof( uint32_t ); + } +#else + byte_stream_copy_from_uint32_big_endian( + &( hash[ 0 ] ), + internal_context->hash_values[ 0 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 4 ] ), + internal_context->hash_values[ 1 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 8 ] ), + internal_context->hash_values[ 2 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 12 ] ), + internal_context->hash_values[ 3 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 16 ] ), + internal_context->hash_values[ 4 ] ); + +#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + /* Prevent sensitive data from leaking + */ + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha1_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha1_context.h libbde-20240223/libhmac/libhmac_sha1_context.h --- libbde-20190102/libhmac/libhmac_sha1_context.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha1_context.h 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * SHA1 context functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBHMAC_SHA1_CONTEXT_H ) +#define _LIBHMAC_SHA1_CONTEXT_H + +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#endif + +#include "libhmac_extern.h" +#include "libhmac_libcerror.h" +#include "libhmac_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) +#define LIBHMAC_HAVE_SHA1_SUPPORT + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) +#define LIBHMAC_HAVE_SHA1_SUPPORT + +#endif + +#define LIBHMAC_SHA1_BLOCK_SIZE 64 + +typedef struct libhmac_internal_sha1_context libhmac_internal_sha1_context_t; + +struct libhmac_internal_sha1_context +{ +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) + /* The SHA1 context + */ + SHA_CTX sha1_context; + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) + /* The EVP message digest context + */ +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX internal_evp_md_context; +#endif + + EVP_MD_CTX *evp_md_context; + +#else + /* The number of bytes hashed + */ + uint64_t hash_count; + + /* The hash values + */ + uint32_t hash_values[ 5 ]; + + /* The block offset + */ + size_t block_offset; + + /* The (data) block + */ + uint8_t block[ 2 * LIBHMAC_SHA1_BLOCK_SIZE ]; + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) */ +}; + +#if !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) + +ssize_t libhmac_sha1_context_transform( + libhmac_internal_sha1_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +#endif /* !defined( LIBHMAC_HAVE_SHA1_SUPPORT ) */ + +LIBHMAC_EXTERN \ +int libhmac_sha1_context_initialize( + libhmac_sha1_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha1_context_free( + libhmac_sha1_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha1_context_update( + libhmac_sha1_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha1_context_finalize( + libhmac_sha1_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBHMAC_SHA1_CONTEXT_H ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha224.c libbde-20240223/libhmac/libhmac_sha224.c --- libbde-20190102/libhmac/libhmac_sha224.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha224.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,459 +1,34 @@ /* * SHA-224 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include -#include #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include -#include - -#endif - -#include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha224.h" +#include "libhmac_sha224_context.h" -#if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) - -/* FIPS 180-2 based SHA-224 functions - */ - -/* The first 32-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] - */ -uint32_t libhmac_sha224_prime_square_roots[ 8 ] = { - 0xc1059ed8UL, 0x367cd507UL, 0x3070dd17UL, 0xf70e5939UL, - 0xffc00b31UL, 0x68581511UL, 0x64f98fa7UL, 0xbefa4fa4UL -}; - -/* The first 32-bits of the fractional parts of the cube roots of the first 64 primes [ 2, 311 ] - */ -uint32_t libhmac_sha224_prime_cube_roots[ 64 ] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -#define libhmac_sha224_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ) \ - s0 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 7 ) \ - ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 18 ) \ - ^ ( values_32bit[ value_32bit_index - 15 ] >> 3 ); \ - s1 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 17 ) \ - ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 19 ) \ - ^ ( values_32bit[ value_32bit_index - 2 ] >> 10 ); \ -\ - values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 16 ] \ - + s0 \ - + values_32bit[ value_32bit_index - 7 ] \ - + s1 - -#define libhmac_sha224_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ) \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 16, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 17, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 18, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 19, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 20, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 21, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 22, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 23, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 24, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 25, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 26, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 27, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 28, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 29, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 30, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 31, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 32, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 33, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 34, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 35, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 36, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 37, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 38, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 39, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 40, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 41, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 42, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 43, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 44, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 45, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 46, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 47, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 48, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 49, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 50, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 51, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 52, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 53, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 54, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 55, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 56, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 57, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 58, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 59, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 60, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 61, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 62, s0, s1 ); \ - libhmac_sha224_transform_extend_32bit_value( values_32bit, 63, s0, s1 ); - -#define libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ - s0 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 2 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 13 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 22 ); \ - s1 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 6 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 11 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 25 ); \ -\ - t1 = hash_values[ hash_value_index7 ]; \ - t1 += s1; \ - t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ - ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ - t1 += libhmac_sha224_prime_cube_roots[ value_32bit_index ]; \ - t1 += values_32bit[ value_32bit_index ]; \ - t2 = s0; \ - t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ - ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ - ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ -\ - hash_values[ hash_value_index3 ] += t1; \ - hash_values[ hash_value_index7 ] = t1 + t2; - -#define libhmac_sha224_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha224_transform_unfolded_calculate_hash_value( values_32bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) - -/* Calculates the SHA-224 of 64 byte sized blocks of data in a buffer - * Returns the number of bytes used if successful or -1 on error - */ -ssize_t libhmac_sha224_transform( - libhmac_internal_sha224_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - uint32_t hash_values[ 8 ]; - uint32_t values_32bit[ 64 ]; - - static char *function = "libhmac_sha224_transform"; - uint32_t s0 = 0; - uint32_t s1 = 0; - uint32_t t1 = 0; - uint32_t t2 = 0; - size_t buffer_offset = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - uint8_t hash_values_index = 0; - uint8_t value_32bit_index = 0; -#endif - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid internal context.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - while( size >= LIBHMAC_SHA224_BLOCK_SIZE ) - { - if( memory_copy( - hash_values, - internal_context->hash_values, - sizeof( uint32_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy hash values.", - function ); - - goto on_error; - } -#if defined( LIBHMAC_UNFOLLED_LOOPS ) - /* Break the block into 16 x 32-bit values - */ - libhmac_byte_stream_copy_to_16x_uint32_big_endian( - &( buffer[ buffer_offset ] ), - values_32bit ); - - buffer_offset += LIBHMAC_SHA224_BLOCK_SIZE; - - /* Extend to 64 x 32-bit values - */ - libhmac_sha224_transform_unfolded_extend_32bit_values( - values_32bit, - s0, - s1 ); - - /* Calculate the hash values for the 32-bit values - */ - libhmac_sha224_transform_unfolded_calculate_hash_values( - values_32bit, - hash_values, - s0, - s1, - t1, - t2 ); - - /* Update the hash values in the context - */ - internal_context->hash_values[ 0 ] += hash_values[ 0 ]; - internal_context->hash_values[ 1 ] += hash_values[ 1 ]; - internal_context->hash_values[ 2 ] += hash_values[ 2 ]; - internal_context->hash_values[ 3 ] += hash_values[ 3 ]; - internal_context->hash_values[ 4 ] += hash_values[ 4 ]; - internal_context->hash_values[ 5 ] += hash_values[ 5 ]; - internal_context->hash_values[ 6 ] += hash_values[ 6 ]; - internal_context->hash_values[ 7 ] += hash_values[ 7 ]; - -#else - /* Break the block into 16 x 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 16; - value_32bit_index++ ) - { - byte_stream_copy_to_uint32_big_endian( - &( buffer[ buffer_offset ] ), - values_32bit[ value_32bit_index ] ); - - buffer_offset += sizeof( uint32_t ); - } - /* Extend to 64 x 32-bit values - */ - for( value_32bit_index = 16; - value_32bit_index < 64; - value_32bit_index++ ) - { - libhmac_sha224_transform_extend_32bit_value( - values_32bit, - value_32bit_index, - s0, - s1 ); - } - /* Calculate the hash values for the 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 64; - value_32bit_index++ ) - { - s0 = byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 2 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 13 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 22 ); - s1 = byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 6 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 11 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 25 ); - - t1 = hash_values[ 7 ]; - t1 += s1; - t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) - ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); - t1 += libhmac_sha224_prime_cube_roots[ value_32bit_index ]; - t1 += values_32bit[ value_32bit_index ]; - t2 = s0; - t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) - ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) - ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); - - hash_values[ 7 ] = hash_values[ 6 ]; - hash_values[ 6 ] = hash_values[ 5 ]; - hash_values[ 5 ] = hash_values[ 4 ]; - hash_values[ 4 ] = hash_values[ 3 ] + t1; - hash_values[ 3 ] = hash_values[ 2 ]; - hash_values[ 2 ] = hash_values[ 1 ]; - hash_values[ 1 ] = hash_values[ 0 ]; - hash_values[ 0 ] = t1 + t2; - } - /* Update the hash values in the context - */ - for( hash_values_index = 0; - hash_values_index < 8; - hash_values_index++ ) - { - internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; - } -#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - size -= LIBHMAC_SHA224_BLOCK_SIZE; - } - /* Prevent sensitive data from leaking - */ - if( memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear hash values.", - function ); - - goto on_error; - } - if( memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 64 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear 32-bit values.", - function ); - - goto on_error; - } - return( (ssize_t) buffer_offset ); - -on_error: - memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 64 ); - - memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 8 ); - - return( -1 ); -} - -#endif /* !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) */ - -/* Creates a SHA-224 context +/* Creates a SHA224 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ @@ -461,161 +36,11 @@ libhmac_sha224_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_initialize"; + static char *function = "libhmac_sha224_initialize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid context value already set.", - function ); - - return( -1 ); - } - internal_context = memory_allocate_structure( - libhmac_internal_sha224_context_t ); - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create context.", - function ); - - goto on_error; - } - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha224_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - memory_free( - internal_context ); - - return( -1 ); - } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) - /* Request the AES crypt provider, fail back to the RSA crypt provider - */ - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_AES, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create AES or RSA crypt provider.", - function ); - - goto on_error; - } - } - if( internal_context->crypt_provider == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: unable to create crypt provider.", - function ); - - goto on_error; - } - if( CryptCreateHash( - internal_context->crypt_provider, - CALG_SHA_224, - 0, - 0, - &( internal_context->hash ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create hash object.", - function ); - - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) - if( SHA224_Init( - &( internal_context->sha224_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize context.", - function ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX_init( - &( internal_context->internal_evp_md_context ) ); - - internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); -#else - internal_context->evp_md_context = EVP_MD_CTX_new(); - - if( internal_context->evp_md_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP message digest context.", - function ); - - goto on_error; - } -#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ - - if( EVP_DigestInit_ex( - internal_context->evp_md_context, - EVP_sha224(), - NULL ) != 1 ) + if( libhmac_sha224_context_initialize( + context, + error ) != 1 ) { libcerror_error_set( error, @@ -624,278 +49,29 @@ "%s: unable to initialize context.", function ); -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); -#endif - internal_context->evp_md_context = NULL; - - goto on_error; - } -#else - if( memory_copy( - internal_context->hash_values, - libhmac_sha224_prime_square_roots, - sizeof( uint32_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy initial hash values.", - function ); - return( -1 ); } -#endif - *context = (libhmac_sha224_context_t *) internal_context; - return( 1 ); - -on_error: - if( internal_context != NULL ) - { - memory_free( - internal_context ); - } - return( -1 ); } -/* Frees a SHA-224 context +/* Frees a SHA224 context * Returns 1 if successful or -1 on error */ int libhmac_sha224_free( libhmac_sha224_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_free"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); + static char *function = "libhmac_sha224_free"; - return( -1 ); - } - if( *context != NULL ) - { - internal_context = (libhmac_internal_sha224_context_t *) *context; - *context = NULL; - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) - if( internal_context->crypt_provider != 0 ) - { - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - } - if( internal_context->hash != 0 ) - { - CryptDestroyHash( - internal_context->hash ); - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) - /* No additional clean up necessary - */ - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - if( EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP message digest context.", - function ); - } - /* Make sure the error state is removed otherwise OpenSSL will leak memory - */ - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); - -#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ - - internal_context->evp_md_context = NULL; -#else - /* No additional clean up necessary - */ -#endif - memory_free( - internal_context ); - } - return( 1 ); -} - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) - -/* Updates the SHA-224 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha224_update( - libhmac_sha224_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( size == 0 ) - { - return( 1 ); - } - if( CryptHashData( - internal_context->hash, - (BYTE *) buffer, - (DWORD) size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) - -/* Updates the SHA-224 context using OpenSSL - * Returns 1 if successful or -1 on error - */ -int libhmac_sha224_update( - libhmac_sha224_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_update"; - unsigned long safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) - if( size > (size_t) ULONG_MAX ) -#else - if( size > (size_t) SSIZE_MAX ) -#endif - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - safe_hash_size = (unsigned long) size; - - if( SHA256_Update( - &( internal_context->sha224_context ), - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha224_context_free( + context, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update context.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free context.", function ); return( -1 ); @@ -903,9 +79,7 @@ return( 1 ); } -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) - -/* Updates the SHA-224 context using OpenSSL EVP +/* Updates the SHA224 context * Returns 1 if successful or -1 on error */ int libhmac_sha224_update( @@ -914,52 +88,13 @@ size_t size, libcerror_error_t **error ) { - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); + static char *function = "libhmac_sha224_update"; - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( EVP_DigestUpdate( - internal_context->evp_md_context, - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha224_context_update( + context, + buffer, + size, + error ) != 1 ) { libcerror_error_set( error, @@ -973,269 +108,7 @@ return( 1 ); } -#else - -/* Updates the SHA-224 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha224_update( - libhmac_sha224_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_update"; - size_t buffer_offset = 0; - size_t remaining_block_size = 0; - ssize_t process_count = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( internal_context->block_offset > 0 ) - { - remaining_block_size = LIBHMAC_SHA224_BLOCK_SIZE - internal_context->block_offset; - - if( remaining_block_size > size ) - { - remaining_block_size = size; - } - if( memory_copy( - &( internal_context->block[ internal_context->block_offset ] ), - buffer, - remaining_block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset += remaining_block_size; - - if( internal_context->block_offset < LIBHMAC_SHA224_BLOCK_SIZE ) - { - return( 1 ); - } - buffer_offset += remaining_block_size; - size -= remaining_block_size; - - process_count = libhmac_sha224_transform( - internal_context, - internal_context->block, - LIBHMAC_SHA224_BLOCK_SIZE, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - internal_context->block_offset = 0; - } - if( size > 0 ) - { - process_count = libhmac_sha224_transform( - internal_context, - &( buffer[ buffer_offset ] ), - size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform buffer.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - - buffer_offset += process_count; - size -= process_count; - } - if( size > 0 ) - { - if( size >= LIBHMAC_SHA224_BLOCK_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid size value out of bounds.", - function ); - - return( -1 ); - } - if( memory_copy( - internal_context->block, - &( buffer[ buffer_offset ] ), - size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy remaining data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset = size; - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) */ - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) - -/* Finalizes the SHA-224 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha224_finalize( - libhmac_sha224_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_finalize"; - DWORD safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( hash_size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (DWORD) hash_size; - - if( CryptGetHashParam( - internal_context->hash, - HP_HASHVAL, - (BYTE *) hash, - &safe_hash_size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) - -/* Finalizes the SHA-224 context using OpenSSL +/* Finalizes the SHA224 context * Returns 1 if successful or -1 on error */ int libhmac_sha224_finalize( @@ -1244,138 +117,13 @@ size_t hash_size, libcerror_error_t **error ) { - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_finalize"; + static char *function = "libhmac_sha224_finalize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - if( SHA256_Final( + if( libhmac_sha224_context_finalize( + context, hash, - &( internal_context->sha224_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) - -/* Finalizes the SHA-224 context using OpenSSL EVP - * Returns 1 if successful or -1 on error - */ -int libhmac_sha224_finalize( - libhmac_sha224_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_finalize"; - unsigned int safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) UINT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (unsigned int) hash_size; - - if( EVP_DigestFinal_ex( - internal_context->evp_md_context, - (unsigned char *) hash, - &safe_hash_size ) != 1 ) + hash_size, + error ) != 1 ) { libcerror_error_set( error, @@ -1389,201 +137,6 @@ return( 1 ); } -#else - -/* Finalizes the SHA-224 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha224_finalize( - libhmac_sha224_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha224_context_t *internal_context = NULL; - static char *function = "libhmac_sha224_finalize"; - size_t block_size = 0; - size_t number_of_blocks = 0; - ssize_t process_count = 0; - uint64_t bit_size = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - size_t hash_index = 0; - int hash_values_index = 0; -#endif - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha224_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - /* Add padding with a size of 56 mod 64 - */ - number_of_blocks = 1; - - if( internal_context->block_offset > 55 ) - { - number_of_blocks += 1; - } - block_size = number_of_blocks * LIBHMAC_SHA224_BLOCK_SIZE; - - if( memory_set( - &( internal_context->block[ internal_context->block_offset ] ), - 0, - block_size - internal_context->block_offset ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context block.", - function ); - - return( -1 ); - } - /* The first byte of the padding contains 0x80 - */ - internal_context->block[ internal_context->block_offset ] = 0x80; - - bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; - - byte_stream_copy_from_uint64_big_endian( - &( internal_context->block[ block_size - 8 ] ), - bit_size ); - - process_count = libhmac_sha224_transform( - internal_context, - internal_context->block, - block_size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } - /* Note that hash_values[ 7 ] is omitted from the hash */ -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - for( hash_values_index = 0; - hash_values_index < 7; - hash_values_index++ ) - { - byte_stream_copy_from_uint32_big_endian( - &( hash[ hash_index ] ), - internal_context->hash_values[ hash_values_index ] ); - - hash_index += sizeof( uint32_t ); - } -#else - byte_stream_copy_from_uint32_big_endian( - &( hash[ 0 ] ), - internal_context->hash_values[ 0 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 4 ] ), - internal_context->hash_values[ 1 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 8 ] ), - internal_context->hash_values[ 2 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 12 ] ), - internal_context->hash_values[ 3 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 16 ] ), - internal_context->hash_values[ 4 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 20 ] ), - internal_context->hash_values[ 5 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 24 ] ), - internal_context->hash_values[ 6 ] ); - -#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - /* Prevent sensitive data from leaking - */ - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha224_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_224 ) */ - /* Calculates the SHA-224 of the buffer * Returns 1 if successful or -1 on error */ @@ -1597,7 +150,7 @@ libhmac_sha224_context_t *context = NULL; static char *function = "libhmac_sha224_calculate"; - if( libhmac_sha224_initialize( + if( libhmac_sha224_context_initialize( &context, error ) != 1 ) { @@ -1610,7 +163,7 @@ goto on_error; } - if( libhmac_sha224_update( + if( libhmac_sha224_context_update( context, buffer, size, @@ -1625,7 +178,7 @@ goto on_error; } - if( libhmac_sha224_finalize( + if( libhmac_sha224_context_finalize( context, hash, hash_size, @@ -1640,7 +193,7 @@ goto on_error; } - if( libhmac_sha224_free( + if( libhmac_sha224_context_free( &context, error ) != 1 ) { @@ -1658,7 +211,7 @@ on_error: if( context != NULL ) { - libhmac_sha224_free( + libhmac_sha224_context_free( &context, NULL ); } @@ -1768,7 +321,7 @@ } else { - if( libhmac_sha224_initialize( + if( libhmac_sha224_context_initialize( &context, error ) != 1 ) { @@ -1781,7 +334,7 @@ goto on_error; } - if( libhmac_sha224_update( + if( libhmac_sha224_context_update( context, key, key_size, @@ -1796,7 +349,7 @@ goto on_error; } - if( libhmac_sha224_finalize( + if( libhmac_sha224_context_finalize( context, key_hash, LIBHMAC_SHA224_HASH_SIZE, @@ -1811,7 +364,7 @@ goto on_error; } - if( libhmac_sha224_free( + if( libhmac_sha224_context_free( &context, error ) != 1 ) { @@ -1919,7 +472,7 @@ inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } - if( libhmac_sha224_initialize( + if( libhmac_sha224_context_initialize( &context, error ) != 1 ) { @@ -1932,7 +485,7 @@ goto on_error; } - if( libhmac_sha224_update( + if( libhmac_sha224_context_update( context, inner_padding, block_size, @@ -1947,7 +500,7 @@ goto on_error; } - if( libhmac_sha224_update( + if( libhmac_sha224_context_update( context, buffer, size, @@ -1962,7 +515,7 @@ goto on_error; } - if( libhmac_sha224_finalize( + if( libhmac_sha224_context_finalize( context, hmac, hmac_size, @@ -1977,7 +530,7 @@ goto on_error; } - if( libhmac_sha224_free( + if( libhmac_sha224_context_free( &context, error ) != 1 ) { @@ -1990,7 +543,7 @@ goto on_error; } - if( libhmac_sha224_initialize( + if( libhmac_sha224_context_initialize( &context, error ) != 1 ) { @@ -2003,7 +556,7 @@ goto on_error; } - if( libhmac_sha224_update( + if( libhmac_sha224_context_update( context, outer_padding, block_size, @@ -2018,7 +571,7 @@ goto on_error; } - if( libhmac_sha224_update( + if( libhmac_sha224_context_update( context, hmac, LIBHMAC_SHA224_HASH_SIZE, @@ -2033,7 +586,7 @@ goto on_error; } - if( libhmac_sha224_finalize( + if( libhmac_sha224_context_finalize( context, hmac, hmac_size, @@ -2048,7 +601,7 @@ goto on_error; } - if( libhmac_sha224_free( + if( libhmac_sha224_context_free( &context, error ) != 1 ) { @@ -2123,7 +676,7 @@ on_error: if( context != NULL ) { - libhmac_sha224_free( + libhmac_sha224_context_free( &context, NULL ); } diff -Nru libbde-20190102/libhmac/libhmac_sha224.h libbde-20240223/libhmac/libhmac_sha224.h --- libbde-20190102/libhmac/libhmac_sha224.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha224.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * SHA-224 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_SHA224_H ) @@ -25,17 +25,6 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include - -#endif - #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" @@ -44,80 +33,6 @@ extern "C" { #endif -/* Make sure the WINAPI version is Vista or later otherwise - * a cross compilation will contain broken SHA-224 support - */ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) -#define LIBHMAC_HAVE_SHA224_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) -#define LIBHMAC_HAVE_SHA224_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) -#define LIBHMAC_HAVE_SHA224_SUPPORT - -#endif - -#if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) -#define LIBHMAC_SHA224_BLOCK_SIZE 64 -#endif - -typedef struct libhmac_internal_sha224_context libhmac_internal_sha224_context_t; - -struct libhmac_internal_sha224_context -{ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) - /* The crypto provider handle - */ - HCRYPTPROV crypt_provider; - - /* The crypto hash handle - */ - HCRYPTHASH hash; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) - /* The SHA-224 functions use the SHA-256 context - */ - SHA256_CTX sha224_context; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) - /* The EVP message digest context - */ -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX internal_evp_md_context; -#endif - - EVP_MD_CTX *evp_md_context; - -#else - /* The number of bytes hashed - */ - uint64_t hash_count; - - /* The 32-bit hash values - */ - uint32_t hash_values[ 8 ]; - - /* The block offset - */ - size_t block_offset; - - /* The (data) block - */ - uint8_t block[ 128 ]; -#endif -}; - -#if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) - -ssize_t libhmac_sha224_transform( - libhmac_internal_sha224_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ); - -#endif /* !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) */ - LIBHMAC_EXTERN \ int libhmac_sha224_initialize( libhmac_sha224_context_t **context, diff -Nru libbde-20190102/libhmac/libhmac_sha224_context.c libbde-20240223/libhmac/libhmac_sha224_context.c --- libbde-20190102/libhmac/libhmac_sha224_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha224_context.c 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,1348 @@ +/* + * SHA-224 functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#include +#endif + +#include "libhmac_byte_stream.h" +#include "libhmac_definitions.h" +#include "libhmac_libcerror.h" +#include "libhmac_sha224_context.h" + +#if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) + +/* FIPS 180-2 based SHA-224 functions + */ + +/* The first 32-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] + */ +uint32_t libhmac_sha224_context_prime_square_roots[ 8 ] = { + 0xc1059ed8UL, 0x367cd507UL, 0x3070dd17UL, 0xf70e5939UL, + 0xffc00b31UL, 0x68581511UL, 0x64f98fa7UL, 0xbefa4fa4UL +}; + +/* The first 32-bits of the fractional parts of the cube roots of the first 64 primes [ 2, 311 ] + */ +uint32_t libhmac_sha224_context_prime_cube_roots[ 64 ] = { + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, + 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, + 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, + 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, + 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, + 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, + 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, + 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, + 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, + 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, + 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, + 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, + 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL +}; + +#define libhmac_sha224_context_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ) \ + s0 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 7 ) \ + ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 18 ) \ + ^ ( values_32bit[ value_32bit_index - 15 ] >> 3 ); \ + s1 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 17 ) \ + ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 19 ) \ + ^ ( values_32bit[ value_32bit_index - 2 ] >> 10 ); \ +\ + values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 16 ] \ + + s0 \ + + values_32bit[ value_32bit_index - 7 ] \ + + s1 + +#define libhmac_sha224_context_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ) \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 16, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 17, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 18, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 19, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 20, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 21, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 22, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 23, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 24, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 25, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 26, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 27, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 28, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 29, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 30, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 31, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 32, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 33, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 34, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 35, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 36, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 37, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 38, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 39, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 40, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 41, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 42, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 43, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 44, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 45, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 46, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 47, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 48, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 49, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 50, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 51, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 52, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 53, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 54, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 55, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 56, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 57, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 58, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 59, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 60, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 61, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 62, s0, s1 ); \ + libhmac_sha224_context_transform_extend_32bit_value( values_32bit, 63, s0, s1 ); + +#define libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ + s0 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 2 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 13 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 22 ); \ + s1 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 6 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 11 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 25 ); \ +\ + t1 = hash_values[ hash_value_index7 ]; \ + t1 += s1; \ + t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ + ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ + t1 += libhmac_sha224_context_prime_cube_roots[ value_32bit_index ]; \ + t1 += values_32bit[ value_32bit_index ]; \ + t2 = s0; \ + t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ + ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ + ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ +\ + hash_values[ hash_value_index3 ] += t1; \ + hash_values[ hash_value_index7 ] = t1 + t2; + +#define libhmac_sha224_context_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha224_context_transform_unfolded_calculate_hash_value( values_32bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) + +/* Calculates the SHA-224 of 64 byte sized blocks of data in a buffer + * Returns the number of bytes used if successful or -1 on error + */ +ssize_t libhmac_sha224_context_transform( + libhmac_internal_sha224_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + uint32_t hash_values[ 8 ]; + uint32_t values_32bit[ 64 ]; + + static char *function = "libhmac_sha224_context_transform"; + uint32_t s0 = 0; + uint32_t s1 = 0; + uint32_t t1 = 0; + uint32_t t2 = 0; + size_t buffer_offset = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + uint8_t hash_values_index = 0; + uint8_t value_32bit_index = 0; +#endif + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid internal context.", + function ); + + return( -1 ); + } + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + while( size >= LIBHMAC_SHA224_BLOCK_SIZE ) + { + if( memory_copy( + hash_values, + internal_context->hash_values, + sizeof( uint32_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy hash values.", + function ); + + goto on_error; + } +#if defined( LIBHMAC_UNFOLLED_LOOPS ) + /* Break the block into 16 x 32-bit values + */ + libhmac_byte_stream_copy_to_16x_uint32_big_endian( + &( buffer[ buffer_offset ] ), + values_32bit ); + + buffer_offset += LIBHMAC_SHA224_BLOCK_SIZE; + + /* Extend to 64 x 32-bit values + */ + libhmac_sha224_context_transform_unfolded_extend_32bit_values( + values_32bit, + s0, + s1 ); + + /* Calculate the hash values for the 32-bit values + */ + libhmac_sha224_context_transform_unfolded_calculate_hash_values( + values_32bit, + hash_values, + s0, + s1, + t1, + t2 ); + + /* Update the hash values in the context + */ + internal_context->hash_values[ 0 ] += hash_values[ 0 ]; + internal_context->hash_values[ 1 ] += hash_values[ 1 ]; + internal_context->hash_values[ 2 ] += hash_values[ 2 ]; + internal_context->hash_values[ 3 ] += hash_values[ 3 ]; + internal_context->hash_values[ 4 ] += hash_values[ 4 ]; + internal_context->hash_values[ 5 ] += hash_values[ 5 ]; + internal_context->hash_values[ 6 ] += hash_values[ 6 ]; + internal_context->hash_values[ 7 ] += hash_values[ 7 ]; + +#else + /* Break the block into 16 x 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 16; + value_32bit_index++ ) + { + byte_stream_copy_to_uint32_big_endian( + &( buffer[ buffer_offset ] ), + values_32bit[ value_32bit_index ] ); + + buffer_offset += sizeof( uint32_t ); + } + /* Extend to 64 x 32-bit values + */ + for( value_32bit_index = 16; + value_32bit_index < 64; + value_32bit_index++ ) + { + libhmac_sha224_context_transform_extend_32bit_value( + values_32bit, + value_32bit_index, + s0, + s1 ); + } + /* Calculate the hash values for the 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 64; + value_32bit_index++ ) + { + s0 = byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 2 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 13 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 22 ); + s1 = byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 6 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 11 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 25 ); + + t1 = hash_values[ 7 ]; + t1 += s1; + t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) + ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); + t1 += libhmac_sha224_context_prime_cube_roots[ value_32bit_index ]; + t1 += values_32bit[ value_32bit_index ]; + t2 = s0; + t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) + ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) + ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); + + hash_values[ 7 ] = hash_values[ 6 ]; + hash_values[ 6 ] = hash_values[ 5 ]; + hash_values[ 5 ] = hash_values[ 4 ]; + hash_values[ 4 ] = hash_values[ 3 ] + t1; + hash_values[ 3 ] = hash_values[ 2 ]; + hash_values[ 2 ] = hash_values[ 1 ]; + hash_values[ 1 ] = hash_values[ 0 ]; + hash_values[ 0 ] = t1 + t2; + } + /* Update the hash values in the context + */ + for( hash_values_index = 0; + hash_values_index < 8; + hash_values_index++ ) + { + internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; + } +#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + size -= LIBHMAC_SHA224_BLOCK_SIZE; + } + /* Prevent sensitive data from leaking + */ + if( memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear hash values.", + function ); + + goto on_error; + } + if( memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 64 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear 32-bit values.", + function ); + + goto on_error; + } + return( (ssize_t) buffer_offset ); + +on_error: + memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 64 ); + + memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 8 ); + + return( -1 ); +} + +#endif /* !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) */ + +/* Creates a SHA-224 context + * Make sure the value context is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_initialize( + libhmac_sha224_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_initialize"; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) + const EVP_MD *evp_md_type = NULL; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid context value already set.", + function ); + + return( -1 ); + } + internal_context = memory_allocate_structure( + libhmac_internal_sha224_context_t ); + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create context.", + function ); + + goto on_error; + } + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha224_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + memory_free( + internal_context ); + + return( -1 ); + } +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) + if( SHA224_Init( + &( internal_context->sha224_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + + goto on_error; + } + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX_init( + &( internal_context->internal_evp_md_context ) ); + + internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); +#else + internal_context->evp_md_context = EVP_MD_CTX_new(); + + if( internal_context->evp_md_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP message digest context.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ + +/* TODO use EVP_MD_fetch for EVP_DigestInit_ex2 */ + evp_md_type = EVP_sha224(); + +#if defined( HAVE_EVP_DIGESTINIT_EX2 ) + if( EVP_DigestInit_ex2( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#else + if( EVP_DigestInit_ex( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ); + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); +#endif + internal_context->evp_md_context = NULL; + + goto on_error; + } +#else + if( memory_copy( + internal_context->hash_values, + libhmac_sha224_context_prime_square_roots, + sizeof( uint32_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy initial hash values.", + function ); + + return( -1 ); + } +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) */ + + *context = (libhmac_sha224_context_t *) internal_context; + + return( 1 ); + +on_error: + if( internal_context != NULL ) + { + memory_free( + internal_context ); + } + return( -1 ); +} + +/* Frees a SHA-224 context + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_free( + libhmac_sha224_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_free"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + internal_context = (libhmac_internal_sha224_context_t *) *context; + *context = NULL; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) + /* No additional clean up necessary + */ + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + if( EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to clean up EVP message digest context.", + function ); + } + /* Make sure the error state is removed otherwise OpenSSL will leak memory + */ + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); + +#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ + + internal_context->evp_md_context = NULL; +#else + /* No additional clean up necessary + */ +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) */ + + memory_free( + internal_context ); + } + return( 1 ); +} + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) + +/* Updates the SHA-224 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_update( + libhmac_sha224_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_update"; + unsigned long safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha224_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } +#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) + if( size > (size_t) ULONG_MAX ) +#else + if( size > (size_t) SSIZE_MAX ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + safe_hash_size = (unsigned long) size; + + if( SHA256_Update( + &( internal_context->sha224_context ), + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) + +/* Updates the SHA-224 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_update( + libhmac_sha224_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_update"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha224_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( EVP_DigestUpdate( + internal_context->evp_md_context, + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Updates the SHA-224 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_update( + libhmac_sha224_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_update"; + size_t buffer_offset = 0; + size_t remaining_block_size = 0; + ssize_t process_count = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha224_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( internal_context->block_offset > 0 ) + { + if( internal_context->block_offset >= LIBHMAC_SHA224_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid context - block offset value out of bounds.", + function ); + + return( -1 ); + } + remaining_block_size = LIBHMAC_SHA224_BLOCK_SIZE - internal_context->block_offset; + + if( remaining_block_size > size ) + { + remaining_block_size = size; + } + if( memory_copy( + &( internal_context->block[ internal_context->block_offset ] ), + buffer, + remaining_block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset += remaining_block_size; + + if( internal_context->block_offset < LIBHMAC_SHA224_BLOCK_SIZE ) + { + return( 1 ); + } + buffer_offset += remaining_block_size; + size -= remaining_block_size; + + process_count = libhmac_sha224_context_transform( + internal_context, + internal_context->block, + LIBHMAC_SHA224_BLOCK_SIZE, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + internal_context->block_offset = 0; + } + if( size > 0 ) + { + process_count = libhmac_sha224_context_transform( + internal_context, + &( buffer[ buffer_offset ] ), + size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform buffer.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + + buffer_offset += process_count; + size -= process_count; + } + if( size > 0 ) + { + if( size >= LIBHMAC_SHA224_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid size value out of bounds.", + function ); + + return( -1 ); + } + if( memory_copy( + internal_context->block, + &( buffer[ buffer_offset ] ), + size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy remaining data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset = size; + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) */ + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) + +/* Finalizes the SHA-224 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_finalize( + libhmac_sha224_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_finalize"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha224_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + if( SHA256_Final( + hash, + &( internal_context->sha224_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) + +/* Finalizes the SHA-224 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_finalize( + libhmac_sha224_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_finalize"; + unsigned int safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha224_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( ( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) + || ( hash_size > (size_t) UINT_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid hash size value out of bounds.", + function ); + + return( -1 ); + } + safe_hash_size = (unsigned int) hash_size; + + if( EVP_DigestFinal_ex( + internal_context->evp_md_context, + (unsigned char *) hash, + &safe_hash_size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Finalizes the SHA-224 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha224_context_finalize( + libhmac_sha224_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha224_context_t *internal_context = NULL; + static char *function = "libhmac_sha224_context_finalize"; + size_t block_size = 0; + size_t number_of_blocks = 0; + ssize_t process_count = 0; + uint64_t bit_size = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + size_t hash_index = 0; + int hash_values_index = 0; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha224_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash value too small.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + /* Add padding with a size of 56 mod 64 + */ + number_of_blocks = 1; + + if( internal_context->block_offset > 55 ) + { + number_of_blocks += 1; + } + block_size = number_of_blocks * LIBHMAC_SHA224_BLOCK_SIZE; + + if( memory_set( + &( internal_context->block[ internal_context->block_offset ] ), + 0, + block_size - internal_context->block_offset ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context block.", + function ); + + return( -1 ); + } + /* The first byte of the padding contains 0x80 + */ + internal_context->block[ internal_context->block_offset ] = 0x80; + + bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; + + byte_stream_copy_from_uint64_big_endian( + &( internal_context->block[ block_size - 8 ] ), + bit_size ); + + process_count = libhmac_sha224_context_transform( + internal_context, + internal_context->block, + block_size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } + /* Note that hash_values[ 7 ] is omitted from the hash */ +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + for( hash_values_index = 0; + hash_values_index < 7; + hash_values_index++ ) + { + byte_stream_copy_from_uint32_big_endian( + &( hash[ hash_index ] ), + internal_context->hash_values[ hash_values_index ] ); + + hash_index += sizeof( uint32_t ); + } +#else + byte_stream_copy_from_uint32_big_endian( + &( hash[ 0 ] ), + internal_context->hash_values[ 0 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 4 ] ), + internal_context->hash_values[ 1 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 8 ] ), + internal_context->hash_values[ 2 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 12 ] ), + internal_context->hash_values[ 3 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 16 ] ), + internal_context->hash_values[ 4 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 20 ] ), + internal_context->hash_values[ 5 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 24 ] ), + internal_context->hash_values[ 6 ] ); + +#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + /* Prevent sensitive data from leaking + */ + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha224_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha224_context.h libbde-20240223/libhmac/libhmac_sha224_context.h --- libbde-20190102/libhmac/libhmac_sha224_context.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha224_context.h 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * SHA-224 functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBHMAC_SHA224_CONTEXT_H ) +#define _LIBHMAC_SHA224_CONTEXT_H + +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#endif + +#include "libhmac_extern.h" +#include "libhmac_libcerror.h" +#include "libhmac_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) +#define LIBHMAC_HAVE_SHA224_SUPPORT + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) +#define LIBHMAC_HAVE_SHA224_SUPPORT + +#endif + +#define LIBHMAC_SHA224_BLOCK_SIZE 64 + +typedef struct libhmac_internal_sha224_context libhmac_internal_sha224_context_t; + +struct libhmac_internal_sha224_context +{ +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) + /* The SHA-224 functions use the SHA-256 context + */ + SHA256_CTX sha224_context; + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) + /* The EVP message digest context + */ +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX internal_evp_md_context; +#endif + + EVP_MD_CTX *evp_md_context; + +#else + /* The number of bytes hashed + */ + uint64_t hash_count; + + /* The 32-bit hash values + */ + uint32_t hash_values[ 8 ]; + + /* The block offset + */ + size_t block_offset; + + /* The (data) block + */ + uint8_t block[ 2 * LIBHMAC_SHA224_BLOCK_SIZE ]; + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) */ +}; + +#if !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) + +ssize_t libhmac_sha224_context_transform( + libhmac_internal_sha224_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +#endif /* !defined( LIBHMAC_HAVE_SHA224_SUPPORT ) */ + +LIBHMAC_EXTERN \ +int libhmac_sha224_context_initialize( + libhmac_sha224_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha224_context_free( + libhmac_sha224_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha224_context_update( + libhmac_sha224_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha224_context_finalize( + libhmac_sha224_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBHMAC_SHA224_CONTEXT_H ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha256.c libbde-20240223/libhmac/libhmac_sha256.c --- libbde-20190102/libhmac/libhmac_sha256.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha256.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,459 +1,34 @@ /* * SHA-256 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include -#include #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include -#include - -#endif - -#include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha256.h" +#include "libhmac_sha256_context.h" -#if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) - -/* FIPS 180-2 based SHA-256 functions - */ - -/* The first 32-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] - */ -uint32_t libhmac_sha256_prime_square_roots[ 8 ] = { - 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, - 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL -}; - -/* The first 32-bits of the fractional parts of the cube roots of the first 64 primes [ 2, 311 ] - */ -uint32_t libhmac_sha256_prime_cube_roots[ 64 ] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -#define libhmac_sha256_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ) \ - s0 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 7 ) \ - ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 18 ) \ - ^ ( values_32bit[ value_32bit_index - 15 ] >> 3 ); \ - s1 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 17 ) \ - ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 19 ) \ - ^ ( values_32bit[ value_32bit_index - 2 ] >> 10 ); \ -\ - values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 16 ] \ - + s0 \ - + values_32bit[ value_32bit_index - 7 ] \ - + s1 - -#define libhmac_sha256_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ) \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 16, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 17, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 18, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 19, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 20, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 21, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 22, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 23, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 24, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 25, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 26, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 27, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 28, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 29, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 30, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 31, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 32, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 33, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 34, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 35, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 36, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 37, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 38, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 39, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 40, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 41, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 42, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 43, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 44, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 45, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 46, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 47, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 48, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 49, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 50, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 51, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 52, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 53, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 54, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 55, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 56, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 57, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 58, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 59, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 60, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 61, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 62, s0, s1 ); \ - libhmac_sha256_transform_extend_32bit_value( values_32bit, 63, s0, s1 ); - -#define libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ - s0 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 2 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 13 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 22 ); \ - s1 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 6 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 11 ) \ - ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 25 ); \ -\ - t1 = hash_values[ hash_value_index7 ]; \ - t1 += s1; \ - t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ - ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ - t1 += libhmac_sha256_prime_cube_roots[ value_32bit_index ]; \ - t1 += values_32bit[ value_32bit_index ]; \ - t2 = s0; \ - t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ - ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ - ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ -\ - hash_values[ hash_value_index3 ] += t1; \ - hash_values[ hash_value_index7 ] = t1 + t2; - -#define libhmac_sha256_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha256_transform_unfolded_calculate_hash_value( values_32bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) - -/* Calculates the SHA-256 of 64 byte sized blocks of data in a buffer - * Returns the number of bytes used if successful or -1 on error - */ -ssize_t libhmac_sha256_transform( - libhmac_internal_sha256_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - uint32_t hash_values[ 8 ]; - uint32_t values_32bit[ 64 ]; - - static char *function = "libhmac_sha256_transform"; - size_t buffer_offset = 0; - uint32_t s0 = 0; - uint32_t s1 = 0; - uint32_t t1 = 0; - uint32_t t2 = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - uint8_t hash_values_index = 0; - uint8_t value_32bit_index = 0; -#endif - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid internal context.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - while( size >= LIBHMAC_SHA256_BLOCK_SIZE ) - { - if( memory_copy( - hash_values, - internal_context->hash_values, - sizeof( uint32_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy hash values.", - function ); - - goto on_error; - } -#if defined( LIBHMAC_UNFOLLED_LOOPS ) - /* Break the block into 16 x 32-bit values - */ - libhmac_byte_stream_copy_to_16x_uint32_big_endian( - &( buffer[ buffer_offset ] ), - values_32bit ); - - buffer_offset += LIBHMAC_SHA256_BLOCK_SIZE; - - /* Extend to 64 x 32-bit values - */ - libhmac_sha256_transform_unfolded_extend_32bit_values( - values_32bit, - s0, - s1 ); - - /* Calculate the hash values for the 32-bit values - */ - libhmac_sha256_transform_unfolded_calculate_hash_values( - values_32bit, - hash_values, - s0, - s1, - t1, - t2 ); - - /* Update the hash values in the context - */ - internal_context->hash_values[ 0 ] += hash_values[ 0 ]; - internal_context->hash_values[ 1 ] += hash_values[ 1 ]; - internal_context->hash_values[ 2 ] += hash_values[ 2 ]; - internal_context->hash_values[ 3 ] += hash_values[ 3 ]; - internal_context->hash_values[ 4 ] += hash_values[ 4 ]; - internal_context->hash_values[ 5 ] += hash_values[ 5 ]; - internal_context->hash_values[ 6 ] += hash_values[ 6 ]; - internal_context->hash_values[ 7 ] += hash_values[ 7 ]; - -#else - /* Break the block into 16 x 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 16; - value_32bit_index++ ) - { - byte_stream_copy_to_uint32_big_endian( - &( buffer[ buffer_offset ] ), - values_32bit[ value_32bit_index ] ); - - buffer_offset += sizeof( uint32_t ); - } - /* Extend to 64 x 32-bit values - */ - for( value_32bit_index = 16; - value_32bit_index < 64; - value_32bit_index++ ) - { - libhmac_sha256_transform_extend_32bit_value( - values_32bit, - value_32bit_index, - s0, - s1 ); - } - /* Calculate the hash values for the 32-bit values - */ - for( value_32bit_index = 0; - value_32bit_index < 64; - value_32bit_index++ ) - { - s0 = byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 2 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 13 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 22 ); - s1 = byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 6 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 11 ) - ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 25 ); - - t1 = hash_values[ 7 ]; - t1 += s1; - t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) - ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); - t1 += libhmac_sha256_prime_cube_roots[ value_32bit_index ]; - t1 += values_32bit[ value_32bit_index ]; - t2 = s0; - t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) - ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) - ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); - - hash_values[ 7 ] = hash_values[ 6 ]; - hash_values[ 6 ] = hash_values[ 5 ]; - hash_values[ 5 ] = hash_values[ 4 ]; - hash_values[ 4 ] = hash_values[ 3 ] + t1; - hash_values[ 3 ] = hash_values[ 2 ]; - hash_values[ 2 ] = hash_values[ 1 ]; - hash_values[ 1 ] = hash_values[ 0 ]; - hash_values[ 0 ] = t1 + t2; - } - /* Update the hash values in the context - */ - for( hash_values_index = 0; - hash_values_index < 8; - hash_values_index++ ) - { - internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; - } -#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - size -= LIBHMAC_SHA256_BLOCK_SIZE; - } - /* Prevent sensitive data from leaking - */ - if( memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear hash values.", - function ); - - goto on_error; - } - if( memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 64 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear 32-bit values.", - function ); - - goto on_error; - } - return( (ssize_t) buffer_offset ); - -on_error: - memory_set( - values_32bit, - 0, - sizeof( uint32_t ) * 64 ); - - memory_set( - hash_values, - 0, - sizeof( uint32_t ) * 8 ); - - return( -1 ); -} - -#endif /* !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) */ - -/* Creates a SHA-256 context +/* Creates a SHA256 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ @@ -461,161 +36,11 @@ libhmac_sha256_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_initialize"; + static char *function = "libhmac_sha256_initialize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid context value already set.", - function ); - - return( -1 ); - } - internal_context = memory_allocate_structure( - libhmac_internal_sha256_context_t ); - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create context.", - function ); - - goto on_error; - } - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha256_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - memory_free( - internal_context ); - - return( -1 ); - } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) - /* Request the AES crypt provider, fail back to the RSA crypt provider - */ - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_AES, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create AES or RSA crypt provider.", - function ); - - goto on_error; - } - } - if( internal_context->crypt_provider == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: unable to create crypt provider.", - function ); - - goto on_error; - } - if( CryptCreateHash( - internal_context->crypt_provider, - CALG_SHA_256, - 0, - 0, - &( internal_context->hash ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create hash object.", - function ); - - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) - if( SHA256_Init( - &( internal_context->sha256_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize context.", - function ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX_init( - &( internal_context->internal_evp_md_context ) ); - - internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); -#else - internal_context->evp_md_context = EVP_MD_CTX_new(); - - if( internal_context->evp_md_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP message digest context.", - function ); - - goto on_error; - } -#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ - - if( EVP_DigestInit_ex( - internal_context->evp_md_context, - EVP_sha256(), - NULL ) != 1 ) + if( libhmac_sha256_context_initialize( + context, + error ) != 1 ) { libcerror_error_set( error, @@ -624,278 +49,29 @@ "%s: unable to initialize context.", function ); -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); -#endif - internal_context->evp_md_context = NULL; - - goto on_error; - } -#else - if( memory_copy( - internal_context->hash_values, - libhmac_sha256_prime_square_roots, - sizeof( uint32_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy initial hash values.", - function ); - return( -1 ); } -#endif - *context = (libhmac_sha256_context_t *) internal_context; - return( 1 ); - -on_error: - if( internal_context != NULL ) - { - memory_free( - internal_context ); - } - return( -1 ); } -/* Frees a SHA-256 context +/* Frees a SHA256 context * Returns 1 if successful or -1 on error */ int libhmac_sha256_free( libhmac_sha256_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_free"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); + static char *function = "libhmac_sha256_free"; - return( -1 ); - } - if( *context != NULL ) - { - internal_context = (libhmac_internal_sha256_context_t *) *context; - *context = NULL; - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) - if( internal_context->crypt_provider != 0 ) - { - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - } - if( internal_context->hash != 0 ) - { - CryptDestroyHash( - internal_context->hash ); - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) - /* No additional clean up necessary - */ - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - if( EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP message digest context.", - function ); - } - /* Make sure the error state is removed otherwise OpenSSL will leak memory - */ - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); - -#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ - - internal_context->evp_md_context = NULL; -#else - /* No additional clean up necessary - */ -#endif - memory_free( - internal_context ); - } - return( 1 ); -} - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) - -/* Updates the SHA-256 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha256_update( - libhmac_sha256_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( size == 0 ) - { - return( 1 ); - } - if( CryptHashData( - internal_context->hash, - (BYTE *) buffer, - (DWORD) size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) - -/* Updates the SHA-256 context using OpenSSL - * Returns 1 if successful or -1 on error - */ -int libhmac_sha256_update( - libhmac_sha256_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_update"; - unsigned long safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) - if( size > (size_t) ULONG_MAX ) -#else - if( size > (size_t) SSIZE_MAX ) -#endif - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - safe_hash_size = (unsigned long) size; - - if( SHA256_Update( - &( internal_context->sha256_context ), - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha256_context_free( + context, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update context.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free context.", function ); return( -1 ); @@ -903,9 +79,7 @@ return( 1 ); } -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) - -/* Updates the SHA-256 context using OpenSSL EVP +/* Updates the SHA256 context * Returns 1 if successful or -1 on error */ int libhmac_sha256_update( @@ -914,52 +88,13 @@ size_t size, libcerror_error_t **error ) { - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); + static char *function = "libhmac_sha256_update"; - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( EVP_DigestUpdate( - internal_context->evp_md_context, - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha256_context_update( + context, + buffer, + size, + error ) != 1 ) { libcerror_error_set( error, @@ -973,269 +108,7 @@ return( 1 ); } -#else - -/* Updates the SHA-256 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha256_update( - libhmac_sha256_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_update"; - size_t buffer_offset = 0; - size_t remaining_block_size = 0; - ssize_t process_count = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( internal_context->block_offset > 0 ) - { - remaining_block_size = LIBHMAC_SHA256_BLOCK_SIZE - internal_context->block_offset; - - if( remaining_block_size > size ) - { - remaining_block_size = size; - } - if( memory_copy( - &( internal_context->block[ internal_context->block_offset ] ), - buffer, - remaining_block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset += remaining_block_size; - - if( internal_context->block_offset < LIBHMAC_SHA256_BLOCK_SIZE ) - { - return( 1 ); - } - buffer_offset += remaining_block_size; - size -= remaining_block_size; - - process_count = libhmac_sha256_transform( - internal_context, - internal_context->block, - LIBHMAC_SHA256_BLOCK_SIZE, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - internal_context->block_offset = 0; - } - if( size > 0 ) - { - process_count = libhmac_sha256_transform( - internal_context, - &( buffer[ buffer_offset ] ), - size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform buffer.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - - buffer_offset += process_count; - size -= process_count; - } - if( size > 0 ) - { - if( size >= LIBHMAC_SHA256_BLOCK_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid size value out of bounds.", - function ); - - return( -1 ); - } - if( memory_copy( - internal_context->block, - &( buffer[ buffer_offset ] ), - size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy remaining data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset = size; - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) */ - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) - -/* Finalizes the SHA-256 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha256_finalize( - libhmac_sha256_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_finalize"; - DWORD safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( hash_size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (DWORD) hash_size; - - if( CryptGetHashParam( - internal_context->hash, - HP_HASHVAL, - (BYTE *) hash, - &safe_hash_size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) - -/* Finalizes the SHA-256 context using OpenSSL +/* Finalizes the SHA256 context * Returns 1 if successful or -1 on error */ int libhmac_sha256_finalize( @@ -1244,138 +117,13 @@ size_t hash_size, libcerror_error_t **error ) { - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_finalize"; + static char *function = "libhmac_sha256_finalize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - if( SHA256_Final( + if( libhmac_sha256_context_finalize( + context, hash, - &( internal_context->sha256_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) - -/* Finalizes the SHA-256 context using OpenSSL EVP - * Returns 1 if successful or -1 on error - */ -int libhmac_sha256_finalize( - libhmac_sha256_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_finalize"; - unsigned int safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) UINT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (unsigned int) hash_size; - - if( EVP_DigestFinal_ex( - internal_context->evp_md_context, - (unsigned char *) hash, - &safe_hash_size ) != 1 ) + hash_size, + error ) != 1 ) { libcerror_error_set( error, @@ -1389,204 +137,6 @@ return( 1 ); } -#else - -/* Finalizes the SHA-256 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha256_finalize( - libhmac_sha256_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha256_context_t *internal_context = NULL; - static char *function = "libhmac_sha256_finalize"; - size_t block_size = 0; - size_t number_of_blocks = 0; - ssize_t process_count = 0; - uint64_t bit_size = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - size_t hash_index = 0; - int hash_values_index = 0; -#endif - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha256_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - /* Add padding with a size of 56 mod 64 - */ - number_of_blocks = 1; - - if( internal_context->block_offset > 55 ) - { - number_of_blocks += 1; - } - block_size = number_of_blocks * LIBHMAC_SHA256_BLOCK_SIZE; - - if( memory_set( - &( internal_context->block[ internal_context->block_offset ] ), - 0, - block_size - internal_context->block_offset ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context block.", - function ); - - return( -1 ); - } - /* The first byte of the padding contains 0x80 - */ - internal_context->block[ internal_context->block_offset ] = 0x80; - - bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; - - byte_stream_copy_from_uint64_big_endian( - &( internal_context->block[ block_size - 8 ] ), - bit_size ); - - process_count = libhmac_sha256_transform( - internal_context, - internal_context->block, - block_size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - for( hash_values_index = 0; - hash_values_index < 8; - hash_values_index++ ) - { - byte_stream_copy_from_uint32_big_endian( - &( hash[ hash_index ] ), - internal_context->hash_values[ hash_values_index ] ); - - hash_index += sizeof( uint32_t ); - } -#else - byte_stream_copy_from_uint32_big_endian( - &( hash[ 0 ] ), - internal_context->hash_values[ 0 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 4 ] ), - internal_context->hash_values[ 1 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 8 ] ), - internal_context->hash_values[ 2 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 12 ] ), - internal_context->hash_values[ 3 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 16 ] ), - internal_context->hash_values[ 4 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 20 ] ), - internal_context->hash_values[ 5 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 24 ] ), - internal_context->hash_values[ 6 ] ); - - byte_stream_copy_from_uint32_big_endian( - &( hash[ 28 ] ), - internal_context->hash_values[ 7 ] ); - -#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - /* Prevent sensitive data from leaking - */ - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha256_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) */ - /* Calculates the SHA-256 of the buffer * Returns 1 if successful or -1 on error */ @@ -1600,7 +150,7 @@ libhmac_sha256_context_t *context = NULL; static char *function = "libhmac_sha256_calculate"; - if( libhmac_sha256_initialize( + if( libhmac_sha256_context_initialize( &context, error ) != 1 ) { @@ -1613,7 +163,7 @@ goto on_error; } - if( libhmac_sha256_update( + if( libhmac_sha256_context_update( context, buffer, size, @@ -1628,7 +178,7 @@ goto on_error; } - if( libhmac_sha256_finalize( + if( libhmac_sha256_context_finalize( context, hash, hash_size, @@ -1643,7 +193,7 @@ goto on_error; } - if( libhmac_sha256_free( + if( libhmac_sha256_context_free( &context, error ) != 1 ) { @@ -1661,7 +211,7 @@ on_error: if( context != NULL ) { - libhmac_sha256_free( + libhmac_sha256_context_free( &context, NULL ); } @@ -1771,7 +321,7 @@ } else { - if( libhmac_sha256_initialize( + if( libhmac_sha256_context_initialize( &context, error ) != 1 ) { @@ -1784,7 +334,7 @@ goto on_error; } - if( libhmac_sha256_update( + if( libhmac_sha256_context_update( context, key, key_size, @@ -1799,7 +349,7 @@ goto on_error; } - if( libhmac_sha256_finalize( + if( libhmac_sha256_context_finalize( context, key_hash, LIBHMAC_SHA256_HASH_SIZE, @@ -1814,7 +364,7 @@ goto on_error; } - if( libhmac_sha256_free( + if( libhmac_sha256_context_free( &context, error ) != 1 ) { @@ -1922,7 +472,7 @@ inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } - if( libhmac_sha256_initialize( + if( libhmac_sha256_context_initialize( &context, error ) != 1 ) { @@ -1935,7 +485,7 @@ goto on_error; } - if( libhmac_sha256_update( + if( libhmac_sha256_context_update( context, inner_padding, block_size, @@ -1950,7 +500,7 @@ goto on_error; } - if( libhmac_sha256_update( + if( libhmac_sha256_context_update( context, buffer, size, @@ -1965,7 +515,7 @@ goto on_error; } - if( libhmac_sha256_finalize( + if( libhmac_sha256_context_finalize( context, hmac, hmac_size, @@ -1980,7 +530,7 @@ goto on_error; } - if( libhmac_sha256_free( + if( libhmac_sha256_context_free( &context, error ) != 1 ) { @@ -1993,7 +543,7 @@ goto on_error; } - if( libhmac_sha256_initialize( + if( libhmac_sha256_context_initialize( &context, error ) != 1 ) { @@ -2006,7 +556,7 @@ goto on_error; } - if( libhmac_sha256_update( + if( libhmac_sha256_context_update( context, outer_padding, block_size, @@ -2021,7 +571,7 @@ goto on_error; } - if( libhmac_sha256_update( + if( libhmac_sha256_context_update( context, hmac, LIBHMAC_SHA256_HASH_SIZE, @@ -2036,7 +586,7 @@ goto on_error; } - if( libhmac_sha256_finalize( + if( libhmac_sha256_context_finalize( context, hmac, hmac_size, @@ -2051,7 +601,7 @@ goto on_error; } - if( libhmac_sha256_free( + if( libhmac_sha256_context_free( &context, error ) != 1 ) { @@ -2126,7 +676,7 @@ on_error: if( context != NULL ) { - libhmac_sha256_free( + libhmac_sha256_context_free( &context, NULL ); } diff -Nru libbde-20190102/libhmac/libhmac_sha256.h libbde-20240223/libhmac/libhmac_sha256.h --- libbde-20190102/libhmac/libhmac_sha256.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha256.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * SHA-256 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_SHA256_H ) @@ -25,17 +25,6 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include - -#endif - #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" @@ -44,80 +33,6 @@ extern "C" { #endif -/* Make sure the WINAPI version is Vista or later otherwise - * a cross compilation will contain broken SHA-256 support - */ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) -#define LIBHMAC_HAVE_SHA256_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) -#define LIBHMAC_HAVE_SHA256_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) -#define LIBHMAC_HAVE_SHA256_SUPPORT - -#endif - -#if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) -#define LIBHMAC_SHA256_BLOCK_SIZE 64 -#endif - -typedef struct libhmac_internal_sha256_context libhmac_internal_sha256_context_t; - -struct libhmac_internal_sha256_context -{ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) - /* The crypto provider handle - */ - HCRYPTPROV crypt_provider; - - /* The crypto hash handle - */ - HCRYPTHASH hash; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) - /* The SHA-256 context - */ - SHA256_CTX sha256_context; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) - /* The EVP message digest context - */ -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX internal_evp_md_context; -#endif - - EVP_MD_CTX *evp_md_context; - -#else - /* The number of bytes hashed - */ - uint64_t hash_count; - - /* The 32-bit hash values - */ - uint32_t hash_values[ 8 ]; - - /* The block offset - */ - size_t block_offset; - - /* The (data) block - */ - uint8_t block[ 128 ]; -#endif -}; - -#if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) - -ssize_t libhmac_sha256_transform( - libhmac_internal_sha256_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ); - -#endif /* !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) */ - LIBHMAC_EXTERN \ int libhmac_sha256_initialize( libhmac_sha256_context_t **context, diff -Nru libbde-20190102/libhmac/libhmac_sha256_context.c libbde-20240223/libhmac/libhmac_sha256_context.c --- libbde-20190102/libhmac/libhmac_sha256_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha256_context.c 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,1351 @@ +/* + * SHA-256 functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#include +#endif + +#include "libhmac_byte_stream.h" +#include "libhmac_definitions.h" +#include "libhmac_libcerror.h" +#include "libhmac_sha256_context.h" + +#if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) + +/* FIPS 180-2 based SHA-256 functions + */ + +/* The first 32-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] + */ +uint32_t libhmac_sha256_context_prime_square_roots[ 8 ] = { + 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, + 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL +}; + +/* The first 32-bits of the fractional parts of the cube roots of the first 64 primes [ 2, 311 ] + */ +uint32_t libhmac_sha256_context_prime_cube_roots[ 64 ] = { + 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, + 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, + 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, + 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, + 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, + 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, + 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, + 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, + 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, + 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, + 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, + 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, + 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, + 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, + 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, + 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL +}; + +#define libhmac_sha256_context_transform_extend_32bit_value( values_32bit, value_32bit_index, s0, s1 ) \ + s0 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 7 ) \ + ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 15 ], 18 ) \ + ^ ( values_32bit[ value_32bit_index - 15 ] >> 3 ); \ + s1 = byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 17 ) \ + ^ byte_stream_bit_rotate_right_32bit( values_32bit[ value_32bit_index - 2 ], 19 ) \ + ^ ( values_32bit[ value_32bit_index - 2 ] >> 10 ); \ +\ + values_32bit[ value_32bit_index ] = values_32bit[ value_32bit_index - 16 ] \ + + s0 \ + + values_32bit[ value_32bit_index - 7 ] \ + + s1 + +#define libhmac_sha256_context_transform_unfolded_extend_32bit_values( values_32bit, s0, s1 ) \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 16, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 17, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 18, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 19, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 20, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 21, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 22, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 23, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 24, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 25, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 26, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 27, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 28, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 29, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 30, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 31, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 32, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 33, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 34, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 35, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 36, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 37, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 38, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 39, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 40, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 41, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 42, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 43, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 44, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 45, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 46, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 47, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 48, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 49, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 50, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 51, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 52, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 53, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 54, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 55, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 56, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 57, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 58, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 59, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 60, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 61, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 62, s0, s1 ); \ + libhmac_sha256_context_transform_extend_32bit_value( values_32bit, 63, s0, s1 ); + +#define libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, value_32bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ + s0 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 2 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 13 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index0 ], 22 ); \ + s1 = byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 6 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 11 ) \ + ^ byte_stream_bit_rotate_right_32bit( hash_values[ hash_value_index4 ], 25 ); \ +\ + t1 = hash_values[ hash_value_index7 ]; \ + t1 += s1; \ + t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ + ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ + t1 += libhmac_sha256_context_prime_cube_roots[ value_32bit_index ]; \ + t1 += values_32bit[ value_32bit_index ]; \ + t2 = s0; \ + t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ + ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ + ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ +\ + hash_values[ hash_value_index3 ] += t1; \ + hash_values[ hash_value_index7 ] = t1 + t2; + +#define libhmac_sha256_context_transform_unfolded_calculate_hash_values( values_32bit, hash_values, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha256_context_transform_unfolded_calculate_hash_value( values_32bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) + +/* Calculates the SHA-256 of 64 byte sized blocks of data in a buffer + * Returns the number of bytes used if successful or -1 on error + */ +ssize_t libhmac_sha256_context_transform( + libhmac_internal_sha256_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + uint32_t hash_values[ 8 ]; + uint32_t values_32bit[ 64 ]; + + static char *function = "libhmac_sha256_context_transform"; + size_t buffer_offset = 0; + uint32_t s0 = 0; + uint32_t s1 = 0; + uint32_t t1 = 0; + uint32_t t2 = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + uint8_t hash_values_index = 0; + uint8_t value_32bit_index = 0; +#endif + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid internal context.", + function ); + + return( -1 ); + } + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + while( size >= LIBHMAC_SHA256_BLOCK_SIZE ) + { + if( memory_copy( + hash_values, + internal_context->hash_values, + sizeof( uint32_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy hash values.", + function ); + + goto on_error; + } +#if defined( LIBHMAC_UNFOLLED_LOOPS ) + /* Break the block into 16 x 32-bit values + */ + libhmac_byte_stream_copy_to_16x_uint32_big_endian( + &( buffer[ buffer_offset ] ), + values_32bit ); + + buffer_offset += LIBHMAC_SHA256_BLOCK_SIZE; + + /* Extend to 64 x 32-bit values + */ + libhmac_sha256_context_transform_unfolded_extend_32bit_values( + values_32bit, + s0, + s1 ); + + /* Calculate the hash values for the 32-bit values + */ + libhmac_sha256_context_transform_unfolded_calculate_hash_values( + values_32bit, + hash_values, + s0, + s1, + t1, + t2 ); + + /* Update the hash values in the context + */ + internal_context->hash_values[ 0 ] += hash_values[ 0 ]; + internal_context->hash_values[ 1 ] += hash_values[ 1 ]; + internal_context->hash_values[ 2 ] += hash_values[ 2 ]; + internal_context->hash_values[ 3 ] += hash_values[ 3 ]; + internal_context->hash_values[ 4 ] += hash_values[ 4 ]; + internal_context->hash_values[ 5 ] += hash_values[ 5 ]; + internal_context->hash_values[ 6 ] += hash_values[ 6 ]; + internal_context->hash_values[ 7 ] += hash_values[ 7 ]; + +#else + /* Break the block into 16 x 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 16; + value_32bit_index++ ) + { + byte_stream_copy_to_uint32_big_endian( + &( buffer[ buffer_offset ] ), + values_32bit[ value_32bit_index ] ); + + buffer_offset += sizeof( uint32_t ); + } + /* Extend to 64 x 32-bit values + */ + for( value_32bit_index = 16; + value_32bit_index < 64; + value_32bit_index++ ) + { + libhmac_sha256_context_transform_extend_32bit_value( + values_32bit, + value_32bit_index, + s0, + s1 ); + } + /* Calculate the hash values for the 32-bit values + */ + for( value_32bit_index = 0; + value_32bit_index < 64; + value_32bit_index++ ) + { + s0 = byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 2 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 13 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 0 ], 22 ); + s1 = byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 6 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 11 ) + ^ byte_stream_bit_rotate_right_32bit( hash_values[ 4 ], 25 ); + + t1 = hash_values[ 7 ]; + t1 += s1; + t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) + ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); + t1 += libhmac_sha256_context_prime_cube_roots[ value_32bit_index ]; + t1 += values_32bit[ value_32bit_index ]; + t2 = s0; + t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) + ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) + ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); + + hash_values[ 7 ] = hash_values[ 6 ]; + hash_values[ 6 ] = hash_values[ 5 ]; + hash_values[ 5 ] = hash_values[ 4 ]; + hash_values[ 4 ] = hash_values[ 3 ] + t1; + hash_values[ 3 ] = hash_values[ 2 ]; + hash_values[ 2 ] = hash_values[ 1 ]; + hash_values[ 1 ] = hash_values[ 0 ]; + hash_values[ 0 ] = t1 + t2; + } + /* Update the hash values in the context + */ + for( hash_values_index = 0; + hash_values_index < 8; + hash_values_index++ ) + { + internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; + } +#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + size -= LIBHMAC_SHA256_BLOCK_SIZE; + } + /* Prevent sensitive data from leaking + */ + if( memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear hash values.", + function ); + + goto on_error; + } + if( memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 64 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear 32-bit values.", + function ); + + goto on_error; + } + return( (ssize_t) buffer_offset ); + +on_error: + memory_set( + values_32bit, + 0, + sizeof( uint32_t ) * 64 ); + + memory_set( + hash_values, + 0, + sizeof( uint32_t ) * 8 ); + + return( -1 ); +} + +#endif /* !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) */ + +/* Creates a SHA-256 context + * Make sure the value context is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_initialize( + libhmac_sha256_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_initialize"; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) + const EVP_MD *evp_md_type = NULL; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid context value already set.", + function ); + + return( -1 ); + } + internal_context = memory_allocate_structure( + libhmac_internal_sha256_context_t ); + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create context.", + function ); + + goto on_error; + } + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha256_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + memory_free( + internal_context ); + + return( -1 ); + } +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) + if( SHA256_Init( + &( internal_context->sha256_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + + goto on_error; + } + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX_init( + &( internal_context->internal_evp_md_context ) ); + + internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); +#else + internal_context->evp_md_context = EVP_MD_CTX_new(); + + if( internal_context->evp_md_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP message digest context.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ + +/* TODO use EVP_MD_fetch for EVP_DigestInit_ex2 */ + evp_md_type = EVP_sha256(); + +#if defined( HAVE_EVP_DIGESTINIT_EX2 ) + if( EVP_DigestInit_ex2( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#else + if( EVP_DigestInit_ex( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ); + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); +#endif + internal_context->evp_md_context = NULL; + + goto on_error; + } +#else + if( memory_copy( + internal_context->hash_values, + libhmac_sha256_context_prime_square_roots, + sizeof( uint32_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy initial hash values.", + function ); + + return( -1 ); + } +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) */ + + *context = (libhmac_sha256_context_t *) internal_context; + + return( 1 ); + +on_error: + if( internal_context != NULL ) + { + memory_free( + internal_context ); + } + return( -1 ); +} + +/* Frees a SHA-256 context + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_free( + libhmac_sha256_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_free"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + internal_context = (libhmac_internal_sha256_context_t *) *context; + *context = NULL; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) + /* No additional clean up necessary + */ + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + if( EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to clean up EVP message digest context.", + function ); + } + /* Make sure the error state is removed otherwise OpenSSL will leak memory + */ + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); + +#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ + + internal_context->evp_md_context = NULL; +#else + /* No additional clean up necessary + */ +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) */ + + memory_free( + internal_context ); + } + return( 1 ); +} + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) + +/* Updates the SHA-256 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_update( + libhmac_sha256_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_update"; + unsigned long safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha256_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } +#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) + if( size > (size_t) ULONG_MAX ) +#else + if( size > (size_t) SSIZE_MAX ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + safe_hash_size = (unsigned long) size; + + if( SHA256_Update( + &( internal_context->sha256_context ), + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) + +/* Updates the SHA-256 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_update( + libhmac_sha256_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_update"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha256_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( EVP_DigestUpdate( + internal_context->evp_md_context, + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Updates the SHA-256 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_update( + libhmac_sha256_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_update"; + size_t buffer_offset = 0; + size_t remaining_block_size = 0; + ssize_t process_count = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha256_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( internal_context->block_offset > 0 ) + { + if( internal_context->block_offset >= LIBHMAC_SHA256_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid context - block offset value out of bounds.", + function ); + + return( -1 ); + } + remaining_block_size = LIBHMAC_SHA256_BLOCK_SIZE - internal_context->block_offset; + + if( remaining_block_size > size ) + { + remaining_block_size = size; + } + if( memory_copy( + &( internal_context->block[ internal_context->block_offset ] ), + buffer, + remaining_block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset += remaining_block_size; + + if( internal_context->block_offset < LIBHMAC_SHA256_BLOCK_SIZE ) + { + return( 1 ); + } + buffer_offset += remaining_block_size; + size -= remaining_block_size; + + process_count = libhmac_sha256_context_transform( + internal_context, + internal_context->block, + LIBHMAC_SHA256_BLOCK_SIZE, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + internal_context->block_offset = 0; + } + if( size > 0 ) + { + process_count = libhmac_sha256_context_transform( + internal_context, + &( buffer[ buffer_offset ] ), + size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform buffer.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + + buffer_offset += process_count; + size -= process_count; + } + if( size > 0 ) + { + if( size >= LIBHMAC_SHA256_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid size value out of bounds.", + function ); + + return( -1 ); + } + if( memory_copy( + internal_context->block, + &( buffer[ buffer_offset ] ), + size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy remaining data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset = size; + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) */ + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) + +/* Finalizes the SHA-256 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_finalize( + libhmac_sha256_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_finalize"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha256_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + if( SHA256_Final( + hash, + &( internal_context->sha256_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) + +/* Finalizes the SHA-256 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_finalize( + libhmac_sha256_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_finalize"; + unsigned int safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha256_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( ( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) + || ( hash_size > (size_t) UINT_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid hash size value out of bounds.", + function ); + + return( -1 ); + } + safe_hash_size = (unsigned int) hash_size; + + if( EVP_DigestFinal_ex( + internal_context->evp_md_context, + (unsigned char *) hash, + &safe_hash_size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Finalizes the SHA-256 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha256_context_finalize( + libhmac_sha256_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha256_context_t *internal_context = NULL; + static char *function = "libhmac_sha256_context_finalize"; + size_t block_size = 0; + size_t number_of_blocks = 0; + ssize_t process_count = 0; + uint64_t bit_size = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + size_t hash_index = 0; + int hash_values_index = 0; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha256_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash value too small.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + /* Add padding with a size of 56 mod 64 + */ + number_of_blocks = 1; + + if( internal_context->block_offset > 55 ) + { + number_of_blocks += 1; + } + block_size = number_of_blocks * LIBHMAC_SHA256_BLOCK_SIZE; + + if( memory_set( + &( internal_context->block[ internal_context->block_offset ] ), + 0, + block_size - internal_context->block_offset ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context block.", + function ); + + return( -1 ); + } + /* The first byte of the padding contains 0x80 + */ + internal_context->block[ internal_context->block_offset ] = 0x80; + + bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; + + byte_stream_copy_from_uint64_big_endian( + &( internal_context->block[ block_size - 8 ] ), + bit_size ); + + process_count = libhmac_sha256_context_transform( + internal_context, + internal_context->block, + block_size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + for( hash_values_index = 0; + hash_values_index < 8; + hash_values_index++ ) + { + byte_stream_copy_from_uint32_big_endian( + &( hash[ hash_index ] ), + internal_context->hash_values[ hash_values_index ] ); + + hash_index += sizeof( uint32_t ); + } +#else + byte_stream_copy_from_uint32_big_endian( + &( hash[ 0 ] ), + internal_context->hash_values[ 0 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 4 ] ), + internal_context->hash_values[ 1 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 8 ] ), + internal_context->hash_values[ 2 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 12 ] ), + internal_context->hash_values[ 3 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 16 ] ), + internal_context->hash_values[ 4 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 20 ] ), + internal_context->hash_values[ 5 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 24 ] ), + internal_context->hash_values[ 6 ] ); + + byte_stream_copy_from_uint32_big_endian( + &( hash[ 28 ] ), + internal_context->hash_values[ 7 ] ); + +#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + /* Prevent sensitive data from leaking + */ + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha256_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha256_context.h libbde-20240223/libhmac/libhmac_sha256_context.h --- libbde-20190102/libhmac/libhmac_sha256_context.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha256_context.h 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * SHA-256 context functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBHMAC_SHA256_CONTEXT_H ) +#define _LIBHMAC_SHA256_CONTEXT_H + +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#endif + +#include "libhmac_extern.h" +#include "libhmac_libcerror.h" +#include "libhmac_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) +#define LIBHMAC_HAVE_SHA256_SUPPORT + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) +#define LIBHMAC_HAVE_SHA256_SUPPORT + +#endif + +#define LIBHMAC_SHA256_BLOCK_SIZE 64 + +typedef struct libhmac_internal_sha256_context libhmac_internal_sha256_context_t; + +struct libhmac_internal_sha256_context +{ +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) + /* The SHA-256 context + */ + SHA256_CTX sha256_context; + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) + /* The EVP message digest context + */ +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX internal_evp_md_context; +#endif + + EVP_MD_CTX *evp_md_context; + +#else + /* The number of bytes hashed + */ + uint64_t hash_count; + + /* The 32-bit hash values + */ + uint32_t hash_values[ 8 ]; + + /* The block offset + */ + size_t block_offset; + + /* The (data) block + */ + uint8_t block[ 2 * LIBHMAC_SHA256_BLOCK_SIZE ]; + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) */ +}; + +#if !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) + +ssize_t libhmac_sha256_context_transform( + libhmac_internal_sha256_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +#endif /* !defined( LIBHMAC_HAVE_SHA256_SUPPORT ) */ + +LIBHMAC_EXTERN \ +int libhmac_sha256_context_initialize( + libhmac_sha256_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha256_context_free( + libhmac_sha256_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha256_context_update( + libhmac_sha256_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha256_context_finalize( + libhmac_sha256_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBHMAC_SHA256_CONTEXT_H ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha512.c libbde-20240223/libhmac/libhmac_sha512.c --- libbde-20190102/libhmac/libhmac_sha512.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha512.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,495 +1,34 @@ /* * SHA-512 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include -#include #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include -#include - -#endif - -#include "libhmac_byte_stream.h" #include "libhmac_definitions.h" #include "libhmac_libcerror.h" #include "libhmac_sha512.h" +#include "libhmac_sha512_context.h" -#if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) - -/* FIPS 180-2 based SHA-512 functions - */ - -/* The first 64-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] - */ -uint64_t libhmac_sha512_prime_square_roots[ 8 ] = { - 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, - 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179 -}; - -/* The first 64-bits of the fractional parts of the cube roots of the first 80 primes [ 2, 409 ] - */ -uint64_t libhmac_sha512_prime_cube_roots[ 80 ] = { - 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, - 0x3956c25bf348b538, 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, - 0xd807aa98a3030242, 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, - 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 0xc19bf174cf692694, - 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, - 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, - 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, - 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 0x06ca6351e003826f, 0x142929670a0e6e70, - 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df, - 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, - 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, - 0xd192e819d6ef5218, 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, - 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, - 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, - 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, - 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, - 0xca273eceea26619c, 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, - 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b, - 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c, - 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 -}; - -#define libhmac_sha512_transform_extend_64bit_value( values_64bit, value_64bit_index, s0, s1 ) \ - s0 = byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 15 ], 1 ) \ - ^ byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 15 ], 8 ) \ - ^ ( values_64bit[ value_64bit_index - 15 ] >> 7 ); \ - s1 = byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 2 ], 19 ) \ - ^ byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 2 ], 61 ) \ - ^ ( values_64bit[ value_64bit_index - 2 ] >> 6 ); \ -\ - values_64bit[ value_64bit_index ] = values_64bit[ value_64bit_index - 16 ] \ - + s0 \ - + values_64bit[ value_64bit_index - 7 ] \ - + s1 - -#define libhmac_sha512_transform_unfolded_extend_64bit_values( values_64bit, s0, s1 ) \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 16, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 17, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 18, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 19, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 20, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 21, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 22, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 23, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 24, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 25, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 26, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 27, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 28, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 29, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 30, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 31, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 32, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 33, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 34, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 35, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 36, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 37, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 38, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 39, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 40, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 41, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 42, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 43, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 44, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 45, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 46, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 47, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 48, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 49, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 50, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 51, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 52, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 53, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 54, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 55, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 56, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 57, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 58, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 59, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 60, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 61, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 62, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 63, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 64, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 65, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 66, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 67, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 68, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 69, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 70, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 71, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 72, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 73, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 74, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 75, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 76, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 77, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 78, s0, s1 ); \ - libhmac_sha512_transform_extend_64bit_value( values_64bit, 79, s0, s1 ); - -#define libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, value_64bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ - s0 = byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 28 ) \ - ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 34 ) \ - ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 39 ); \ - s1 = byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 14 ) \ - ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 18 ) \ - ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 41 ); \ -\ - t1 = hash_values[ hash_value_index7 ]; \ - t1 += s1; \ - t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ - ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ - t1 += libhmac_sha512_prime_cube_roots[ value_64bit_index ]; \ - t1 += values_64bit[ value_64bit_index ]; \ - t2 = s0; \ - t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ - ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ - ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ -\ - hash_values[ hash_value_index3 ] += t1; \ - hash_values[ hash_value_index7 ] = t1 + t2; - -#define libhmac_sha512_transform_unfolded_calculate_hash_values( values_64bit, hash_values, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 64, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 65, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 66, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 67, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 68, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 69, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 70, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 71, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 72, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 73, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 74, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 75, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 76, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 77, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 78, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ - libhmac_sha512_transform_unfolded_calculate_hash_value( values_64bit, 79, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) - -/* Calculates the SHA-512 of 128 byte sized blocks of data in a buffer - * Returns the number of bytes used if successful or -1 on error - */ -ssize_t libhmac_sha512_transform( - libhmac_internal_sha512_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - uint64_t hash_values[ 8 ]; - uint64_t values_64bit[ 80 ]; - - static char *function = "libhmac_sha512_transform"; - uint64_t s0 = 0; - uint64_t s1 = 0; - uint64_t t1 = 0; - uint64_t t2 = 0; - size_t buffer_offset = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - uint8_t hash_values_index = 0; - uint8_t value_64bit_index = 0; -#endif - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid internal context.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - while( size >= LIBHMAC_SHA512_BLOCK_SIZE ) - { - if( memory_copy( - hash_values, - internal_context->hash_values, - sizeof( uint64_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy hash values.", - function ); - - goto on_error; - } -#if defined( LIBHMAC_UNFOLLED_LOOPS ) - /* Break the block into 16 x 64-bit values - */ - libhmac_byte_stream_copy_to_16x_uint64_big_endian( - &( buffer[ buffer_offset ] ), - values_64bit ); - - buffer_offset += LIBHMAC_SHA512_BLOCK_SIZE; - - /* Extend to 80 x 64-bit values - */ - libhmac_sha512_transform_unfolded_extend_64bit_values( - values_64bit, - s0, - s1 ); - - /* Calculate the hash values for the 64-bit values - */ - libhmac_sha512_transform_unfolded_calculate_hash_values( - values_64bit, - hash_values, - s0, - s1, - t1, - t2 ); - - /* Update the hash values in the context - */ - internal_context->hash_values[ 0 ] += hash_values[ 0 ]; - internal_context->hash_values[ 1 ] += hash_values[ 1 ]; - internal_context->hash_values[ 2 ] += hash_values[ 2 ]; - internal_context->hash_values[ 3 ] += hash_values[ 3 ]; - internal_context->hash_values[ 4 ] += hash_values[ 4 ]; - internal_context->hash_values[ 5 ] += hash_values[ 5 ]; - internal_context->hash_values[ 6 ] += hash_values[ 6 ]; - internal_context->hash_values[ 7 ] += hash_values[ 7 ]; - -#else - /* Break the block into 16 x 64-bit values - */ - for( value_64bit_index = 0; - value_64bit_index < 16; - value_64bit_index++ ) - { - byte_stream_copy_to_uint64_big_endian( - &( buffer[ buffer_offset ] ), - values_64bit[ value_64bit_index ] ); - - buffer_offset += sizeof( uint64_t ); - } - /* Extend to 80 x 64-bit values - */ - for( value_64bit_index = 16; - value_64bit_index < 80; - value_64bit_index++ ) - { - libhmac_sha512_transform_extend_64bit_value( - values_64bit, - value_64bit_index, - s0, - s1 ); - } - /* Calculate the hash values for the 64-bit values - */ - for( value_64bit_index = 0; - value_64bit_index < 80; - value_64bit_index++ ) - { - s0 = byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 28 ) - ^ byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 34 ) - ^ byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 39 ); - s1 = byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 14 ) - ^ byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 18 ) - ^ byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 41 ); - - t1 = hash_values[ 7 ]; - t1 += s1; - t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) - ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); - t1 += libhmac_sha512_prime_cube_roots[ value_64bit_index ]; - t1 += values_64bit[ value_64bit_index ]; - t2 = s0; - t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) - ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) - ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); - - hash_values[ 7 ] = hash_values[ 6 ]; - hash_values[ 6 ] = hash_values[ 5 ]; - hash_values[ 5 ] = hash_values[ 4 ]; - hash_values[ 4 ] = hash_values[ 3 ] + t1; - hash_values[ 3 ] = hash_values[ 2 ]; - hash_values[ 2 ] = hash_values[ 1 ]; - hash_values[ 1 ] = hash_values[ 0 ]; - hash_values[ 0 ] = t1 + t2; - } - /* Update the hash values in the context - */ - for( hash_values_index = 0; - hash_values_index < 8; - hash_values_index++ ) - { - internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; - } -#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - size -= LIBHMAC_SHA512_BLOCK_SIZE; - } - /* Prevent sensitive data from leaking - */ - if( memory_set( - hash_values, - 0, - sizeof( uint64_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear hash values.", - function ); - - goto on_error; - } - if( memory_set( - values_64bit, - 0, - sizeof( uint64_t ) * 80 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear 64-bit values.", - function ); - - goto on_error; - } - return( (ssize_t) buffer_offset ); - -on_error: - memory_set( - values_64bit, - 0, - sizeof( uint64_t ) * 80 ); - - memory_set( - hash_values, - 0, - sizeof( uint64_t ) * 8 ); - - return( -1 ); -} - -#endif /* !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) */ - -/* Creates a SHA-512 context +/* Creates a SHA512 context * Make sure the value context is referencing, is set to NULL * Returns 1 if successful or -1 on error */ @@ -497,161 +36,11 @@ libhmac_sha512_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_initialize"; + static char *function = "libhmac_sha512_initialize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - if( *context != NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, - "%s: invalid context value already set.", - function ); - - return( -1 ); - } - internal_context = memory_allocate_structure( - libhmac_internal_sha512_context_t ); - - if( internal_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_INSUFFICIENT, - "%s: unable to create context.", - function ); - - goto on_error; - } - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha512_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - memory_free( - internal_context ); - - return( -1 ); - } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) - /* Request the AES crypt provider, fail back to the RSA crypt provider - */ - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_AES, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - if( CryptAcquireContext( - &( internal_context->crypt_provider ), - NULL, - NULL, - PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT ) == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create AES or RSA crypt provider.", - function ); - - goto on_error; - } - } - if( internal_context->crypt_provider == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: unable to create crypt provider.", - function ); - - goto on_error; - } - if( CryptCreateHash( - internal_context->crypt_provider, - CALG_SHA_512, - 0, - 0, - &( internal_context->hash ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create hash object.", - function ); - - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) - if( SHA512_Init( - &( internal_context->sha512_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to initialize context.", - function ); - - goto on_error; - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX_init( - &( internal_context->internal_evp_md_context ) ); - - internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); -#else - internal_context->evp_md_context = EVP_MD_CTX_new(); - - if( internal_context->evp_md_context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create EVP message digest context.", - function ); - - goto on_error; - } -#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ - - if( EVP_DigestInit_ex( - internal_context->evp_md_context, - EVP_sha512(), - NULL ) != 1 ) + if( libhmac_sha512_context_initialize( + context, + error ) != 1 ) { libcerror_error_set( error, @@ -660,278 +49,29 @@ "%s: unable to initialize context.", function ); -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ); - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); -#endif - internal_context->evp_md_context = NULL; - - goto on_error; - } -#else - if( memory_copy( - internal_context->hash_values, - libhmac_sha512_prime_square_roots, - sizeof( uint64_t ) * 8 ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy initial hash values.", - function ); - return( -1 ); } -#endif - *context = (libhmac_sha512_context_t *) internal_context; - return( 1 ); - -on_error: - if( internal_context != NULL ) - { - memory_free( - internal_context ); - } - return( -1 ); } -/* Frees a SHA-512 context +/* Frees a SHA512 context * Returns 1 if successful or -1 on error */ int libhmac_sha512_free( libhmac_sha512_context_t **context, libcerror_error_t **error ) { - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_free"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); + static char *function = "libhmac_sha512_free"; - return( -1 ); - } - if( *context != NULL ) - { - internal_context = (libhmac_internal_sha512_context_t *) *context; - *context = NULL; - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) - if( internal_context->crypt_provider != 0 ) - { - CryptReleaseContext( - internal_context->crypt_provider, - 0 ); - } - if( internal_context->hash != 0 ) - { - CryptDestroyHash( - internal_context->hash ); - } - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) - /* No additional clean up necessary - */ - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) -#if defined( HAVE_EVP_MD_CTX_CLEANUP ) - if( EVP_MD_CTX_cleanup( - &( internal_context->internal_evp_md_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to clean up EVP message digest context.", - function ); - } - /* Make sure the error state is removed otherwise OpenSSL will leak memory - */ - ERR_remove_thread_state( - NULL ); -#else - EVP_MD_CTX_free( - internal_context->evp_md_context ); - -#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ - - internal_context->evp_md_context = NULL; -#else - /* No additional clean up necessary - */ -#endif - memory_free( - internal_context ); - } - return( 1 ); -} - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) - -/* Updates the SHA-512 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha512_update( - libhmac_sha512_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( size == 0 ) - { - return( 1 ); - } - if( CryptHashData( - internal_context->hash, - (BYTE *) buffer, - (DWORD) size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) - -/* Updates the SHA-512 context using OpenSSL - * Returns 1 if successful or -1 on error - */ -int libhmac_sha512_update( - libhmac_sha512_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_update"; - unsigned long safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } -#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) - if( size > (size_t) ULONG_MAX ) -#else - if( size > (size_t) SSIZE_MAX ) -#endif - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - safe_hash_size = (unsigned long) size; - - if( SHA512_Update( - &( internal_context->sha512_context ), - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha512_context_free( + context, + error ) != 1 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to update context.", + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free context.", function ); return( -1 ); @@ -939,9 +79,7 @@ return( 1 ); } -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) - -/* Updates the SHA-512 context using OpenSSL EVP +/* Updates the SHA512 context * Returns 1 if successful or -1 on error */ int libhmac_sha512_update( @@ -950,52 +88,13 @@ size_t size, libcerror_error_t **error ) { - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_update"; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); + static char *function = "libhmac_sha512_update"; - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( EVP_DigestUpdate( - internal_context->evp_md_context, - (const void *) buffer, - size ) != 1 ) + if( libhmac_sha512_context_update( + context, + buffer, + size, + error ) != 1 ) { libcerror_error_set( error, @@ -1009,269 +108,7 @@ return( 1 ); } -#else - -/* Updates the SHA-512 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha512_update( - libhmac_sha512_context_t *context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ) -{ - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_update"; - size_t buffer_offset = 0; - size_t remaining_block_size = 0; - ssize_t process_count = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( buffer == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid buffer.", - function ); - - return( -1 ); - } - if( size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid size value exceeds maximum.", - function ); - - return( -1 ); - } - if( size == 0 ) - { - return( 1 ); - } - if( internal_context->block_offset > 0 ) - { - remaining_block_size = LIBHMAC_SHA512_BLOCK_SIZE - internal_context->block_offset; - - if( remaining_block_size > size ) - { - remaining_block_size = size; - } - if( memory_copy( - &( internal_context->block[ internal_context->block_offset ] ), - buffer, - remaining_block_size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset += remaining_block_size; - - if( internal_context->block_offset < LIBHMAC_SHA512_BLOCK_SIZE ) - { - return( 1 ); - } - buffer_offset += remaining_block_size; - size -= remaining_block_size; - - process_count = libhmac_sha512_transform( - internal_context, - internal_context->block, - LIBHMAC_SHA512_BLOCK_SIZE, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - internal_context->block_offset = 0; - } - if( size > 0 ) - { - process_count = libhmac_sha512_transform( - internal_context, - &( buffer[ buffer_offset ] ), - size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform buffer.", - function ); - - return( -1 ); - } - internal_context->hash_count += process_count; - - buffer_offset += process_count; - size -= process_count; - } - if( size > 0 ) - { - if( size >= LIBHMAC_SHA512_BLOCK_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid size value out of bounds.", - function ); - - return( -1 ); - } - if( memory_copy( - internal_context->block, - &( buffer[ buffer_offset ] ), - size ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to copy remaining data to context block.", - function ); - - return( -1 ); - } - internal_context->block_offset = size; - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) */ - -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) - -/* Finalizes the SHA-512 context using the Windows Crypto API - * Returns 1 if successful or -1 on error - */ -int libhmac_sha512_finalize( - libhmac_sha512_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_finalize"; - DWORD safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( internal_context->hash == 0 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid context - missing hash.", - function ); - - return( -1 ); - } - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } -#if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) - if( hash_size > (size_t) UINT32_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } -#endif - if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (DWORD) hash_size; - - if( CryptGetHashParam( - internal_context->hash, - HP_HASHVAL, - (BYTE *) hash, - &safe_hash_size, - 0 ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize hash.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) - -/* Finalizes the SHA-512 context using OpenSSL +/* Finalizes the SHA512 context * Returns 1 if successful or -1 on error */ int libhmac_sha512_finalize( @@ -1280,138 +117,13 @@ size_t hash_size, libcerror_error_t **error ) { - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_finalize"; + static char *function = "libhmac_sha512_finalize"; - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - if( SHA512_Final( + if( libhmac_sha512_context_finalize( + context, hash, - &( internal_context->sha512_context ) ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, - "%s: unable to finalize context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) - -/* Finalizes the SHA-512 context using OpenSSL EVP - * Returns 1 if successful or -1 on error - */ -int libhmac_sha512_finalize( - libhmac_sha512_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_finalize"; - unsigned int safe_hash_size = 0; - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) UINT_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - safe_hash_size = (unsigned int) hash_size; - - if( EVP_DigestFinal_ex( - internal_context->evp_md_context, - (unsigned char *) hash, - &safe_hash_size ) != 1 ) + hash_size, + error ) != 1 ) { libcerror_error_set( error, @@ -1425,204 +137,6 @@ return( 1 ); } -#else - -/* Finalizes the SHA-512 context using fallback implementation - * Returns 1 if successful or -1 on error - */ -int libhmac_sha512_finalize( - libhmac_sha512_context_t *context, - uint8_t *hash, - size_t hash_size, - libcerror_error_t **error ) -{ - libhmac_internal_sha512_context_t *internal_context = NULL; - static char *function = "libhmac_sha512_finalize"; - size_t block_size = 0; - size_t number_of_blocks = 0; - ssize_t process_count = 0; - uint64_t bit_size = 0; - -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - size_t hash_index = 0; - int hash_values_index = 0; -#endif - - if( context == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid context.", - function ); - - return( -1 ); - } - internal_context = (libhmac_internal_sha512_context_t *) context; - - if( hash == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid hash.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash value too small.", - function ); - - return( -1 ); - } - if( hash_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid hash size value exceeds maximum.", - function ); - - return( -1 ); - } - if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: invalid hash size value too small.", - function ); - - return( -1 ); - } - /* Add padding with a size of 120 mod 128 - */ - number_of_blocks = 1; - - if( internal_context->block_offset > 119 ) - { - number_of_blocks += 1; - } - block_size = number_of_blocks * LIBHMAC_SHA512_BLOCK_SIZE; - - if( memory_set( - &( internal_context->block[ internal_context->block_offset ] ), - 0, - block_size - internal_context->block_offset ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context block.", - function ); - - return( -1 ); - } - /* The first byte of the padding contains 0x80 - */ - internal_context->block[ internal_context->block_offset ] = 0x80; - - bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; - - byte_stream_copy_from_uint64_big_endian( - &( internal_context->block[ block_size - 8 ] ), - bit_size ); - - process_count = libhmac_sha512_transform( - internal_context, - internal_context->block, - block_size, - error ); - - if( process_count == -1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to transform context block.", - function ); - - return( -1 ); - } -#if !defined( LIBHMAC_UNFOLLED_LOOPS ) - for( hash_values_index = 0; - hash_values_index < 8; - hash_values_index++ ) - { - byte_stream_copy_from_uint64_big_endian( - &( hash[ hash_index ] ), - internal_context->hash_values[ hash_values_index ] ); - - hash_index += sizeof( uint64_t ); - } -#else - byte_stream_copy_from_uint64_big_endian( - &( hash[ 0 ] ), - internal_context->hash_values[ 0 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 8 ] ), - internal_context->hash_values[ 1 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 16 ] ), - internal_context->hash_values[ 2 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 24 ] ), - internal_context->hash_values[ 3 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 32 ] ), - internal_context->hash_values[ 4 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 40 ] ), - internal_context->hash_values[ 5 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 48 ] ), - internal_context->hash_values[ 6 ] ); - - byte_stream_copy_from_uint64_big_endian( - &( hash[ 56 ] ), - internal_context->hash_values[ 7 ] ); - -#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ - - /* Prevent sensitive data from leaking - */ - if( memory_set( - internal_context, - 0, - sizeof( libhmac_internal_sha512_context_t ) ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_SET_FAILED, - "%s: unable to clear context.", - function ); - - return( -1 ); - } - return( 1 ); -} - -#endif /* defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_512 ) */ - /* Calculates the SHA-512 of the buffer * Returns 1 if successful or -1 on error */ @@ -1636,7 +150,7 @@ libhmac_sha512_context_t *context = NULL; static char *function = "libhmac_sha512_calculate"; - if( libhmac_sha512_initialize( + if( libhmac_sha512_context_initialize( &context, error ) != 1 ) { @@ -1649,7 +163,7 @@ goto on_error; } - if( libhmac_sha512_update( + if( libhmac_sha512_context_update( context, buffer, size, @@ -1664,7 +178,7 @@ goto on_error; } - if( libhmac_sha512_finalize( + if( libhmac_sha512_context_finalize( context, hash, hash_size, @@ -1679,7 +193,7 @@ goto on_error; } - if( libhmac_sha512_free( + if( libhmac_sha512_context_free( &context, error ) != 1 ) { @@ -1697,7 +211,7 @@ on_error: if( context != NULL ) { - libhmac_sha512_free( + libhmac_sha512_context_free( &context, NULL ); } @@ -1725,7 +239,7 @@ uint8_t *outer_padding = NULL; static char *function = "libhmac_sha512_calculate_hmac"; size_t block_index = 0; - size_t block_size = 64; + size_t block_size = 128; if( key == NULL ) { @@ -1807,7 +321,7 @@ } else { - if( libhmac_sha512_initialize( + if( libhmac_sha512_context_initialize( &context, error ) != 1 ) { @@ -1820,7 +334,7 @@ goto on_error; } - if( libhmac_sha512_update( + if( libhmac_sha512_context_update( context, key, key_size, @@ -1835,7 +349,7 @@ goto on_error; } - if( libhmac_sha512_finalize( + if( libhmac_sha512_context_finalize( context, key_hash, LIBHMAC_SHA512_HASH_SIZE, @@ -1850,7 +364,7 @@ goto on_error; } - if( libhmac_sha512_free( + if( libhmac_sha512_context_free( &context, error ) != 1 ) { @@ -1958,7 +472,7 @@ inner_padding[ block_index ] ^= key_data[ block_index ]; outer_padding[ block_index ] ^= key_data[ block_index ]; } - if( libhmac_sha512_initialize( + if( libhmac_sha512_context_initialize( &context, error ) != 1 ) { @@ -1971,7 +485,7 @@ goto on_error; } - if( libhmac_sha512_update( + if( libhmac_sha512_context_update( context, inner_padding, block_size, @@ -1986,7 +500,7 @@ goto on_error; } - if( libhmac_sha512_update( + if( libhmac_sha512_context_update( context, buffer, size, @@ -2001,7 +515,7 @@ goto on_error; } - if( libhmac_sha512_finalize( + if( libhmac_sha512_context_finalize( context, hmac, hmac_size, @@ -2016,7 +530,7 @@ goto on_error; } - if( libhmac_sha512_free( + if( libhmac_sha512_context_free( &context, error ) != 1 ) { @@ -2029,7 +543,7 @@ goto on_error; } - if( libhmac_sha512_initialize( + if( libhmac_sha512_context_initialize( &context, error ) != 1 ) { @@ -2042,7 +556,7 @@ goto on_error; } - if( libhmac_sha512_update( + if( libhmac_sha512_context_update( context, outer_padding, block_size, @@ -2057,7 +571,7 @@ goto on_error; } - if( libhmac_sha512_update( + if( libhmac_sha512_context_update( context, hmac, LIBHMAC_SHA512_HASH_SIZE, @@ -2072,7 +586,7 @@ goto on_error; } - if( libhmac_sha512_finalize( + if( libhmac_sha512_context_finalize( context, hmac, hmac_size, @@ -2087,7 +601,7 @@ goto on_error; } - if( libhmac_sha512_free( + if( libhmac_sha512_context_free( &context, error ) != 1 ) { @@ -2162,7 +676,7 @@ on_error: if( context != NULL ) { - libhmac_sha512_free( + libhmac_sha512_context_free( &context, NULL ); } diff -Nru libbde-20190102/libhmac/libhmac_sha512.h libbde-20240223/libhmac/libhmac_sha512.h --- libbde-20190102/libhmac/libhmac_sha512.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha512.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * SHA-512 functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_SHA512_H ) @@ -25,17 +25,6 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) -#include - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) -#include - -#endif - #include "libhmac_extern.h" #include "libhmac_libcerror.h" #include "libhmac_types.h" @@ -44,80 +33,6 @@ extern "C" { #endif -/* Make sure the WINAPI version is Vista or later otherwise - * a cross compilation will contain broken SHA-512 support - */ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) -#define LIBHMAC_HAVE_SHA512_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) -#define LIBHMAC_HAVE_SHA512_SUPPORT - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) -#define LIBHMAC_HAVE_SHA512_SUPPORT - -#endif - -#if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) -#define LIBHMAC_SHA512_BLOCK_SIZE 128 -#endif - -typedef struct libhmac_internal_sha512_context libhmac_internal_sha512_context_t; - -struct libhmac_internal_sha512_context -{ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) - /* The crypto provider handle - */ - HCRYPTPROV crypt_provider; - - /* The crypto hash handle - */ - HCRYPTHASH hash; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) - /* The SHA-512 context - */ - SHA512_CTX sha512_context; - -#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) - /* The EVP message digest context - */ -#if defined( HAVE_EVP_MD_CTX_INIT ) - EVP_MD_CTX internal_evp_md_context; -#endif - - EVP_MD_CTX *evp_md_context; - -#else - /* The number of bytes hashed - */ - uint64_t hash_count; - - /* The 64-bit hash values - */ - uint64_t hash_values[ 8 ]; - - /* The block offset - */ - size_t block_offset; - - /* The (data) block - */ - uint8_t block[ 128 ]; -#endif -}; - -#if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) - -ssize_t libhmac_sha512_transform( - libhmac_internal_sha512_context_t *internal_context, - const uint8_t *buffer, - size_t size, - libcerror_error_t **error ); - -#endif /* !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) */ - LIBHMAC_EXTERN \ int libhmac_sha512_initialize( libhmac_sha512_context_t **context, diff -Nru libbde-20190102/libhmac/libhmac_sha512_context.c libbde-20240223/libhmac/libhmac_sha512_context.c --- libbde-20190102/libhmac/libhmac_sha512_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha512_context.c 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,1387 @@ +/* + * SHA-512 functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#include +#endif + +#include "libhmac_byte_stream.h" +#include "libhmac_definitions.h" +#include "libhmac_libcerror.h" +#include "libhmac_sha512_context.h" + +#if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) + +/* FIPS 180-2 based SHA-512 functions + */ + +/* The first 64-bits of the fractional parts of the square roots of the first 8 primes [ 2, 19 ] + */ +uint64_t libhmac_sha512_context_prime_square_roots[ 8 ] = { + 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, + 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179 +}; + +/* The first 64-bits of the fractional parts of the cube roots of the first 80 primes [ 2, 409 ] + */ +uint64_t libhmac_sha512_context_prime_cube_roots[ 80 ] = { + 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, + 0x3956c25bf348b538, 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, + 0xd807aa98a3030242, 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, + 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 0xc19bf174cf692694, + 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, + 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, + 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, + 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 0x06ca6351e003826f, 0x142929670a0e6e70, + 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df, + 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, + 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, + 0xd192e819d6ef5218, 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, + 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, + 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, + 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, + 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, + 0xca273eceea26619c, 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, + 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b, + 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c, + 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 +}; + +#define libhmac_sha512_context_transform_extend_64bit_value( values_64bit, value_64bit_index, s0, s1 ) \ + s0 = byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 15 ], 1 ) \ + ^ byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 15 ], 8 ) \ + ^ ( values_64bit[ value_64bit_index - 15 ] >> 7 ); \ + s1 = byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 2 ], 19 ) \ + ^ byte_stream_bit_rotate_right_64bit( values_64bit[ value_64bit_index - 2 ], 61 ) \ + ^ ( values_64bit[ value_64bit_index - 2 ] >> 6 ); \ +\ + values_64bit[ value_64bit_index ] = values_64bit[ value_64bit_index - 16 ] \ + + s0 \ + + values_64bit[ value_64bit_index - 7 ] \ + + s1 + +#define libhmac_sha512_context_transform_unfolded_extend_64bit_values( values_64bit, s0, s1 ) \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 16, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 17, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 18, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 19, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 20, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 21, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 22, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 23, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 24, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 25, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 26, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 27, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 28, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 29, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 30, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 31, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 32, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 33, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 34, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 35, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 36, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 37, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 38, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 39, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 40, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 41, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 42, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 43, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 44, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 45, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 46, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 47, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 48, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 49, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 50, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 51, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 52, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 53, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 54, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 55, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 56, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 57, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 58, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 59, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 60, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 61, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 62, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 63, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 64, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 65, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 66, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 67, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 68, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 69, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 70, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 71, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 72, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 73, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 74, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 75, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 76, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 77, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 78, s0, s1 ); \ + libhmac_sha512_context_transform_extend_64bit_value( values_64bit, 79, s0, s1 ); + +#define libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, value_64bit_index, hash_values, hash_value_index0, hash_value_index1, hash_value_index2, hash_value_index3, hash_value_index4, hash_value_index5, hash_value_index6, hash_value_index7, s0, s1, t1, t2 ) \ + s0 = byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 28 ) \ + ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 34 ) \ + ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index0 ], 39 ); \ + s1 = byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 14 ) \ + ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 18 ) \ + ^ byte_stream_bit_rotate_right_64bit( hash_values[ hash_value_index4 ], 41 ); \ +\ + t1 = hash_values[ hash_value_index7 ]; \ + t1 += s1; \ + t1 += ( hash_values[ hash_value_index4 ] & hash_values[ hash_value_index5 ] ) \ + ^ ( ~( hash_values[ hash_value_index4 ] ) & hash_values[ hash_value_index6 ] ); \ + t1 += libhmac_sha512_context_prime_cube_roots[ value_64bit_index ]; \ + t1 += values_64bit[ value_64bit_index ]; \ + t2 = s0; \ + t2 += ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index1 ] ) \ + ^ ( hash_values[ hash_value_index0 ] & hash_values[ hash_value_index2 ] ) \ + ^ ( hash_values[ hash_value_index1 ] & hash_values[ hash_value_index2 ] ); \ +\ + hash_values[ hash_value_index3 ] += t1; \ + hash_values[ hash_value_index7 ] = t1 + t2; + +#define libhmac_sha512_context_transform_unfolded_calculate_hash_values( values_64bit, hash_values, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 0, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 1, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 2, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 3, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 4, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 5, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 6, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 7, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 8, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 9, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 10, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 11, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 12, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 13, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 14, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 15, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 16, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 17, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 18, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 19, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 20, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 21, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 22, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 23, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 24, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 25, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 26, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 27, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 28, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 29, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 30, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 31, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 32, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 33, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 34, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 35, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 36, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 37, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 38, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 39, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 40, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 41, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 42, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 43, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 44, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 45, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 46, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 47, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 48, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 49, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 50, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 51, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 52, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 53, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 54, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 55, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 56, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 57, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 58, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 59, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 60, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 61, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 62, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 63, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 64, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 65, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 66, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 67, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 68, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 69, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 70, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 71, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 72, hash_values, 0, 1, 2, 3, 4, 5, 6, 7, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 73, hash_values, 7, 0, 1, 2, 3, 4, 5, 6, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 74, hash_values, 6, 7, 0, 1, 2, 3, 4, 5, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 75, hash_values, 5, 6, 7, 0, 1, 2, 3, 4, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 76, hash_values, 4, 5, 6, 7, 0, 1, 2, 3, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 77, hash_values, 3, 4, 5, 6, 7, 0, 1, 2, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 78, hash_values, 2, 3, 4, 5, 6, 7, 0, 1, s0, s1, t1, t2 ) \ + libhmac_sha512_context_transform_unfolded_calculate_hash_value( values_64bit, 79, hash_values, 1, 2, 3, 4, 5, 6, 7, 0, s0, s1, t1, t2 ) + +/* Calculates the SHA-512 of 128 byte sized blocks of data in a buffer + * Returns the number of bytes used if successful or -1 on error + */ +ssize_t libhmac_sha512_context_transform( + libhmac_internal_sha512_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + uint64_t hash_values[ 8 ]; + uint64_t values_64bit[ 80 ]; + + static char *function = "libhmac_sha512_context_transform"; + uint64_t s0 = 0; + uint64_t s1 = 0; + uint64_t t1 = 0; + uint64_t t2 = 0; + size_t buffer_offset = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + uint8_t hash_values_index = 0; + uint8_t value_64bit_index = 0; +#endif + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid internal context.", + function ); + + return( -1 ); + } + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + while( size >= LIBHMAC_SHA512_BLOCK_SIZE ) + { + if( memory_copy( + hash_values, + internal_context->hash_values, + sizeof( uint64_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy hash values.", + function ); + + goto on_error; + } +#if defined( LIBHMAC_UNFOLLED_LOOPS ) + /* Break the block into 16 x 64-bit values + */ + libhmac_byte_stream_copy_to_16x_uint64_big_endian( + &( buffer[ buffer_offset ] ), + values_64bit ); + + buffer_offset += LIBHMAC_SHA512_BLOCK_SIZE; + + /* Extend to 80 x 64-bit values + */ + libhmac_sha512_context_transform_unfolded_extend_64bit_values( + values_64bit, + s0, + s1 ); + + /* Calculate the hash values for the 64-bit values + */ + libhmac_sha512_context_transform_unfolded_calculate_hash_values( + values_64bit, + hash_values, + s0, + s1, + t1, + t2 ); + + /* Update the hash values in the context + */ + internal_context->hash_values[ 0 ] += hash_values[ 0 ]; + internal_context->hash_values[ 1 ] += hash_values[ 1 ]; + internal_context->hash_values[ 2 ] += hash_values[ 2 ]; + internal_context->hash_values[ 3 ] += hash_values[ 3 ]; + internal_context->hash_values[ 4 ] += hash_values[ 4 ]; + internal_context->hash_values[ 5 ] += hash_values[ 5 ]; + internal_context->hash_values[ 6 ] += hash_values[ 6 ]; + internal_context->hash_values[ 7 ] += hash_values[ 7 ]; + +#else + /* Break the block into 16 x 64-bit values + */ + for( value_64bit_index = 0; + value_64bit_index < 16; + value_64bit_index++ ) + { + byte_stream_copy_to_uint64_big_endian( + &( buffer[ buffer_offset ] ), + values_64bit[ value_64bit_index ] ); + + buffer_offset += sizeof( uint64_t ); + } + /* Extend to 80 x 64-bit values + */ + for( value_64bit_index = 16; + value_64bit_index < 80; + value_64bit_index++ ) + { + libhmac_sha512_context_transform_extend_64bit_value( + values_64bit, + value_64bit_index, + s0, + s1 ); + } + /* Calculate the hash values for the 64-bit values + */ + for( value_64bit_index = 0; + value_64bit_index < 80; + value_64bit_index++ ) + { + s0 = byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 28 ) + ^ byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 34 ) + ^ byte_stream_bit_rotate_right_64bit( hash_values[ 0 ], 39 ); + s1 = byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 14 ) + ^ byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 18 ) + ^ byte_stream_bit_rotate_right_64bit( hash_values[ 4 ], 41 ); + + t1 = hash_values[ 7 ]; + t1 += s1; + t1 += ( hash_values[ 4 ] & hash_values[ 5 ] ) + ^ ( ~( hash_values[ 4 ] ) & hash_values[ 6 ] ); + t1 += libhmac_sha512_context_prime_cube_roots[ value_64bit_index ]; + t1 += values_64bit[ value_64bit_index ]; + t2 = s0; + t2 += ( hash_values[ 0 ] & hash_values[ 1 ] ) + ^ ( hash_values[ 0 ] & hash_values[ 2 ] ) + ^ ( hash_values[ 1 ] & hash_values[ 2 ] ); + + hash_values[ 7 ] = hash_values[ 6 ]; + hash_values[ 6 ] = hash_values[ 5 ]; + hash_values[ 5 ] = hash_values[ 4 ]; + hash_values[ 4 ] = hash_values[ 3 ] + t1; + hash_values[ 3 ] = hash_values[ 2 ]; + hash_values[ 2 ] = hash_values[ 1 ]; + hash_values[ 1 ] = hash_values[ 0 ]; + hash_values[ 0 ] = t1 + t2; + } + /* Update the hash values in the context + */ + for( hash_values_index = 0; + hash_values_index < 8; + hash_values_index++ ) + { + internal_context->hash_values[ hash_values_index ] += hash_values[ hash_values_index ]; + } +#endif /* defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + size -= LIBHMAC_SHA512_BLOCK_SIZE; + } + /* Prevent sensitive data from leaking + */ + if( memory_set( + hash_values, + 0, + sizeof( uint64_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear hash values.", + function ); + + goto on_error; + } + if( memory_set( + values_64bit, + 0, + sizeof( uint64_t ) * 80 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear 64-bit values.", + function ); + + goto on_error; + } + return( (ssize_t) buffer_offset ); + +on_error: + memory_set( + values_64bit, + 0, + sizeof( uint64_t ) * 80 ); + + memory_set( + hash_values, + 0, + sizeof( uint64_t ) * 8 ); + + return( -1 ); +} + +#endif /* !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) */ + +/* Creates a SHA-512 context + * Make sure the value context is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_initialize( + libhmac_sha512_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_initialize"; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) + const EVP_MD *evp_md_type = NULL; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid context value already set.", + function ); + + return( -1 ); + } + internal_context = memory_allocate_structure( + libhmac_internal_sha512_context_t ); + + if( internal_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to create context.", + function ); + + goto on_error; + } + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha512_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + memory_free( + internal_context ); + + return( -1 ); + } +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) + if( SHA512_Init( + &( internal_context->sha512_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + + goto on_error; + } + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX_init( + &( internal_context->internal_evp_md_context ) ); + + internal_context->evp_md_context = &( internal_context->internal_evp_md_context ); +#else + internal_context->evp_md_context = EVP_MD_CTX_new(); + + if( internal_context->evp_md_context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create EVP message digest context.", + function ); + + goto on_error; + } +#endif /* defined( HAVE_EVP_MD_CTX_INIT ) */ + +/* TODO use EVP_MD_fetch for EVP_DigestInit_ex2 */ + evp_md_type = EVP_sha512(); + +#if defined( HAVE_EVP_DIGESTINIT_EX2 ) + if( EVP_DigestInit_ex2( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#else + if( EVP_DigestInit_ex( + internal_context->evp_md_context, + evp_md_type, + NULL ) != 1 ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to initialize context.", + function ); + +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ); + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); +#endif + internal_context->evp_md_context = NULL; + + goto on_error; + } +#else + if( memory_copy( + internal_context->hash_values, + libhmac_sha512_context_prime_square_roots, + sizeof( uint64_t ) * 8 ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy initial hash values.", + function ); + + return( -1 ); + } +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) */ + + *context = (libhmac_sha512_context_t *) internal_context; + + return( 1 ); + +on_error: + if( internal_context != NULL ) + { + memory_free( + internal_context ); + } + return( -1 ); +} + +/* Frees a SHA-512 context + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_free( + libhmac_sha512_context_t **context, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_free"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + if( *context != NULL ) + { + internal_context = (libhmac_internal_sha512_context_t *) *context; + *context = NULL; + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) + /* No additional clean up necessary + */ + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) +#if defined( HAVE_EVP_MD_CTX_CLEANUP ) + if( EVP_MD_CTX_cleanup( + &( internal_context->internal_evp_md_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to clean up EVP message digest context.", + function ); + } + /* Make sure the error state is removed otherwise OpenSSL will leak memory + */ + ERR_remove_thread_state( + NULL ); +#else + EVP_MD_CTX_free( + internal_context->evp_md_context ); + +#endif /* defined( HAVE_EVP_MD_CTX_CLEANUP ) */ + + internal_context->evp_md_context = NULL; +#else + /* No additional clean up necessary + */ +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) */ + + memory_free( + internal_context ); + } + return( 1 ); +} + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) + +/* Updates the SHA-512 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_update( + libhmac_sha512_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_update"; + unsigned long safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha512_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } +#if ( SIZEOF_LONG < SIZEOF_SIZE_T ) + if( size > (size_t) ULONG_MAX ) +#else + if( size > (size_t) SSIZE_MAX ) +#endif + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + safe_hash_size = (unsigned long) size; + + if( SHA512_Update( + &( internal_context->sha512_context ), + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) + +/* Updates the SHA-512 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_update( + libhmac_sha512_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_update"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha512_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( EVP_DigestUpdate( + internal_context->evp_md_context, + (const void *) buffer, + size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to update context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Updates the SHA-512 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_update( + libhmac_sha512_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_update"; + size_t buffer_offset = 0; + size_t remaining_block_size = 0; + ssize_t process_count = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha512_context_t *) context; + + if( buffer == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid buffer.", + function ); + + return( -1 ); + } + if( size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid size value exceeds maximum.", + function ); + + return( -1 ); + } + if( size == 0 ) + { + return( 1 ); + } + if( internal_context->block_offset > 0 ) + { + if( internal_context->block_offset >= LIBHMAC_SHA512_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid context - block offset value out of bounds.", + function ); + + return( -1 ); + } + remaining_block_size = LIBHMAC_SHA512_BLOCK_SIZE - internal_context->block_offset; + + if( remaining_block_size > size ) + { + remaining_block_size = size; + } + if( memory_copy( + &( internal_context->block[ internal_context->block_offset ] ), + buffer, + remaining_block_size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset += remaining_block_size; + + if( internal_context->block_offset < LIBHMAC_SHA512_BLOCK_SIZE ) + { + return( 1 ); + } + buffer_offset += remaining_block_size; + size -= remaining_block_size; + + process_count = libhmac_sha512_context_transform( + internal_context, + internal_context->block, + LIBHMAC_SHA512_BLOCK_SIZE, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + internal_context->block_offset = 0; + } + if( size > 0 ) + { + process_count = libhmac_sha512_context_transform( + internal_context, + &( buffer[ buffer_offset ] ), + size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform buffer.", + function ); + + return( -1 ); + } + internal_context->hash_count += process_count; + + buffer_offset += process_count; + size -= process_count; + } + if( size > 0 ) + { + if( size >= LIBHMAC_SHA512_BLOCK_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid size value out of bounds.", + function ); + + return( -1 ); + } + if( memory_copy( + internal_context->block, + &( buffer[ buffer_offset ] ), + size ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to copy remaining data to context block.", + function ); + + return( -1 ); + } + internal_context->block_offset = size; + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) */ + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) + +/* Finalizes the SHA-512 context using OpenSSL + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_finalize( + libhmac_sha512_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_finalize"; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha512_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + if( SHA512_Final( + hash, + &( internal_context->sha512_context ) ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) + +/* Finalizes the SHA-512 context using OpenSSL EVP + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_finalize( + libhmac_sha512_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_finalize"; + unsigned int safe_hash_size = 0; + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha512_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( ( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) + || ( hash_size > (size_t) UINT_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid hash size value out of bounds.", + function ); + + return( -1 ); + } + safe_hash_size = (unsigned int) hash_size; + + if( EVP_DigestFinal_ex( + internal_context->evp_md_context, + (unsigned char *) hash, + &safe_hash_size ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to finalize context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#else + +/* Finalizes the SHA-512 context using fallback implementation + * Returns 1 if successful or -1 on error + */ +int libhmac_sha512_context_finalize( + libhmac_sha512_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ) +{ + libhmac_internal_sha512_context_t *internal_context = NULL; + static char *function = "libhmac_sha512_context_finalize"; + size_t block_size = 0; + size_t number_of_blocks = 0; + ssize_t process_count = 0; + uint64_t bit_size = 0; + +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + size_t hash_index = 0; + int hash_values_index = 0; +#endif + + if( context == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid context.", + function ); + + return( -1 ); + } + internal_context = (libhmac_internal_sha512_context_t *) context; + + if( hash == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid hash.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash value too small.", + function ); + + return( -1 ); + } + if( hash_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid hash size value exceeds maximum.", + function ); + + return( -1 ); + } + if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: invalid hash size value too small.", + function ); + + return( -1 ); + } + /* Add padding with a size of 120 mod 128 + */ + number_of_blocks = 1; + + if( internal_context->block_offset > 119 ) + { + number_of_blocks += 1; + } + block_size = number_of_blocks * LIBHMAC_SHA512_BLOCK_SIZE; + + if( memory_set( + &( internal_context->block[ internal_context->block_offset ] ), + 0, + block_size - internal_context->block_offset ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context block.", + function ); + + return( -1 ); + } + /* The first byte of the padding contains 0x80 + */ + internal_context->block[ internal_context->block_offset ] = 0x80; + + bit_size = ( internal_context->hash_count + internal_context->block_offset ) * 8; + + byte_stream_copy_from_uint64_big_endian( + &( internal_context->block[ block_size - 8 ] ), + bit_size ); + + process_count = libhmac_sha512_context_transform( + internal_context, + internal_context->block, + block_size, + error ); + + if( process_count == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to transform context block.", + function ); + + return( -1 ); + } +#if !defined( LIBHMAC_UNFOLLED_LOOPS ) + for( hash_values_index = 0; + hash_values_index < 8; + hash_values_index++ ) + { + byte_stream_copy_from_uint64_big_endian( + &( hash[ hash_index ] ), + internal_context->hash_values[ hash_values_index ] ); + + hash_index += sizeof( uint64_t ); + } +#else + byte_stream_copy_from_uint64_big_endian( + &( hash[ 0 ] ), + internal_context->hash_values[ 0 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 8 ] ), + internal_context->hash_values[ 1 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 16 ] ), + internal_context->hash_values[ 2 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 24 ] ), + internal_context->hash_values[ 3 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 32 ] ), + internal_context->hash_values[ 4 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 40 ] ), + internal_context->hash_values[ 5 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 48 ] ), + internal_context->hash_values[ 6 ] ); + + byte_stream_copy_from_uint64_big_endian( + &( hash[ 56 ] ), + internal_context->hash_values[ 7 ] ); + +#endif /* !defined( LIBHMAC_UNFOLLED_LOOPS ) */ + + /* Prevent sensitive data from leaking + */ + if( memory_set( + internal_context, + 0, + sizeof( libhmac_internal_sha512_context_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear context.", + function ); + + return( -1 ); + } + return( 1 ); +} + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) */ + diff -Nru libbde-20190102/libhmac/libhmac_sha512_context.h libbde-20240223/libhmac/libhmac_sha512_context.h --- libbde-20190102/libhmac/libhmac_sha512_context.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_sha512_context.h 2024-02-23 03:03:39.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * SHA-512 context functions + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBHMAC_SHA512_CONTEXT_H ) +#define _LIBHMAC_SHA512_CONTEXT_H + +#include +#include + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) +#include + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) +#include +#endif + +#include "libhmac_extern.h" +#include "libhmac_libcerror.h" +#include "libhmac_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) +#define LIBHMAC_HAVE_SHA512_SUPPORT + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) +#define LIBHMAC_HAVE_SHA512_SUPPORT + +#endif + +#define LIBHMAC_SHA512_BLOCK_SIZE 128 + +typedef struct libhmac_internal_sha512_context libhmac_internal_sha512_context_t; + +struct libhmac_internal_sha512_context +{ +#if defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) + /* The SHA-512 context + */ + SHA512_CTX sha512_context; + +#elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) + /* The EVP message digest context + */ +#if defined( HAVE_EVP_MD_CTX_INIT ) + EVP_MD_CTX internal_evp_md_context; +#endif + + EVP_MD_CTX *evp_md_context; + +#else + /* The number of bytes hashed + */ + uint64_t hash_count; + + /* The 64-bit hash values + */ + uint64_t hash_values[ 8 ]; + + /* The block offset + */ + size_t block_offset; + + /* The (data) block + */ + uint8_t block[ 2 * LIBHMAC_SHA512_BLOCK_SIZE ]; + +#endif /* defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) */ +}; + +#if !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) + +ssize_t libhmac_sha512_context_transform( + libhmac_internal_sha512_context_t *internal_context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +#endif /* !defined( LIBHMAC_HAVE_SHA512_SUPPORT ) */ + +LIBHMAC_EXTERN \ +int libhmac_sha512_context_initialize( + libhmac_sha512_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha512_context_free( + libhmac_sha512_context_t **context, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha512_context_update( + libhmac_sha512_context_t *context, + const uint8_t *buffer, + size_t size, + libcerror_error_t **error ); + +LIBHMAC_EXTERN \ +int libhmac_sha512_context_finalize( + libhmac_sha512_context_t *context, + uint8_t *hash, + size_t hash_size, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBHMAC_SHA512_CONTEXT_H ) */ + diff -Nru libbde-20190102/libhmac/libhmac_support.c libbde-20240223/libhmac/libhmac_support.c --- libbde-20190102/libhmac/libhmac_support.c 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_support.c 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libhmac/libhmac_support.h libbde-20240223/libhmac/libhmac_support.h --- libbde-20190102/libhmac/libhmac_support.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_support.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_SUPPORT_H ) diff -Nru libbde-20190102/libhmac/libhmac_types.h libbde-20240223/libhmac/libhmac_types.h --- libbde-20190102/libhmac/libhmac_types.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_types.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBHMAC_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libhmac/libhmac_unused.h libbde-20240223/libhmac/libhmac_unused.h --- libbde-20190102/libhmac/libhmac_unused.h 2019-01-02 15:57:31.000000000 +0000 +++ libbde-20240223/libhmac/libhmac_unused.h 2024-02-23 03:03:39.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2011-2018, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBHMAC_INTERNAL_UNUSED_H ) -#define _LIBHMAC_INTERNAL_UNUSED_H +#if !defined( _LIBHMAC_UNUSED_H ) +#define _LIBHMAC_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBHMAC_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBHMAC_UNUSED_H ) */ diff -Nru libbde-20190102/libuna/Makefile.am libbde-20240223/libuna/Makefile.am --- libbde-20190102/libuna/Makefile.am 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/Makefile.am 2024-02-23 03:03:41.000000000 +0000 @@ -26,6 +26,24 @@ libuna_codepage_iso_8859_16.c libuna_codepage_iso_8859_16.h \ libuna_codepage_koi8_r.c libuna_codepage_koi8_r.h \ libuna_codepage_koi8_u.c libuna_codepage_koi8_u.h \ + libuna_codepage_mac_arabic.c libuna_codepage_mac_arabic.h \ + libuna_codepage_mac_celtic.c libuna_codepage_mac_celtic.h \ + libuna_codepage_mac_centraleurroman.c libuna_codepage_mac_centraleurroman.h \ + libuna_codepage_mac_croatian.c libuna_codepage_mac_croatian.h \ + libuna_codepage_mac_cyrillic.c libuna_codepage_mac_cyrillic.h \ + libuna_codepage_mac_dingbats.c libuna_codepage_mac_dingbats.h \ + libuna_codepage_mac_farsi.c libuna_codepage_mac_farsi.h \ + libuna_codepage_mac_gaelic.c libuna_codepage_mac_gaelic.h \ + libuna_codepage_mac_greek.c libuna_codepage_mac_greek.h \ + libuna_codepage_mac_icelandic.c libuna_codepage_mac_icelandic.h \ + libuna_codepage_mac_inuit.c libuna_codepage_mac_inuit.h \ + libuna_codepage_mac_roman.c libuna_codepage_mac_roman.h \ + libuna_codepage_mac_romanian.c libuna_codepage_mac_romanian.h \ + libuna_codepage_mac_russian.c libuna_codepage_mac_russian.h \ + libuna_codepage_mac_symbol.c libuna_codepage_mac_symbol.h \ + libuna_codepage_mac_thai.c libuna_codepage_mac_thai.h \ + libuna_codepage_mac_turkish.c libuna_codepage_mac_turkish.h \ + libuna_codepage_mac_ukrainian.c libuna_codepage_mac_ukrainian.h \ libuna_codepage_windows_874.c libuna_codepage_windows_874.h \ libuna_codepage_windows_932.c libuna_codepage_windows_932.h \ libuna_codepage_windows_936.c libuna_codepage_windows_936.h \ @@ -44,6 +62,7 @@ libuna_error.c libuna_error.h \ libuna_extern.h \ libuna_libcerror.h \ + libuna_scsu.c libuna_scsu.h \ libuna_support.c libuna_support.h \ libuna_types.h \ libuna_unicode_character.c libuna_unicode_character.h \ @@ -62,9 +81,11 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile -splint: +sources-local: $(BUILT_SOURCES) + +splint-local: @echo "Running splint on libuna ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libuna_la_SOURCES) diff -Nru libbde-20190102/libuna/Makefile.in libbde-20240223/libuna/Makefile.in --- libbde-20190102/libuna/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/libuna/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = libuna ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -139,7 +139,27 @@ libuna_codepage_iso_8859_15.h libuna_codepage_iso_8859_16.c \ libuna_codepage_iso_8859_16.h libuna_codepage_koi8_r.c \ libuna_codepage_koi8_r.h libuna_codepage_koi8_u.c \ - libuna_codepage_koi8_u.h libuna_codepage_windows_874.c \ + libuna_codepage_koi8_u.h libuna_codepage_mac_arabic.c \ + libuna_codepage_mac_arabic.h libuna_codepage_mac_celtic.c \ + libuna_codepage_mac_celtic.h \ + libuna_codepage_mac_centraleurroman.c \ + libuna_codepage_mac_centraleurroman.h \ + libuna_codepage_mac_croatian.c libuna_codepage_mac_croatian.h \ + libuna_codepage_mac_cyrillic.c libuna_codepage_mac_cyrillic.h \ + libuna_codepage_mac_dingbats.c libuna_codepage_mac_dingbats.h \ + libuna_codepage_mac_farsi.c libuna_codepage_mac_farsi.h \ + libuna_codepage_mac_gaelic.c libuna_codepage_mac_gaelic.h \ + libuna_codepage_mac_greek.c libuna_codepage_mac_greek.h \ + libuna_codepage_mac_icelandic.c \ + libuna_codepage_mac_icelandic.h libuna_codepage_mac_inuit.c \ + libuna_codepage_mac_inuit.h libuna_codepage_mac_roman.c \ + libuna_codepage_mac_roman.h libuna_codepage_mac_romanian.c \ + libuna_codepage_mac_romanian.h libuna_codepage_mac_russian.c \ + libuna_codepage_mac_russian.h libuna_codepage_mac_symbol.c \ + libuna_codepage_mac_symbol.h libuna_codepage_mac_thai.c \ + libuna_codepage_mac_thai.h libuna_codepage_mac_turkish.c \ + libuna_codepage_mac_turkish.h libuna_codepage_mac_ukrainian.c \ + libuna_codepage_mac_ukrainian.h libuna_codepage_windows_874.c \ libuna_codepage_windows_874.h libuna_codepage_windows_932.c \ libuna_codepage_windows_932.h libuna_codepage_windows_936.c \ libuna_codepage_windows_936.h libuna_codepage_windows_949.c \ @@ -155,16 +175,16 @@ libuna_codepage_windows_1257.h libuna_codepage_windows_1258.c \ libuna_codepage_windows_1258.h libuna_definitions.h \ libuna_error.c libuna_error.h libuna_extern.h \ - libuna_libcerror.h libuna_support.c libuna_support.h \ - libuna_types.h libuna_unicode_character.c \ - libuna_unicode_character.h libuna_unused.h libuna_url_stream.c \ - libuna_url_stream.h libuna_utf16_stream.c \ - libuna_utf16_stream.h libuna_utf16_string.c \ - libuna_utf16_string.h libuna_utf32_stream.c \ - libuna_utf32_stream.h libuna_utf32_string.c \ - libuna_utf32_string.h libuna_utf7_stream.c \ - libuna_utf7_stream.h libuna_utf8_stream.c libuna_utf8_stream.h \ - libuna_utf8_string.c libuna_utf8_string.h + libuna_libcerror.h libuna_scsu.c libuna_scsu.h \ + libuna_support.c libuna_support.h libuna_types.h \ + libuna_unicode_character.c libuna_unicode_character.h \ + libuna_unused.h libuna_url_stream.c libuna_url_stream.h \ + libuna_utf16_stream.c libuna_utf16_stream.h \ + libuna_utf16_string.c libuna_utf16_string.h \ + libuna_utf32_stream.c libuna_utf32_stream.h \ + libuna_utf32_string.c libuna_utf32_string.h \ + libuna_utf7_stream.c libuna_utf7_stream.h libuna_utf8_stream.c \ + libuna_utf8_stream.h libuna_utf8_string.c libuna_utf8_string.h @HAVE_LOCAL_LIBUNA_TRUE@am_libuna_la_OBJECTS = \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base16_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_base32_stream.lo \ @@ -185,6 +205,24 @@ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_16.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_r.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_u.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_arabic.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_celtic.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_centraleurroman.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_croatian.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_cyrillic.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_dingbats.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_farsi.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_gaelic.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_greek.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_icelandic.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_inuit.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_roman.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_romanian.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_russian.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_symbol.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_thai.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_turkish.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_ukrainian.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_874.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_932.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_936.lo \ @@ -199,7 +237,8 @@ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1256.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1257.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_1258.lo \ -@HAVE_LOCAL_LIBUNA_TRUE@ libuna_error.lo libuna_support.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_error.lo libuna_scsu.lo \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_support.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_unicode_character.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_url_stream.lo \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_utf16_stream.lo \ @@ -249,6 +288,24 @@ ./$(DEPDIR)/libuna_codepage_iso_8859_9.Plo \ ./$(DEPDIR)/libuna_codepage_koi8_r.Plo \ ./$(DEPDIR)/libuna_codepage_koi8_u.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_arabic.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_celtic.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_centraleurroman.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_croatian.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_cyrillic.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_dingbats.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_farsi.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_gaelic.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_greek.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_icelandic.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_inuit.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_roman.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_romanian.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_russian.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_symbol.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_thai.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_turkish.Plo \ + ./$(DEPDIR)/libuna_codepage_mac_ukrainian.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1250.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1251.Plo \ ./$(DEPDIR)/libuna_codepage_windows_1252.Plo \ @@ -263,7 +320,8 @@ ./$(DEPDIR)/libuna_codepage_windows_936.Plo \ ./$(DEPDIR)/libuna_codepage_windows_949.Plo \ ./$(DEPDIR)/libuna_codepage_windows_950.Plo \ - ./$(DEPDIR)/libuna_error.Plo ./$(DEPDIR)/libuna_support.Plo \ + ./$(DEPDIR)/libuna_error.Plo ./$(DEPDIR)/libuna_scsu.Plo \ + ./$(DEPDIR)/libuna_support.Plo \ ./$(DEPDIR)/libuna_unicode_character.Plo \ ./$(DEPDIR)/libuna_url_stream.Plo \ ./$(DEPDIR)/libuna_utf16_stream.Plo \ @@ -299,6 +357,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -316,8 +375,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -334,6 +391,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -345,8 +408,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -364,7 +429,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -382,7 +446,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -436,8 +499,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -456,6 +517,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -466,8 +528,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -490,26 +552,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -518,7 +560,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -537,6 +578,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -579,9 +621,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -650,8 +689,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -674,11 +711,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -713,6 +747,24 @@ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_iso_8859_16.c libuna_codepage_iso_8859_16.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_r.c libuna_codepage_koi8_r.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_koi8_u.c libuna_codepage_koi8_u.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_arabic.c libuna_codepage_mac_arabic.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_celtic.c libuna_codepage_mac_celtic.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_centraleurroman.c libuna_codepage_mac_centraleurroman.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_croatian.c libuna_codepage_mac_croatian.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_cyrillic.c libuna_codepage_mac_cyrillic.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_dingbats.c libuna_codepage_mac_dingbats.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_farsi.c libuna_codepage_mac_farsi.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_gaelic.c libuna_codepage_mac_gaelic.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_greek.c libuna_codepage_mac_greek.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_icelandic.c libuna_codepage_mac_icelandic.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_inuit.c libuna_codepage_mac_inuit.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_roman.c libuna_codepage_mac_roman.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_romanian.c libuna_codepage_mac_romanian.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_russian.c libuna_codepage_mac_russian.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_symbol.c libuna_codepage_mac_symbol.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_thai.c libuna_codepage_mac_thai.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_turkish.c libuna_codepage_mac_turkish.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_mac_ukrainian.c libuna_codepage_mac_ukrainian.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_874.c libuna_codepage_windows_874.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_932.c libuna_codepage_windows_932.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_codepage_windows_936.c libuna_codepage_windows_936.h \ @@ -731,6 +783,7 @@ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_error.c libuna_error.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_extern.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_libcerror.h \ +@HAVE_LOCAL_LIBUNA_TRUE@ libuna_scsu.c libuna_scsu.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_support.c libuna_support.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_types.h \ @HAVE_LOCAL_LIBUNA_TRUE@ libuna_unicode_character.c libuna_unicode_character.h \ @@ -820,6 +873,24 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_iso_8859_9.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_koi8_r.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_koi8_u.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_arabic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_celtic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_centraleurroman.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_croatian.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_cyrillic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_dingbats.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_farsi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_gaelic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_greek.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_icelandic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_inuit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_roman.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_romanian.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_russian.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_symbol.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_thai.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_turkish.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_mac_ukrainian.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1250.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1251.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_1252.Plo@am__quote@ # am--include-marker @@ -835,6 +906,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_949.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_codepage_windows_950.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_error.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_scsu.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_support.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_unicode_character.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libuna_url_stream.Plo@am__quote@ # am--include-marker @@ -878,6 +950,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -930,7 +1004,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -1067,6 +1140,24 @@ -rm -f ./$(DEPDIR)/libuna_codepage_iso_8859_9.Plo -rm -f ./$(DEPDIR)/libuna_codepage_koi8_r.Plo -rm -f ./$(DEPDIR)/libuna_codepage_koi8_u.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_arabic.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_celtic.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_centraleurroman.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_croatian.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_cyrillic.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_dingbats.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_farsi.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_gaelic.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_greek.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_icelandic.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_inuit.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_roman.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_romanian.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_russian.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_symbol.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_thai.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_turkish.Plo + -rm -f ./$(DEPDIR)/libuna_codepage_mac_ukrainian.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1250.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1251.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_1252.Plo @@ -1082,6 +1173,7 @@ -rm -f ./$(DEPDIR)/libuna_codepage_windows_949.Plo -rm -f ./$(DEPDIR)/libuna_codepage_windows_950.Plo -rm -f ./$(DEPDIR)/libuna_error.Plo + -rm -f ./$(DEPDIR)/libuna_scsu.Plo -rm -f ./$(DEPDIR)/libuna_support.Plo -rm -f ./$(DEPDIR)/libuna_unicode_character.Plo -rm -f ./$(DEPDIR)/libuna_url_stream.Plo @@ -1108,6 +1200,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -1124,15 +1224,18 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile + +sources-local: $(BUILT_SOURCES) -splint: +splint-local: @echo "Running splint on libuna ..." -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libuna_la_SOURCES) diff -Nru libbde-20190102/libuna/libuna_base16_stream.c libbde-20240223/libuna/libuna_base16_stream.c --- libbde-20190102/libuna/libuna_base16_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_base16_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Base16 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_base16_stream.h libbde-20240223/libuna/libuna_base16_stream.h --- libbde-20190102/libuna/libuna_base16_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_base16_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Base16 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_BASE16_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_base32_stream.c libbde-20240223/libuna/libuna_base32_stream.c --- libbde-20190102/libuna/libuna_base32_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_base32_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Base32 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_base32_stream.h libbde-20240223/libuna/libuna_base32_stream.h --- libbde-20190102/libuna/libuna_base32_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_base32_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Base32 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_BASE32_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_base64_stream.c libbde-20240223/libuna/libuna_base64_stream.c --- libbde-20190102/libuna/libuna_base64_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_base64_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Base64 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -221,17 +221,6 @@ return( -1 ); } - if( *base64_stream_index >= base64_stream_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: base64 stream string too small.", - function ); - - return( -1 ); - } if( padding_size == NULL ) { libcerror_error_set( @@ -289,13 +278,14 @@ } safe_base64_stream_index = *base64_stream_index; - if( ( safe_base64_stream_index + base64_character_size ) > base64_stream_size ) + if( ( base64_character_size > base64_stream_size ) + || ( safe_base64_stream_index > ( base64_stream_size - base64_character_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: missing 1st base64 character.", + "%s: base64 stream string too small - missing 1st base64 character.", function ); return( -1 ); @@ -360,13 +350,14 @@ return( -1 ); } - if( ( safe_base64_stream_index + base64_character_size ) > base64_stream_size ) + if( ( base64_character_size > base64_stream_size ) + || ( safe_base64_stream_index > ( base64_stream_size - base64_character_size ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: missing 2nd base64 character.", + "%s: base64 stream string too small - missing 2nd base64 character.", function ); return( -1 ); @@ -433,7 +424,22 @@ } safe_padding_size = 2; - if( ( safe_base64_stream_index + base64_character_size ) <= base64_stream_size ) + if( ( base64_character_size > base64_stream_size ) + || ( safe_base64_stream_index > ( base64_stream_size - base64_character_size ) ) ) + { + if( ( base64_variant & 0x0f000000UL ) == LIBUNA_BASE64_VARIANT_PADDING_REQUIRED ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: base64 stream string too small - missing 3rd base64 character.", + function ); + + return( -1 ); + } + } + else { switch( base64_variant & 0xf0000000UL ) { @@ -531,18 +537,22 @@ } } } - else if( ( base64_variant & 0x0f000000UL ) != LIBUNA_BASE64_VARIANT_PADDING_NONE ) + if( ( base64_character_size > base64_stream_size ) + || ( safe_base64_stream_index > ( base64_stream_size - base64_character_size ) ) ) { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: missing 3rd base64 character.", - function ); + if( ( base64_variant & 0x0f000000UL ) == LIBUNA_BASE64_VARIANT_PADDING_REQUIRED ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: base64 stream string too small - missing 4th base64 character.", + function ); - return( -1 ); + return( -1 ); + } } - if( ( safe_base64_stream_index + base64_character_size ) <= base64_stream_size ) + else { switch( base64_variant & 0xf0000000UL ) { @@ -651,17 +661,6 @@ } } } - else if( ( base64_variant & 0x0f000000UL ) != LIBUNA_BASE64_VARIANT_PADDING_NONE ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: missing 4th base64 character.", - function ); - - return( -1 ); - } safe_base64_triplet = sixtet1; safe_base64_triplet <<= 6; safe_base64_triplet |= sixtet2; diff -Nru libbde-20190102/libuna/libuna_base64_stream.h libbde-20240223/libuna/libuna_base64_stream.h --- libbde-20190102/libuna/libuna_base64_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_base64_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Base64 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_BASE64_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_byte_stream.c libbde-20240223/libuna/libuna_byte_stream.c --- libbde-20190102/libuna/libuna_byte_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_byte_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Byte stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_byte_stream.h libbde-20240223/libuna/libuna_byte_stream.h --- libbde-20190102/libuna/libuna_byte_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_byte_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Byte stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_BYTE_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_10.c libbde-20240223/libuna/libuna_codepage_iso_8859_10.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_10.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_10.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-10 codepage (Nordic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_10.h libbde-20240223/libuna/libuna_codepage_iso_8859_10.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_10.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_10.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-10 codepage (Nordic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_10_H ) @@ -25,14 +25,20 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ 144 ]; -extern const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ 144 ]; -extern const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ 16 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ 16 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_13.c libbde-20240223/libuna/libuna_codepage_iso_8859_13.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_13.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_13.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-13 codepage (Baltic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_13.h libbde-20240223/libuna/libuna_codepage_iso_8859_13.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_13.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_13.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-13 codepage (Baltic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_13_H ) @@ -25,14 +25,20 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ 224 ]; -extern const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ 224 ]; -extern const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ 8 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ 8 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_14.c libbde-20240223/libuna/libuna_codepage_iso_8859_14.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_14.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_14.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-14 codepage (Celtic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_14.h libbde-20240223/libuna/libuna_codepage_iso_8859_14.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_14.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_14.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-14 codepage (Celtic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_14_H ) @@ -25,15 +25,23 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ 64 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ 64 ]; -extern const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ 8 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ 8 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_15.c libbde-20240223/libuna/libuna_codepage_iso_8859_15.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_15.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_15.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-15 codepage (Latin 9) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_15.h libbde-20240223/libuna/libuna_codepage_iso_8859_15.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_15.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_15.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-15 codepage (Latin 9) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_15_H ) @@ -25,13 +25,17 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ 32 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ 32 ]; -extern const uint8_t libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ 32 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ 32 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_16.c libbde-20240223/libuna/libuna_codepage_iso_8859_16.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_16.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_16.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-16 codepage (Latin 10) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_16.h libbde-20240223/libuna/libuna_codepage_iso_8859_16.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_16.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_16.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-16 codepage (Latin 10) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_16_H ) @@ -25,17 +25,29 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ 8 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ 8 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ 96 ]; -extern const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ 8 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ 8 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_2.c libbde-20240223/libuna/libuna_codepage_iso_8859_2.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_2.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_2.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-2 codepage (Central European) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_2.h libbde-20240223/libuna/libuna_codepage_iso_8859_2.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_2.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_2.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-2 codepage (Central European) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_2_H ) @@ -25,15 +25,23 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ 128 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ 72 ]; -extern const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ 128 ]; -extern const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ 72 ]; -extern const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ 8 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ 8 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_3.c libbde-20240223/libuna/libuna_codepage_iso_8859_3.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_3.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_3.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-3 codepage (Latin 3) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_3.h libbde-20240223/libuna/libuna_codepage_iso_8859_3.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_3.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_3.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-3 codepage (Latin 3) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_3_H ) @@ -25,17 +25,29 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ 8 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ 16 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ 96 ]; -extern const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ 16 ]; -extern const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ 8 ]; -extern const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ 8 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ 8 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_4.c libbde-20240223/libuna/libuna_codepage_iso_8859_4.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_4.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_4.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-4 codepage (Baltic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_4.h libbde-20240223/libuna/libuna_codepage_iso_8859_4.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_4.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_4.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-4 codepage (Baltic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_4_H ) @@ -25,14 +25,20 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ 184 ]; -extern const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ 184 ]; -extern const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ 32 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ 32 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_5.c libbde-20240223/libuna/libuna_codepage_iso_8859_5.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_5.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_5.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-5 codepage (Cyrillic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_5.h libbde-20240223/libuna/libuna_codepage_iso_8859_5.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_5.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_5.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-5 codepage (Cyrillic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_5_H ) @@ -25,13 +25,17 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ 96 ]; -extern const uint8_t libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ 96 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_6.c libbde-20240223/libuna/libuna_codepage_iso_8859_6.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_6.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_6.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-6 codepage (Arabic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_6.h libbde-20240223/libuna/libuna_codepage_iso_8859_6.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_6.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_6.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-6 codepage (Arabic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_6_H ) @@ -25,13 +25,17 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ 96 ]; -extern const uint8_t libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ 64 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ 64 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_7.c libbde-20240223/libuna/libuna_codepage_iso_8859_7.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_7.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_7.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-7 codepage (Greek) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_7.h libbde-20240223/libuna/libuna_codepage_iso_8859_7.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_7.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_7.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-7 codepage (Greek) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_7_H ) @@ -25,14 +25,20 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ 24 ]; -extern const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ 24 ]; -extern const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ 80 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ 80 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_8.c libbde-20240223/libuna/libuna_codepage_iso_8859_8.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_8.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_8.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-8 codepage (Hebrew) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_8.h libbde-20240223/libuna/libuna_codepage_iso_8859_8.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_8.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_8.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-8 codepage (Hebrew) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_8_H ) @@ -25,14 +25,20 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ 96 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ 96 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ 32 ]; -extern const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ 32 ]; -extern const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ 32 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ 32 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_9.c libbde-20240223/libuna/libuna_codepage_iso_8859_9.c --- libbde-20190102/libuna/libuna_codepage_iso_8859_9.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_9.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-9 codepage (Turkish) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_codepage_iso_8859_9.h libbde-20240223/libuna/libuna_codepage_iso_8859_9.h --- libbde-20190102/libuna/libuna_codepage_iso_8859_9.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_iso_8859_9.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * ISO 8859-9 codepage (Turkish) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_ISO_8859_9_H ) @@ -25,13 +25,17 @@ #include #include +#include "libuna_extern.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ 48 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint16_t libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ 48 ]; -extern const uint8_t libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ 48 ]; +LIBUNA_EXTERN_VARIABLE \ +const uint8_t libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ 48 ]; #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_koi8_r.c libbde-20240223/libuna/libuna_codepage_koi8_r.c --- libbde-20190102/libuna/libuna_codepage_koi8_r.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_koi8_r.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * KOI8-R codepage (Russian Cyrillic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_koi8_r.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for KOI8-R codepage +/* Extended ASCII to Unicode character lookup table for the KOI8-R codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }; -/* Unicode to ASCII character lookup table for KOI8-R codepage +/* Unicode to ASCII character lookup tables for the KOI8-R codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ 64 ] = { @@ -67,3 +69,324 @@ 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0x1a, 0x1a, 0x1a }; +/* Copies an Unicode character from a KOI8-R encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_koi8_r_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_koi8_r_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a KOI8-R encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_koi8_r_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_koi8_r_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0410 ) + && ( unicode_character < 0x0450 ) ) + { + unicode_character -= 0x0410; + + byte_stream_value = libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ unicode_character ]; + } + else if( ( unicode_character >= 0x2550 ) + && ( unicode_character < 0x2570 ) ) + { + unicode_character -= 0x2550; + + byte_stream_value = libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x2550[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00a0: + byte_stream_value = 0x9a; + break; + + case 0x00a9: + byte_stream_value = 0xbf; + break; + + case 0x00b0: + byte_stream_value = 0x9c; + break; + + case 0x00b2: + byte_stream_value = 0x9d; + break; + + case 0x00b7: + byte_stream_value = 0x9e; + break; + + case 0x00f7: + byte_stream_value = 0x9f; + break; + + case 0x0401: + byte_stream_value = 0xb3; + break; + + case 0x0451: + byte_stream_value = 0xa3; + break; + + case 0x2219: + byte_stream_value = 0x95; + break; + + case 0x221a: + byte_stream_value = 0x96; + break; + + case 0x2248: + byte_stream_value = 0x97; + break; + + case 0x2264: + byte_stream_value = 0x98; + break; + + case 0x2265: + byte_stream_value = 0x99; + break; + + case 0x2320: + byte_stream_value = 0x93; + break; + + case 0x2321: + byte_stream_value = 0x9b; + break; + + case 0x2500: + byte_stream_value = 0x80; + break; + + case 0x2502: + byte_stream_value = 0x81; + break; + + case 0x250c: + byte_stream_value = 0x82; + break; + + case 0x2510: + byte_stream_value = 0x83; + break; + + case 0x2514: + byte_stream_value = 0x84; + break; + + case 0x2518: + byte_stream_value = 0x85; + break; + + case 0x251c: + byte_stream_value = 0x86; + break; + + case 0x2524: + byte_stream_value = 0x87; + break; + + case 0x252c: + byte_stream_value = 0x88; + break; + + case 0x2534: + byte_stream_value = 0x89; + break; + + case 0x253c: + byte_stream_value = 0x8a; + break; + + case 0x2580: + byte_stream_value = 0x8b; + break; + + case 0x2584: + byte_stream_value = 0x8c; + break; + + case 0x2588: + byte_stream_value = 0x8d; + break; + + case 0x258c: + byte_stream_value = 0x8e; + break; + + case 0x2590: + byte_stream_value = 0x8f; + break; + + case 0x2591: + byte_stream_value = 0x90; + break; + + case 0x2592: + byte_stream_value = 0x91; + break; + + case 0x2593: + byte_stream_value = 0x92; + break; + + case 0x25a0: + byte_stream_value = 0x94; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_koi8_r.h libbde-20240223/libuna/libuna_codepage_koi8_r.h --- libbde-20190102/libuna/libuna_codepage_koi8_r.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_koi8_r.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * KOI8-R codepage (Russian Cyrillic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_KOI8_R_H ) @@ -25,14 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ 64 ]; -extern const uint8_t libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x2550[ 32 ]; +int libuna_codepage_koi8_r_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_koi8_r_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_koi8_u.c libbde-20240223/libuna/libuna_codepage_koi8_u.c --- libbde-20190102/libuna/libuna_codepage_koi8_u.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_koi8_u.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * KOI8-U codepage (Ukrainian Cyrillic) function * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_koi8_u.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for KOI8-U codepage +/* Extended ASCII to Unicode character lookup table for the KOI8-U codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a }; -/* Unicode to ASCII character lookup table for KOI8-U codepage +/* Unicode to ASCII character lookup tables for the KOI8-U codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ 64 ] = { @@ -67,3 +69,356 @@ 0xba, 0xbb, 0xbc, 0x1a, 0xbe, 0x1a, 0x1a, 0x1a }; +/* Copies an Unicode character from a KOI8-U encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_koi8_u_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_koi8_u_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a KOI8-U encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_koi8_u_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_koi8_u_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0410 ) + && ( unicode_character < 0x0450 ) ) + { + unicode_character -= 0x0410; + + byte_stream_value = libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ unicode_character ]; + } + else if( ( unicode_character >= 0x2550 ) + && ( unicode_character < 0x2570 ) ) + { + unicode_character -= 0x2550; + + byte_stream_value = libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x2550[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00a0: + byte_stream_value = 0x9a; + break; + + case 0x00a9: + byte_stream_value = 0xbf; + break; + + case 0x00b0: + byte_stream_value = 0x9c; + break; + + case 0x00b2: + byte_stream_value = 0x9d; + break; + + case 0x00b7: + byte_stream_value = 0x9e; + break; + + case 0x00f7: + byte_stream_value = 0x9f; + break; + + case 0x0401: + byte_stream_value = 0xb3; + break; + + case 0x0404: + byte_stream_value = 0xb4; + break; + + case 0x0406: + byte_stream_value = 0xb6; + break; + + case 0x0407: + byte_stream_value = 0xb7; + break; + + case 0x0451: + byte_stream_value = 0xa3; + break; + + case 0x0454: + byte_stream_value = 0xa4; + break; + + case 0x0456: + byte_stream_value = 0xa6; + break; + + case 0x0457: + byte_stream_value = 0xa7; + break; + + case 0x0490: + byte_stream_value = 0xbd; + break; + + case 0x0491: + byte_stream_value = 0xad; + break; + + case 0x2219: + byte_stream_value = 0x95; + break; + + case 0x221a: + byte_stream_value = 0x96; + break; + + case 0x2248: + byte_stream_value = 0x97; + break; + + case 0x2264: + byte_stream_value = 0x98; + break; + + case 0x2265: + byte_stream_value = 0x99; + break; + + case 0x2320: + byte_stream_value = 0x93; + break; + + case 0x2321: + byte_stream_value = 0x9b; + break; + + case 0x2500: + byte_stream_value = 0x80; + break; + + case 0x2502: + byte_stream_value = 0x81; + break; + + case 0x250c: + byte_stream_value = 0x82; + break; + + case 0x2510: + byte_stream_value = 0x83; + break; + + case 0x2514: + byte_stream_value = 0x84; + break; + + case 0x2518: + byte_stream_value = 0x85; + break; + + case 0x251c: + byte_stream_value = 0x86; + break; + + case 0x2524: + byte_stream_value = 0x87; + break; + + case 0x252c: + byte_stream_value = 0x88; + break; + + case 0x2534: + byte_stream_value = 0x89; + break; + + case 0x253c: + byte_stream_value = 0x8a; + break; + + case 0x2580: + byte_stream_value = 0x8b; + break; + + case 0x2584: + byte_stream_value = 0x8c; + break; + + case 0x2588: + byte_stream_value = 0x8d; + break; + + case 0x258c: + byte_stream_value = 0x8e; + break; + + case 0x2590: + byte_stream_value = 0x8f; + break; + + case 0x2591: + byte_stream_value = 0x90; + break; + + case 0x2592: + byte_stream_value = 0x91; + break; + + case 0x2593: + byte_stream_value = 0x92; + break; + + case 0x25a0: + byte_stream_value = 0x94; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_koi8_u.h libbde-20240223/libuna/libuna_codepage_koi8_u.h --- libbde-20190102/libuna/libuna_codepage_koi8_u.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_koi8_u.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * KOI8-U codepage (Ukrainian Cyrillic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_KOI8_U_H ) @@ -25,14 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ 64 ]; -extern const uint8_t libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x2550[ 32 ]; +int libuna_codepage_koi8_u_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_koi8_u_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_mac_arabic.c libbde-20240223/libuna/libuna_codepage_mac_arabic.c --- libbde-20190102/libuna/libuna_codepage_mac_arabic.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_arabic.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,352 @@ +/* + * MacArabic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_arabic.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacArabic codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_arabic_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00a0, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x06ba, 0x00ab, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x2026, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00bb, 0x00f4, 0x00f6, 0x00f7, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x066a, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002a, 0x002b, 0x060c, 0x002d, 0x002e, 0x002f, + 0x0660, 0x0661, 0x0662, 0x0663, 0x0664, 0x0665, 0x0666, 0x0667, + 0x0668, 0x0669, 0x003a, 0x061b, 0x003c, 0x003d, 0x003e, 0x061f, + 0x274a, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, + 0x0638, 0x0639, 0x063a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, + 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, + 0x0650, 0x0651, 0x0652, 0x067e, 0x0679, 0x0686, 0x06d5, 0x06a4, + 0x06af, 0x0688, 0x0691, 0x007b, 0x007c, 0x007d, 0x0698, 0x06d2 +}; + +/* Unicode to ASCII character lookup tables for the MacArabic codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_arabic_unicode_to_byte_stream_base_0x0020[ 32 ] = { + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0x25, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0x2c, 0xad, 0xae, 0xaf, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0xba, 0x3b, 0xbc, 0xbd, 0xbe, 0x3f +}; + +const uint8_t libuna_codepage_mac_arabic_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0x81, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x8c, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x98, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x80, 0x1a, 0x1a, 0x82, + 0x1a, 0x83, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x84, 0x1a, 0x1a, 0x1a, 0x1a, 0x85, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x86, 0x1a, 0x1a, 0x1a, + 0x88, 0x87, 0x89, 0x1a, 0x8a, 0x1a, 0x1a, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x1a, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x1a, 0x97, 0x99, 0x1a, 0x9a, 0x9b, + 0x1a, 0x9d, 0x9c, 0x9e, 0x9f, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_arabic_unicode_to_byte_stream_base_0x0608[ 184 ] = { + 0x1a, 0x1a, 0x1a, 0x1a, 0xac, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0xbb, 0x1a, 0x1a, 0x1a, 0xbf, + 0x1a, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xa5, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xf4, 0x1a, 0x1a, 0x1a, 0x1a, 0xf3, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf5, 0x1a, + 0xf9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xfe, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0xf7, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf8, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x8b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacArabic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_arabic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_arabic_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_arabic_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacArabic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_arabic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_arabic_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0020 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0020 ) + && ( unicode_character < 0x0040 ) ) + { + unicode_character -= 0x0020; + + byte_stream_value = libuna_codepage_mac_arabic_unicode_to_byte_stream_base_0x0020[ unicode_character ]; + } + else if( ( unicode_character >= 0x0040 ) + && ( unicode_character < 0x005b ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0060 ) + && ( unicode_character < 0x007b ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x007e ) + && ( unicode_character < 0x0080 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_arabic_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0608 ) + && ( unicode_character < 0x06c0 ) ) + { + unicode_character -= 0x0608; + + byte_stream_value = libuna_codepage_mac_arabic_unicode_to_byte_stream_base_0x0608[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x005b: + byte_stream_value = 0xdb; + break; + + case 0x005c: + byte_stream_value = 0xdc; + break; + + case 0x005d: + byte_stream_value = 0xdd; + break; + + case 0x005e: + byte_stream_value = 0xde; + break; + + case 0x005f: + byte_stream_value = 0xdf; + break; + + case 0x007b: + byte_stream_value = 0xfb; + break; + + case 0x007c: + byte_stream_value = 0xfc; + break; + + case 0x007d: + byte_stream_value = 0xfd; + break; + + case 0x06d2: + byte_stream_value = 0xff; + break; + + case 0x06d5: + byte_stream_value = 0xf6; + break; + + case 0x2026: + byte_stream_value = 0x93; + break; + + case 0x274a: + byte_stream_value = 0xc0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_arabic.h libbde-20240223/libuna/libuna_codepage_mac_arabic.h --- libbde-20190102/libuna/libuna_codepage_mac_arabic.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_arabic.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacArabic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_ARABIC_H ) +#define _LIBUNA_CODEPAGE_MAC_ARABIC_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_arabic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_arabic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_ARABIC_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_celtic.c libbde-20240223/libuna/libuna_codepage_mac_celtic.c --- libbde-20190102/libuna/libuna_codepage_mac_celtic.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_celtic.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,395 @@ +/* + * MacCeltic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_celtic.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacCeltic codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_celtic_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, + 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, + 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0x00ff, 0x0178, 0x2044, 0x20ac, 0x2039, 0x203a, 0x0176, 0x0177, + 0x2021, 0x00b7, 0x1ef2, 0x1ef3, 0x2030, 0x00c2, 0x00ca, 0x00c1, + 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0x2663, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x00dd, 0x00fd, + 0x0174, 0x0175, 0x1e84, 0x1e85, 0x1e80, 0x1e81, 0x1e82, 0x1e83 +}; + +/* Unicode to ASCII character lookup tables for the MacCeltic codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_celtic_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0xca, 0xc1, 0xa2, 0xa3, 0x1a, 0xb4, 0x1a, 0xa4, + 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x1a, 0xa8, 0x1a, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0xb5, 0xa6, 0xe1, + 0x1a, 0x1a, 0xbc, 0xc8, 0x1a, 0x1a, 0x1a, 0xc0, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, + 0x1a, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xf6, 0x1a, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xf7, 0x1a, 0xd8 +}; + +const uint8_t libuna_codepage_mac_celtic_unicode_to_byte_stream_base_0x2010[ 56 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0x1a, 0x1a, + 0xa0, 0xe0, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xdc, 0xdd, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0xda, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacCeltic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_celtic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_celtic_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_celtic_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacCeltic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_celtic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_celtic_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_celtic_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2048 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_celtic_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0131: + byte_stream_value = 0xf5; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x0174: + byte_stream_value = 0xf8; + break; + + case 0x0175: + byte_stream_value = 0xf9; + break; + + case 0x0176: + byte_stream_value = 0xde; + break; + + case 0x0177: + byte_stream_value = 0xdf; + break; + + case 0x0178: + byte_stream_value = 0xd9; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x03a9: + byte_stream_value = 0xbd; + break; + + case 0x03c0: + byte_stream_value = 0xb9; + break; + + case 0x1e80: + byte_stream_value = 0xfc; + break; + + case 0x1e81: + byte_stream_value = 0xfd; + break; + + case 0x1e82: + byte_stream_value = 0xfe; + break; + + case 0x1e83: + byte_stream_value = 0xff; + break; + + case 0x1e84: + byte_stream_value = 0xfa; + break; + + case 0x1e85: + byte_stream_value = 0xfb; + break; + + case 0x1ef2: + byte_stream_value = 0xe2; + break; + + case 0x1ef3: + byte_stream_value = 0xe3; + break; + + case 0x20ac: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x220f: + byte_stream_value = 0xb8; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x222b: + byte_stream_value = 0xba; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + case 0x2663: + byte_stream_value = 0xf0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_celtic.h libbde-20240223/libuna/libuna_codepage_mac_celtic.h --- libbde-20190102/libuna/libuna_codepage_mac_celtic.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_celtic.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacCeltic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_CELTIC_H ) +#define _LIBUNA_CODEPAGE_MAC_CELTIC_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_celtic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_celtic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_CELTIC_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_centraleurroman.c libbde-20240223/libuna/libuna_codepage_mac_centraleurroman.c --- libbde-20190102/libuna/libuna_codepage_mac_centraleurroman.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_centraleurroman.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,319 @@ +/* + * MacCentralEurRoman codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_centraleurroman.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacCentralEurRoman codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_centraleurroman_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x0100, 0x0101, 0x00c9, 0x0104, 0x00d6, 0x00dc, 0x00e1, + 0x0105, 0x010c, 0x00e4, 0x010d, 0x0106, 0x0107, 0x00e9, 0x0179, + 0x017a, 0x010e, 0x00ed, 0x010f, 0x0112, 0x0113, 0x0116, 0x00f3, + 0x0117, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x011a, 0x011b, 0x00fc, + 0x2020, 0x00b0, 0x0118, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x0119, 0x00a8, 0x2260, 0x0123, 0x012e, + 0x012f, 0x012a, 0x2264, 0x2265, 0x012b, 0x0136, 0x2202, 0x2211, + 0x0142, 0x013b, 0x013c, 0x013d, 0x013e, 0x0139, 0x013a, 0x0145, + 0x0146, 0x0143, 0x00ac, 0x221a, 0x0144, 0x0147, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x0148, 0x0150, 0x00d5, 0x0151, 0x014c, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0x014d, 0x0154, 0x0155, 0x0158, 0x2039, 0x203a, 0x0159, 0x0156, + 0x0157, 0x0160, 0x201a, 0x201e, 0x0161, 0x015a, 0x015b, 0x00c1, + 0x0164, 0x0165, 0x00cd, 0x017d, 0x017e, 0x016a, 0x00d3, 0x00d4, + 0x016b, 0x016e, 0x00da, 0x016f, 0x0170, 0x0171, 0x0172, 0x0173, + 0x00dd, 0x00fd, 0x0137, 0x017b, 0x0141, 0x017c, 0x0122, 0x02c7 +}; + +/* Unicode to ASCII character lookup tables for the MacCentralEurRoman codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_centraleurroman_unicode_to_byte_stream_base_0x00a0[ 224 ] = { + 0xca, 0x1a, 0x1a, 0xa3, 0x1a, 0x1a, 0x1a, 0xa4, + 0xac, 0xa9, 0x1a, 0xc7, 0xc2, 0x1a, 0xa8, 0x1a, + 0xa1, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xa6, 0x1a, + 0x1a, 0x1a, 0x1a, 0xc8, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xe7, 0x1a, 0x1a, 0x80, 0x1a, 0x1a, 0x1a, + 0x1a, 0x83, 0x1a, 0x1a, 0x1a, 0xea, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0x1a, 0x1a, 0xf2, 0x1a, 0x86, 0xf8, 0x1a, 0xa7, + 0x1a, 0x87, 0x1a, 0x1a, 0x8a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x8e, 0x1a, 0x1a, 0x1a, 0x92, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0x1a, 0x1a, 0x9c, 0x1a, 0x9f, 0xf9, 0x1a, 0x1a, + 0x81, 0x82, 0x1a, 0x1a, 0x84, 0x88, 0x8c, 0x8d, + 0x1a, 0x1a, 0x1a, 0x1a, 0x89, 0x8b, 0x91, 0x93, + 0x1a, 0x1a, 0x94, 0x95, 0x1a, 0x1a, 0x96, 0x98, + 0xa2, 0xab, 0x9d, 0x9e, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0xfe, 0xae, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0xb1, 0xb4, 0x1a, 0x1a, 0xaf, 0xb0, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xb5, 0xfa, + 0x1a, 0xbd, 0xbe, 0xb9, 0xba, 0xbb, 0xbc, 0x1a, + 0x1a, 0xfc, 0xb8, 0xc1, 0xc4, 0xbf, 0xc0, 0xc5, + 0xcb, 0x1a, 0x1a, 0x1a, 0xcf, 0xd8, 0x1a, 0x1a, + 0xcc, 0xce, 0x1a, 0x1a, 0xd9, 0xda, 0xdf, 0xe0, + 0xdb, 0xde, 0xe5, 0xe6, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe1, 0xe4, 0x1a, 0x1a, 0xe8, 0xe9, 0x1a, 0x1a, + 0x1a, 0x1a, 0xed, 0xf0, 0x1a, 0x1a, 0xf1, 0xf3, + 0xf4, 0xf5, 0xf6, 0xf7, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x8f, 0x90, 0xfb, 0xfd, 0xeb, 0xec, 0x1a +}; + +const uint8_t libuna_codepage_mac_centraleurroman_unicode_to_byte_stream_base_0x2010[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0xe2, 0x1a, 0xd2, 0xd3, 0xe3, 0x1a, + 0xa0, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a +}; + +/* Copies an Unicode character from a MacCentralEurRoman encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_centraleurroman_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_centraleurroman_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_centraleurroman_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacCentralEurRoman encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_centraleurroman_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_centraleurroman_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0180 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_centraleurroman_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_centraleurroman_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x02c7: + byte_stream_value = 0xff; + break; + + case 0x2039: + byte_stream_value = 0xdc; + break; + + case 0x203a: + byte_stream_value = 0xdd; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_centraleurroman.h libbde-20240223/libuna/libuna_codepage_mac_centraleurroman.h --- libbde-20190102/libuna/libuna_codepage_mac_centraleurroman.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_centraleurroman.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacCentralEurRoman codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN_H ) +#define _LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_centraleurroman_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_centraleurroman_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_croatian.c libbde-20240223/libuna/libuna_codepage_mac_croatian.c --- libbde-20190102/libuna/libuna_codepage_mac_croatian.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_croatian.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,378 @@ +/* + * MacCroatian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_croatian.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacCroatian codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_croatian_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x0160, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x017d, 0x00d8, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x2206, 0x00b5, 0x2202, 0x2211, + 0x220f, 0x0161, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x017e, 0x00f8, + 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x0106, 0x00ab, + 0x010c, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x0110, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0xf8ff, 0x00a9, 0x2044, 0x20ac, 0x2039, 0x203a, 0x00c6, 0x00bb, + 0x2013, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x0107, 0x00c1, + 0x010d, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0x0111, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, + 0x00af, 0x03c0, 0x00cb, 0x02da, 0x00b8, 0x00ca, 0x00e6, 0x02c7 +}; + +/* Unicode to ASCII character lookup tables for the MacCroatian codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_croatian_unicode_to_byte_stream_base_0x00a0[ 120 ] = { + 0xca, 0xc1, 0xa2, 0xa3, 0x1a, 0x1a, 0x1a, 0xa4, + 0xac, 0xd9, 0xbb, 0xc7, 0xc2, 0x1a, 0xa8, 0xf8, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0xb5, 0xa6, 0xe1, + 0xfc, 0x1a, 0xbc, 0xdf, 0x1a, 0x1a, 0x1a, 0xc0, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xde, 0x82, + 0xe9, 0x83, 0xfd, 0xfa, 0xed, 0xea, 0xeb, 0xec, + 0x1a, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x1a, 0x1a, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xfe, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc6, 0xe6, + 0x1a, 0x1a, 0x1a, 0x1a, 0xc8, 0xe8, 0x1a, 0x1a, + 0xd0, 0xf0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_croatian_unicode_to_byte_stream_base_0x2010[ 56 ] = { + 0x1a, 0x1a, 0x1a, 0xe0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0xe2, 0x1a, 0xd2, 0xd3, 0xe3, 0x1a, + 0xa0, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xdc, 0xdd, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0xda, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacCroatian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_croatian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_croatian_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_croatian_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacCroatian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_croatian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_croatian_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0118 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_croatian_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2048 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_croatian_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0131: + byte_stream_value = 0xf5; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x0160: + byte_stream_value = 0xa9; + break; + + case 0x0161: + byte_stream_value = 0xb9; + break; + + case 0x017d: + byte_stream_value = 0xae; + break; + + case 0x017e: + byte_stream_value = 0xbe; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x02c6: + byte_stream_value = 0xf6; + break; + + case 0x02c7: + byte_stream_value = 0xff; + break; + + case 0x02da: + byte_stream_value = 0xfb; + break; + + case 0x02dc: + byte_stream_value = 0xf7; + break; + + case 0x03a9: + byte_stream_value = 0xbd; + break; + + case 0x03c0: + byte_stream_value = 0xf9; + break; + + case 0x20ac: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xb4; + break; + + case 0x220f: + byte_stream_value = 0xb8; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x222b: + byte_stream_value = 0xba; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + case 0xf8ff: + byte_stream_value = 0xd8; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_croatian.h libbde-20240223/libuna/libuna_codepage_mac_croatian.h --- libbde-20190102/libuna/libuna_codepage_mac_croatian.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_croatian.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacCroatian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_CROATIAN_H ) +#define _LIBUNA_CODEPAGE_MAC_CROATIAN_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_croatian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_croatian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_CROATIAN_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_cyrillic.c libbde-20240223/libuna/libuna_codepage_mac_cyrillic.c --- libbde-20190102/libuna/libuna_codepage_mac_cyrillic.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_cyrillic.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,325 @@ +/* + * MacCyrillic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_cyrillic.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacCyrillic codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_cyrillic_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, + 0x2020, 0x00b0, 0x0490, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, + 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x0491, 0x0408, + 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, + 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, + 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x20ac +}; + +/* Unicode to ASCII character lookup tables for the MacCyrillic codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_cyrillic_unicode_to_byte_stream_base_0x00a0[ 32 ] = { + 0xca, 0x1a, 0x1a, 0xa3, 0x1a, 0x1a, 0x1a, 0xa4, + 0x1a, 0xa9, 0x1a, 0xc7, 0xc2, 0x1a, 0xa8, 0x1a, + 0xa1, 0xb1, 0x1a, 0x1a, 0x1a, 0xb5, 0xa6, 0x1a, + 0x1a, 0x1a, 0x1a, 0xc8, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_cyrillic_unicode_to_byte_stream_base_0x0400[ 96 ] = { + 0x1a, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, + 0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x1a, 0xd8, 0xda, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, + 0x1a, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, + 0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x1a, 0xd9, 0xdb +}; + +const uint8_t libuna_codepage_mac_cyrillic_unicode_to_byte_stream_base_0x2010[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0xd7, 0x1a, + 0xa0, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a +}; + +/* Copies an Unicode character from a MacCyrillic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_cyrillic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_cyrillic_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_cyrillic_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacCyrillic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_cyrillic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_cyrillic_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_cyrillic_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0400 ) + && ( unicode_character < 0x0460 ) ) + { + unicode_character -= 0x0400; + + byte_stream_value = libuna_codepage_mac_cyrillic_unicode_to_byte_stream_base_0x0400[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_cyrillic_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00f7: + byte_stream_value = 0xd6; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x0490: + byte_stream_value = 0xa2; + break; + + case 0x0491: + byte_stream_value = 0xb6; + break; + + case 0x20ac: + byte_stream_value = 0xff; + break; + + case 0x2116: + byte_stream_value = 0xdc; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_cyrillic.h libbde-20240223/libuna/libuna_codepage_mac_cyrillic.h --- libbde-20190102/libuna/libuna_codepage_mac_cyrillic.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_cyrillic.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacCyrillic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_CYRILLIC_H ) +#define _LIBUNA_CODEPAGE_MAC_CYRILLIC_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_cyrillic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_cyrillic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_CYRILLIC_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_dingbats.c libbde-20240223/libuna/libuna_codepage_mac_dingbats.c --- libbde-20190102/libuna/libuna_codepage_mac_dingbats.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_dingbats.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,347 @@ +/* + * MacDingbats codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_dingbats.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacDingbats codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_dingbats_byte_stream_to_unicode_base_0x20[ 224 ] = { + 0x0020, 0x2701, 0x2702, 0x2703, 0x2704, 0x260e, 0x2706, 0x2707, + 0x2708, 0x2709, 0x261b, 0x261e, 0x270c, 0x270d, 0x270e, 0x270f, + 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, + 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f, + 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, + 0x2605, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f, + 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, + 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f, + 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, + 0x2748, 0x2749, 0x274a, 0x274b, 0x25cf, 0x274d, 0x25a0, 0x274f, + 0x2750, 0x2751, 0x2752, 0x25b2, 0x25bc, 0x25c6, 0x2756, 0x25d7, + 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x007f, + 0x2768, 0x2769, 0x276a, 0x276b, 0x276c, 0x276d, 0x276e, 0x276f, + 0x2770, 0x2771, 0x2772, 0x2773, 0x2774, 0x2775, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, + 0x2663, 0x2666, 0x2665, 0x2660, 0x2460, 0x2461, 0x2462, 0x2463, + 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x2776, 0x2777, + 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f, + 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, + 0x2788, 0x2789, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f, + 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195, + 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f, + 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, + 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af, + 0xfffd, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7, + 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0xfffd +}; + +/* Unicode to ASCII character lookup tables for the MacDingbats codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_dingbats_unicode_to_byte_stream_base_0x2460[ 16 ] = { + 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_dingbats_unicode_to_byte_stream_base_0x2700[ 192 ] = { + 0x1a, 0x21, 0x22, 0x23, 0x24, 0x1a, 0x26, 0x27, + 0x28, 0x29, 0x1a, 0x1a, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x1a, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x1a, 0x6d, 0x1a, 0x6f, + 0x70, 0x71, 0x72, 0x1a, 0x1a, 0x1a, 0x76, 0x1a, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x1a, + 0x1a, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0x1a, 0x1a, 0x1a, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0x1a, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x1a +}; + +/* Copies an Unicode character from a MacDingbats encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_dingbats_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_dingbats_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x20 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x20; + + safe_unicode_character = libuna_codepage_mac_dingbats_byte_stream_to_unicode_base_0x20[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacDingbats encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_dingbats_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_dingbats_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( ( unicode_character <= 0x0020 ) + || ( unicode_character == 0x007f ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x2460 ) + && ( unicode_character < 0x2470 ) ) + { + unicode_character -= 0x2460; + + byte_stream_value = libuna_codepage_mac_dingbats_unicode_to_byte_stream_base_0x2460[ unicode_character ]; + } + else if( ( unicode_character >= 0x2700 ) + && ( unicode_character < 0x27c0 ) ) + { + unicode_character -= 0x2700; + + byte_stream_value = libuna_codepage_mac_dingbats_unicode_to_byte_stream_base_0x2700[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x2192: + byte_stream_value = 0xd5; + break; + + case 0x2194: + byte_stream_value = 0xd6; + break; + + case 0x2195: + byte_stream_value = 0xd7; + break; + + case 0x25a0: + byte_stream_value = 0x6e; + break; + + case 0x25b2: + byte_stream_value = 0x73; + break; + + case 0x25bc: + byte_stream_value = 0x74; + break; + + case 0x25c6: + byte_stream_value = 0x75; + break; + + case 0x25cf: + byte_stream_value = 0x6c; + break; + + case 0x25d7: + byte_stream_value = 0x77; + break; + + case 0x2605: + byte_stream_value = 0x48; + break; + + case 0x260e: + byte_stream_value = 0x25; + break; + + case 0x261b: + byte_stream_value = 0x2a; + break; + + case 0x261e: + byte_stream_value = 0x2b; + break; + + case 0x2660: + byte_stream_value = 0xab; + break; + + case 0x2663: + byte_stream_value = 0xa8; + break; + + case 0x2665: + byte_stream_value = 0xaa; + break; + + case 0x2666: + byte_stream_value = 0xa9; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_dingbats.h libbde-20240223/libuna/libuna_codepage_mac_dingbats.h --- libbde-20190102/libuna/libuna_codepage_mac_dingbats.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_dingbats.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacDingbats codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_DINGBATS_H ) +#define _LIBUNA_CODEPAGE_MAC_DINGBATS_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_dingbats_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_dingbats_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_DINGBATS_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_farsi.c libbde-20240223/libuna/libuna_codepage_mac_farsi.c --- libbde-20190102/libuna/libuna_codepage_mac_farsi.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_farsi.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,372 @@ +/* + * MacFarsi codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_farsi.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacFarsi codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_farsi_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00a0, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x06ba, 0x00ab, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x2026, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00bb, 0x00f4, 0x00f6, 0x00f7, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x066a, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002a, 0x002b, 0x060c, 0x002d, 0x002e, 0x002f, + 0x06f0, 0x06f1, 0x06f2, 0x06f3, 0x06f4, 0x06f5, 0x06f6, 0x06f7, + 0x06f8, 0x06f9, 0x003a, 0x061b, 0x003c, 0x003d, 0x003e, 0x061f, + 0x274a, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, + 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, + 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, + 0x0638, 0x0639, 0x063a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, + 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, + 0x0650, 0x0651, 0x0652, 0x067e, 0x0679, 0x0686, 0x06d5, 0x06a4, + 0x06af, 0x0688, 0x0691, 0x007b, 0x007c, 0x007d, 0x0698, 0x06d2 +}; + +/* Unicode to ASCII character lookup tables for the MacFarsi codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x0020[ 32 ] = { + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0x25, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0x2c, 0xad, 0xae, 0xaf, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0xba, 0x3b, 0xbc, 0xbd, 0xbe, 0x3f +}; + +const uint8_t libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0x81, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x8c, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x98, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x80, 0x1a, 0x1a, 0x82, + 0x1a, 0x83, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x84, 0x1a, 0x1a, 0x1a, 0x1a, 0x85, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x86, 0x1a, 0x1a, 0x1a, + 0x88, 0x87, 0x89, 0x1a, 0x8a, 0x1a, 0x1a, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x1a, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x1a, 0x97, 0x99, 0x1a, 0x9a, 0x9b, + 0x1a, 0x9d, 0x9c, 0x9e, 0x9f, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x0608[ 80 ] = { + 0x1a, 0x1a, 0x1a, 0x1a, 0xac, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0xbb, 0x1a, 0x1a, 0x1a, 0xbf, + 0x1a, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x0668[ 88 ] = { + 0x1a, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xf4, 0x1a, 0x1a, 0x1a, 0x1a, 0xf3, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf5, 0x1a, + 0xf9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xfa, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xfe, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0xf7, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xf8, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x8b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x06f0[ 16 ] = { + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacFarsi encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_farsi_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_farsi_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_farsi_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacFarsi encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_farsi_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_farsi_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0020 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0020 ) + && ( unicode_character < 0x0040 ) ) + { + unicode_character -= 0x0020; + + byte_stream_value = libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x0020[ unicode_character ]; + } + else if( ( unicode_character >= 0x0040 ) + && ( unicode_character < 0x005b ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0060 ) + && ( unicode_character < 0x007b ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x007e ) + && ( unicode_character < 0x0080 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0608 ) + && ( unicode_character < 0x0658 ) ) + { + unicode_character -= 0x0608; + + byte_stream_value = libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x0608[ unicode_character ]; + } + else if( ( unicode_character >= 0x0668 ) + && ( unicode_character < 0x06c0 ) ) + { + unicode_character -= 0x0668; + + byte_stream_value = libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x0668[ unicode_character ]; + } + else if( ( unicode_character >= 0x06f0 ) + && ( unicode_character < 0x0700 ) ) + { + unicode_character -= 0x06f0; + + byte_stream_value = libuna_codepage_mac_farsi_unicode_to_byte_stream_base_0x06f0[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x005b: + byte_stream_value = 0xdb; + break; + + case 0x005c: + byte_stream_value = 0xdc; + break; + + case 0x005d: + byte_stream_value = 0xdd; + break; + + case 0x005e: + byte_stream_value = 0xde; + break; + + case 0x005f: + byte_stream_value = 0xdf; + break; + + case 0x007b: + byte_stream_value = 0xfb; + break; + + case 0x007c: + byte_stream_value = 0xfc; + break; + + case 0x007d: + byte_stream_value = 0xfd; + break; + + case 0x06d2: + byte_stream_value = 0xff; + break; + + case 0x06d5: + byte_stream_value = 0xf6; + break; + + case 0x2026: + byte_stream_value = 0x93; + break; + + case 0x274a: + byte_stream_value = 0xc0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_farsi.h libbde-20240223/libuna/libuna_codepage_mac_farsi.h --- libbde-20190102/libuna/libuna_codepage_mac_farsi.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_farsi.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacFarsi codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_FARSI_H ) +#define _LIBUNA_CODEPAGE_MAC_FARSI_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_farsi_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_farsi_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_FARSI_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_gaelic.c libbde-20240223/libuna/libuna_codepage_mac_gaelic.c --- libbde-20190102/libuna/libuna_codepage_mac_gaelic.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_gaelic.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,437 @@ +/* + * MacGaelic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_gaelic.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacGaelic codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_gaelic_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, + 0x1e02, 0x00b1, 0x2264, 0x2265, 0x1e03, 0x010a, 0x010b, 0x1e0a, + 0x1e0b, 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x00e6, 0x00f8, + 0x1e41, 0x1e56, 0x1e57, 0x027c, 0x0192, 0x017f, 0x1e60, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x1e61, 0x1e9b, + 0x00ff, 0x0178, 0x1e6a, 0x20ac, 0x2039, 0x203a, 0x0176, 0x0177, + 0x1e6b, 0x00b7, 0x1ef2, 0x1ef3, 0x204a, 0x00c2, 0x00ca, 0x00c1, + 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0x2663, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x00dd, 0x00fd, + 0x0174, 0x0175, 0x1e84, 0x1e85, 0x1e80, 0x1e81, 0x1e82, 0x1e83 +}; + +/* Unicode to ASCII character lookup tables for the MacGaelic codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_gaelic_unicode_to_byte_stream_base_0x00a0[ 112 ] = { + 0xca, 0x1a, 0xa2, 0xa3, 0x1a, 0x1a, 0x1a, 0xa4, + 0xac, 0xa9, 0x1a, 0xc7, 0x1a, 0x1a, 0xa8, 0x1a, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0x1a, 0xa6, 0xe1, + 0x1a, 0x1a, 0x1a, 0xc8, 0x1a, 0x1a, 0x1a, 0x1a, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, + 0x1a, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xf6, 0x1a, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0x1a, + 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xf7, 0x1a, 0xd8, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0xb5, 0xb6, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_gaelic_unicode_to_byte_stream_base_0x2010[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0x1a, 0x1a, + 0xa0, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a +}; + +/* Copies an Unicode character from a MacGaelic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_gaelic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_gaelic_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_gaelic_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacGaelic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_gaelic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_gaelic_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0110 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_gaelic_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_gaelic_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0120: + byte_stream_value = 0xbb; + break; + + case 0x0121: + byte_stream_value = 0xbc; + break; + + case 0x0131: + byte_stream_value = 0xf5; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x0174: + byte_stream_value = 0xf8; + break; + + case 0x0175: + byte_stream_value = 0xf9; + break; + + case 0x0176: + byte_stream_value = 0xde; + break; + + case 0x0177: + byte_stream_value = 0xdf; + break; + + case 0x0178: + byte_stream_value = 0xd9; + break; + + case 0x017f: + byte_stream_value = 0xc5; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x027c: + byte_stream_value = 0xc3; + break; + + case 0x1e02: + byte_stream_value = 0xb0; + break; + + case 0x1e03: + byte_stream_value = 0xb4; + break; + + case 0x1e0a: + byte_stream_value = 0xb7; + break; + + case 0x1e0b: + byte_stream_value = 0xb8; + break; + + case 0x1e1e: + byte_stream_value = 0xb9; + break; + + case 0x1e1f: + byte_stream_value = 0xba; + break; + + case 0x1e40: + byte_stream_value = 0xbd; + break; + + case 0x1e41: + byte_stream_value = 0xc0; + break; + + case 0x1e56: + byte_stream_value = 0xc1; + break; + + case 0x1e57: + byte_stream_value = 0xc2; + break; + + case 0x1e60: + byte_stream_value = 0xc6; + break; + + case 0x1e61: + byte_stream_value = 0xd6; + break; + + case 0x1e6a: + byte_stream_value = 0xda; + break; + + case 0x1e6b: + byte_stream_value = 0xe0; + break; + + case 0x1e80: + byte_stream_value = 0xfc; + break; + + case 0x1e81: + byte_stream_value = 0xfd; + break; + + case 0x1e82: + byte_stream_value = 0xfe; + break; + + case 0x1e83: + byte_stream_value = 0xff; + break; + + case 0x1e84: + byte_stream_value = 0xfa; + break; + + case 0x1e85: + byte_stream_value = 0xfb; + break; + + case 0x1e9b: + byte_stream_value = 0xd7; + break; + + case 0x1ef2: + byte_stream_value = 0xe2; + break; + + case 0x1ef3: + byte_stream_value = 0xe3; + break; + + case 0x2039: + byte_stream_value = 0xdc; + break; + + case 0x203a: + byte_stream_value = 0xdd; + break; + + case 0x204a: + byte_stream_value = 0xe4; + break; + + case 0x20ac: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x2663: + byte_stream_value = 0xf0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_gaelic.h libbde-20240223/libuna/libuna_codepage_mac_gaelic.h --- libbde-20190102/libuna/libuna_codepage_mac_gaelic.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_gaelic.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacGaelic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_GAELIC_H ) +#define _LIBUNA_CODEPAGE_MAC_GAELIC_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_gaelic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_gaelic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_GAELIC_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_greek.c libbde-20240223/libuna/libuna_codepage_mac_greek.c --- libbde-20190102/libuna/libuna_codepage_mac_greek.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_greek.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,305 @@ +/* + * MacGreek codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_greek.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacGreek codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_greek_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00b9, 0x00b2, 0x00c9, 0x00b3, 0x00d6, 0x00dc, 0x0385, + 0x00e0, 0x00e2, 0x00e4, 0x0384, 0x00a8, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00a3, 0x2122, 0x00ee, 0x00ef, 0x2022, 0x00bd, + 0x2030, 0x00f4, 0x00f6, 0x00a6, 0x20ac, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x0393, 0x0394, 0x0398, 0x039b, 0x039e, 0x03a0, 0x00df, + 0x00ae, 0x00a9, 0x03a3, 0x03aa, 0x00a7, 0x2260, 0x00b0, 0x00b7, + 0x0391, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x0392, 0x0395, 0x0396, + 0x0397, 0x0399, 0x039a, 0x039c, 0x03a6, 0x03ab, 0x03a8, 0x03a9, + 0x03ac, 0x039d, 0x00ac, 0x039f, 0x03a1, 0x2248, 0x03a4, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x03a5, 0x03a7, 0x0386, 0x0388, 0x0153, + 0x2013, 0x2015, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0389, + 0x038a, 0x038c, 0x038e, 0x03ad, 0x03ae, 0x03af, 0x03cc, 0x038f, + 0x03cd, 0x03b1, 0x03b2, 0x03c8, 0x03b4, 0x03b5, 0x03c6, 0x03b3, + 0x03b7, 0x03b9, 0x03be, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, + 0x03c0, 0x03ce, 0x03c1, 0x03c3, 0x03c4, 0x03b8, 0x03c9, 0x03c2, + 0x03c7, 0x03c5, 0x03b6, 0x03ca, 0x03cb, 0x0390, 0x03b0, 0x00ad +}; + +/* Unicode to ASCII character lookup tables for the MacGreek codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_greek_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0xca, 0x1a, 0x1a, 0x92, 0x1a, 0xb4, 0x9b, 0xac, + 0x8c, 0xa9, 0x1a, 0xc7, 0xc2, 0xff, 0xa8, 0x1a, + 0xae, 0xb1, 0x82, 0x84, 0x1a, 0x1a, 0x1a, 0xaf, + 0x1a, 0x81, 0x1a, 0xc8, 0x1a, 0x97, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x80, 0x1a, 0x1a, 0x1a, + 0x1a, 0x83, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x85, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x86, 0x1a, 0x1a, 0xa7, + 0x88, 0x1a, 0x89, 0x1a, 0x8a, 0x1a, 0x1a, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x1a, 0x1a, 0x94, 0x95, + 0x1a, 0x1a, 0x1a, 0x1a, 0x99, 0x1a, 0x9a, 0xd6, + 0x1a, 0x9d, 0x1a, 0x9e, 0x9f, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_greek_unicode_to_byte_stream_base_0x0380[ 80 ] = { + 0x1a, 0x1a, 0x1a, 0x1a, 0x8b, 0x87, 0xcd, 0x1a, + 0xce, 0xd7, 0xd8, 0x1a, 0xd9, 0x1a, 0xda, 0xdf, + 0xfd, 0xb0, 0xb5, 0xa1, 0xa2, 0xb6, 0xb7, 0xb8, + 0xa3, 0xb9, 0xba, 0xa4, 0xbb, 0xc1, 0xa5, 0xc3, + 0xa6, 0xc4, 0x1a, 0xaa, 0xc6, 0xcb, 0xbc, 0xcc, + 0xbe, 0xbf, 0xab, 0xbd, 0xc0, 0xdb, 0xdc, 0xdd, + 0xfe, 0xe1, 0xe2, 0xe7, 0xe4, 0xe5, 0xfa, 0xe8, + 0xf5, 0xe9, 0xeb, 0xec, 0xed, 0xee, 0xea, 0xef, + 0xf0, 0xf2, 0xf7, 0xf3, 0xf4, 0xf9, 0xe6, 0xf8, + 0xe3, 0xf6, 0xfb, 0xfc, 0xde, 0xe0, 0xf1, 0x1a +}; + +const uint8_t libuna_codepage_mac_greek_unicode_to_byte_stream_base_0x2010[ 40 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0x1a, 0xd1, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0x1a, 0x1a, + 0xa0, 0x1a, 0x96, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x98, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacGreek encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_greek_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_greek_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_greek_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacGreek encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_greek_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_greek_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_greek_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0380 ) + && ( unicode_character < 0x03d0 ) ) + { + unicode_character -= 0x0380; + + byte_stream_value = libuna_codepage_mac_greek_unicode_to_byte_stream_base_0x0380[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2038 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_greek_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x20ac: + byte_stream_value = 0x9c; + break; + + case 0x2122: + byte_stream_value = 0x93; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_greek.h libbde-20240223/libuna/libuna_codepage_mac_greek.h --- libbde-20190102/libuna/libuna_codepage_mac_greek.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_greek.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacGreek codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_GREEK_H ) +#define _LIBUNA_CODEPAGE_MAC_GREEK_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_greek_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_greek_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_GREEK_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_icelandic.c libbde-20240223/libuna/libuna_codepage_mac_icelandic.c --- libbde-20190102/libuna/libuna_codepage_mac_icelandic.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_icelandic.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,381 @@ +/* + * MacIcelandic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_icelandic.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacIcelandic codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_icelandic_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x00dd, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, + 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, + 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0x00ff, 0x0178, 0x2044, 0x20ac, 0x00d0, 0x00f0, 0x00de, 0x00fe, + 0x00fd, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, + 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, + 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 +}; + +/* Unicode to ASCII character lookup tables for the MacIcelandic codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_icelandic_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0xca, 0xc1, 0xa2, 0xa3, 0x1a, 0xb4, 0x1a, 0xa4, + 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x1a, 0xa8, 0xf8, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0xb5, 0xa6, 0xe1, + 0xfc, 0x1a, 0xbc, 0xc8, 0x1a, 0x1a, 0x1a, 0xc0, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, + 0xdc, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0xa0, 0xde, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0xdd, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xe0, 0xdf, 0xd8 +}; + +const uint8_t libuna_codepage_mac_icelandic_unicode_to_byte_stream_base_0x2010[ 40 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0xe2, 0x1a, 0xd2, 0xd3, 0xe3, 0x1a, + 0x1a, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacIcelandic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_icelandic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_icelandic_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_icelandic_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacIcelandic encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_icelandic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_icelandic_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_icelandic_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2038 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_icelandic_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0131: + byte_stream_value = 0xf5; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x0178: + byte_stream_value = 0xd9; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x02c6: + byte_stream_value = 0xf6; + break; + + case 0x02c7: + byte_stream_value = 0xff; + break; + + case 0x02d8: + byte_stream_value = 0xf9; + break; + + case 0x02d9: + byte_stream_value = 0xfa; + break; + + case 0x02da: + byte_stream_value = 0xfb; + break; + + case 0x02db: + byte_stream_value = 0xfe; + break; + + case 0x02dc: + byte_stream_value = 0xf7; + break; + + case 0x02dd: + byte_stream_value = 0xfd; + break; + + case 0x03a9: + byte_stream_value = 0xbd; + break; + + case 0x03c0: + byte_stream_value = 0xb9; + break; + + case 0x2044: + byte_stream_value = 0xda; + break; + + case 0x20ac: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x220f: + byte_stream_value = 0xb8; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x222b: + byte_stream_value = 0xba; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + case 0xf8ff: + byte_stream_value = 0xf0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_icelandic.h libbde-20240223/libuna/libuna_codepage_mac_icelandic.h --- libbde-20190102/libuna/libuna_codepage_mac_icelandic.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_icelandic.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacIcelandic codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_ICELANDIC_H ) +#define _LIBUNA_CODEPAGE_MAC_ICELANDIC_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_icelandic_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_icelandic_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_ICELANDIC_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_inuit.c libbde-20240223/libuna/libuna_codepage_mac_inuit.c --- libbde-20190102/libuna/libuna_codepage_mac_inuit.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_inuit.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,380 @@ +/* + * MacInuit codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_inuit.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacInuit codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_inuit_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x1403, 0x1404, 0x1405, 0x1406, 0x140a, 0x140b, 0x1431, 0x1432, + 0x1433, 0x1434, 0x1438, 0x1439, 0x1449, 0x144e, 0x144f, 0x1450, + 0x1451, 0x1455, 0x1456, 0x1466, 0x146d, 0x146e, 0x146f, 0x1470, + 0x1472, 0x1473, 0x1483, 0x148b, 0x148c, 0x148d, 0x148e, 0x1490, + 0x1491, 0x00b0, 0x14a1, 0x14a5, 0x14a6, 0x2022, 0x00b6, 0x14a7, + 0x00ae, 0x00a9, 0x2122, 0x14a8, 0x14aa, 0x14ab, 0x14bb, 0x14c2, + 0x14c3, 0x14c4, 0x14c5, 0x14c7, 0x14c8, 0x14d0, 0x14ef, 0x14f0, + 0x14f1, 0x14f2, 0x14f4, 0x14f5, 0x1505, 0x14d5, 0x14d6, 0x14d7, + 0x14d8, 0x14da, 0x14db, 0x14ea, 0x1528, 0x1529, 0x152a, 0x152b, + 0x152d, 0x2026, 0x00a0, 0x152e, 0x153e, 0x1555, 0x1556, 0x1557, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x1558, 0x1559, + 0x155a, 0x155d, 0x1546, 0x1547, 0x1548, 0x1549, 0x154b, 0x154c, + 0x1550, 0x157f, 0x1580, 0x1581, 0x1582, 0x1583, 0x1584, 0x1585, + 0x158f, 0x1590, 0x1591, 0x1592, 0x1593, 0x1594, 0x1595, 0x1671, + 0x1672, 0x1673, 0x1674, 0x1675, 0x1676, 0x1596, 0x15a0, 0x15a1, + 0x15a2, 0x15a3, 0x15a4, 0x15a5, 0x15a6, 0x157c, 0x0141, 0x0142 +}; + +/* Unicode to ASCII character lookup tables for the MacInuit codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x1430[ 216 ] = { + 0x1a, 0x86, 0x87, 0x88, 0x89, 0x1a, 0x1a, 0x1a, + 0x8a, 0x8b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x8c, 0x1a, 0x1a, 0x1a, 0x1a, 0x8d, 0x8e, + 0x8f, 0x90, 0x1a, 0x1a, 0x1a, 0x91, 0x92, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x93, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x94, 0x95, 0x96, + 0x97, 0x1a, 0x98, 0x99, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x9a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x9b, 0x9c, 0x9d, 0x9e, 0x1a, + 0x9f, 0xa0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xa2, 0x1a, 0x1a, 0x1a, 0xa3, 0xa4, 0xa7, + 0xab, 0x1a, 0xac, 0xad, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0xae, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0xaf, 0xb0, 0xb1, 0xb2, 0x1a, 0xb3, + 0xb4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xb5, 0x1a, 0x1a, 0x1a, 0x1a, 0xbd, 0xbe, 0xbf, + 0xc0, 0x1a, 0xc1, 0xc2, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0xc3, 0x1a, 0x1a, 0x1a, 0x1a, 0xb6, + 0xb7, 0xb8, 0xb9, 0x1a, 0xba, 0xbb, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xbc, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x1528[ 56 ] = { + 0xc4, 0xc5, 0xc6, 0xc7, 0x1a, 0xc8, 0xcb, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xcc, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xda, 0xdb, + 0xdc, 0xdd, 0x1a, 0xde, 0xdf, 0x1a, 0x1a, 0x1a, + 0xe0, 0x1a, 0x1a, 0x1a, 0x1a, 0xcd, 0xce, 0xcf, + 0xd6, 0xd7, 0xd8, 0x1a, 0x1a, 0xd9, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x1578[ 48 ] = { + 0x1a, 0x1a, 0x1a, 0x1a, 0xfd, 0x1a, 0x1a, 0xe1, + 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xe8, + 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xf5, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x1a +}; + +const uint8_t libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x2010[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0x1a, 0x1a, + 0x1a, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a +}; + +/* Copies an Unicode character from a MacInuit encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_inuit_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_inuit_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_inuit_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacInuit encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_inuit_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_inuit_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( ( unicode_character < 0x0080 ) + || ( unicode_character == 0x00a9 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x1430 ) + && ( unicode_character < 0x1508 ) ) + { + unicode_character -= 0x1430; + + byte_stream_value = libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x1430[ unicode_character ]; + } + else if( ( unicode_character >= 0x1528 ) + && ( unicode_character < 0x1560 ) ) + { + unicode_character -= 0x1528; + + byte_stream_value = libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x1528[ unicode_character ]; + } + else if( ( unicode_character >= 0x1578 ) + && ( unicode_character < 0x15a8 ) ) + { + unicode_character -= 0x1578; + + byte_stream_value = libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x1578[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_inuit_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00a0: + byte_stream_value = 0xca; + break; + + case 0x00ae: + byte_stream_value = 0xa8; + break; + + case 0x00b0: + byte_stream_value = 0xa1; + break; + + case 0x00b6: + byte_stream_value = 0xa6; + break; + + case 0x0141: + byte_stream_value = 0xfe; + break; + + case 0x0142: + byte_stream_value = 0xff; + break; + + case 0x1403: + byte_stream_value = 0x80; + break; + + case 0x1404: + byte_stream_value = 0x81; + break; + + case 0x1405: + byte_stream_value = 0x82; + break; + + case 0x1406: + byte_stream_value = 0x83; + break; + + case 0x140a: + byte_stream_value = 0x84; + break; + + case 0x140b: + byte_stream_value = 0x85; + break; + + case 0x1671: + byte_stream_value = 0xef; + break; + + case 0x1672: + byte_stream_value = 0xf0; + break; + + case 0x1673: + byte_stream_value = 0xf1; + break; + + case 0x1674: + byte_stream_value = 0xf2; + break; + + case 0x1675: + byte_stream_value = 0xf3; + break; + + case 0x1676: + byte_stream_value = 0xf4; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_inuit.h libbde-20240223/libuna/libuna_codepage_mac_inuit.h --- libbde-20190102/libuna/libuna_codepage_mac_inuit.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_inuit.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacInuit codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_INUIT_H ) +#define _LIBUNA_CODEPAGE_MAC_INUIT_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_inuit_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_inuit_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_INUIT_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_roman.c libbde-20240223/libuna/libuna_codepage_mac_roman.c --- libbde-20190102/libuna/libuna_codepage_mac_roman.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_roman.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,387 @@ +/* + * MacRoman codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_roman.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacRoman codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_roman_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, + 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, + 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0x00ff, 0x0178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02, + 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, + 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, + 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 +}; + +/* Unicode to ASCII character lookup tables for the MacRoman codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_roman_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0xca, 0xc1, 0xa2, 0xa3, 0x1a, 0xb4, 0x1a, 0xa4, + 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x1a, 0xa8, 0xf8, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0xb5, 0xa6, 0xe1, + 0xfc, 0x1a, 0xbc, 0xc8, 0x1a, 0x1a, 0x1a, 0xc0, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, + 0x1a, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x1a, 0x1a, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x1a, 0x1a, 0xd8 +}; + +const uint8_t libuna_codepage_mac_roman_unicode_to_byte_stream_base_0x2010[ 56 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0xe2, 0x1a, 0xd2, 0xd3, 0xe3, 0x1a, + 0xa0, 0xe0, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xdc, 0xdd, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0xda, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacRoman encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_roman_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_roman_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_roman_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacRoman encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_roman_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_roman_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_roman_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2048 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_roman_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0131: + byte_stream_value = 0xf5; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x0178: + byte_stream_value = 0xd9; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x02c6: + byte_stream_value = 0xf6; + break; + + case 0x02c7: + byte_stream_value = 0xff; + break; + + case 0x02d8: + byte_stream_value = 0xf9; + break; + + case 0x02d9: + byte_stream_value = 0xfa; + break; + + case 0x02da: + byte_stream_value = 0xfb; + break; + + case 0x02db: + byte_stream_value = 0xfe; + break; + + case 0x02dc: + byte_stream_value = 0xf7; + break; + + case 0x02dd: + byte_stream_value = 0xfd; + break; + + case 0x03a9: + byte_stream_value = 0xbd; + break; + + case 0x03c0: + byte_stream_value = 0xb9; + break; + + case 0x20ac: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x220f: + byte_stream_value = 0xb8; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x222b: + byte_stream_value = 0xba; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + case 0xf8ff: + byte_stream_value = 0xf0; + break; + + case 0xfb01: + byte_stream_value = 0xde; + break; + + case 0xfb02: + byte_stream_value = 0xdf; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_roman.h libbde-20240223/libuna/libuna_codepage_mac_roman.h --- libbde-20190102/libuna/libuna_codepage_mac_roman.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_roman.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacRoman codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_ROMAN_H ) +#define _LIBUNA_CODEPAGE_MAC_ROMAN_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_roman_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_roman_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_ROMAN_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_romanian.c libbde-20240223/libuna/libuna_codepage_mac_romanian.c --- libbde-20190102/libuna/libuna_codepage_mac_romanian.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_romanian.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,396 @@ +/* + * MacRomanian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_romanian.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacRomanian codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_romanian_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x0102, 0x0218, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, + 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x0103, 0x0219, + 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0x00ff, 0x0178, 0x2044, 0x20ac, 0x2039, 0x203a, 0x021a, 0x021b, + 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, + 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, + 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 +}; + +/* Unicode to ASCII character lookup tables for the MacRomanian codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_romanian_unicode_to_byte_stream_base_0x00a0[ 104 ] = { + 0xca, 0xc1, 0xa2, 0xa3, 0x1a, 0xb4, 0x1a, 0xa4, + 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x1a, 0xa8, 0xf8, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0xb5, 0xa6, 0xe1, + 0xfc, 0x1a, 0xbc, 0xc8, 0x1a, 0x1a, 0x1a, 0xc0, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0x1a, 0x82, + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, + 0x1a, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0x1a, 0xf4, 0xf2, 0xf3, 0x86, 0x1a, 0x1a, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0x1a, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0x1a, 0x9d, 0x9c, 0x9e, 0x9f, 0x1a, 0x1a, 0xd8, + 0x1a, 0x1a, 0xae, 0xbe, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_romanian_unicode_to_byte_stream_base_0x2010[ 56 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0xe2, 0x1a, 0xd2, 0xd3, 0xe3, 0x1a, + 0xa0, 0xe0, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0xdc, 0xdd, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0xda, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacRomanian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_romanian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_romanian_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_romanian_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacRomanian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_romanian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_romanian_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0108 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_romanian_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2048 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_romanian_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0131: + byte_stream_value = 0xf5; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x0178: + byte_stream_value = 0xd9; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x0218: + byte_stream_value = 0xaf; + break; + + case 0x0219: + byte_stream_value = 0xbf; + break; + + case 0x021a: + byte_stream_value = 0xde; + break; + + case 0x021b: + byte_stream_value = 0xdf; + break; + + case 0x02c6: + byte_stream_value = 0xf6; + break; + + case 0x02c7: + byte_stream_value = 0xff; + break; + + case 0x02d8: + byte_stream_value = 0xf9; + break; + + case 0x02d9: + byte_stream_value = 0xfa; + break; + + case 0x02da: + byte_stream_value = 0xfb; + break; + + case 0x02db: + byte_stream_value = 0xfe; + break; + + case 0x02dc: + byte_stream_value = 0xf7; + break; + + case 0x02dd: + byte_stream_value = 0xfd; + break; + + case 0x03a9: + byte_stream_value = 0xbd; + break; + + case 0x03c0: + byte_stream_value = 0xb9; + break; + + case 0x20ac: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x220f: + byte_stream_value = 0xb8; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x222b: + byte_stream_value = 0xba; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + case 0xf8ff: + byte_stream_value = 0xf0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_romanian.h libbde-20240223/libuna/libuna_codepage_mac_romanian.h --- libbde-20190102/libuna/libuna_codepage_mac_romanian.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_romanian.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacRomanian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_ROMANIAN_H ) +#define _LIBUNA_CODEPAGE_MAC_ROMANIAN_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_romanian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_romanian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_ROMANIAN_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_russian.c libbde-20240223/libuna/libuna_codepage_mac_russian.c --- libbde-20190102/libuna/libuna_codepage_mac_russian.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_russian.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,317 @@ +/* + * MacRussian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_russian.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacRussian codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_russian_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, + 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x2202, 0x0408, + 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, + 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, + 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x00a4 +}; + +/* Unicode to ASCII character lookup tables for the MacRussian codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_russian_unicode_to_byte_stream_base_0x00a0[ 32 ] = { + 0xca, 0x1a, 0xa2, 0xa3, 0xff, 0x1a, 0x1a, 0xa4, + 0x1a, 0xa9, 0x1a, 0xc7, 0xc2, 0x1a, 0xa8, 0x1a, + 0xa1, 0xb1, 0x1a, 0x1a, 0x1a, 0xb5, 0xa6, 0x1a, + 0x1a, 0x1a, 0x1a, 0xc8, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_russian_unicode_to_byte_stream_base_0x0400[ 96 ] = { + 0x1a, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, + 0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x1a, 0xd8, 0xda, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, + 0x1a, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, + 0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x1a, 0xd9, 0xdb +}; + +const uint8_t libuna_codepage_mac_russian_unicode_to_byte_stream_base_0x2010[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0xd7, 0x1a, + 0xa0, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a +}; + +/* Copies an Unicode character from a MacRussian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_russian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_russian_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_russian_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacRussian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_russian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_russian_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_russian_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0400 ) + && ( unicode_character < 0x0460 ) ) + { + unicode_character -= 0x0400; + + byte_stream_value = libuna_codepage_mac_russian_unicode_to_byte_stream_base_0x0400[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_russian_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00f7: + byte_stream_value = 0xd6; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x2116: + byte_stream_value = 0xdc; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_russian.h libbde-20240223/libuna/libuna_codepage_mac_russian.h --- libbde-20190102/libuna/libuna_codepage_mac_russian.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_russian.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacRussian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_RUSSIAN_H ) +#define _LIBUNA_CODEPAGE_MAC_RUSSIAN_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_russian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_russian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_RUSSIAN_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_symbol.c libbde-20240223/libuna/libuna_codepage_mac_symbol.c --- libbde-20190102/libuna/libuna_codepage_mac_symbol.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_symbol.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,537 @@ +/* + * MacSymbol codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_symbol.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacSymbol codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_symbol_byte_stream_to_unicode_base_0x20[ 224 ] = { + 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220d, + 0x0028, 0x0029, 0x2217, 0x002b, 0x002c, 0x2212, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, + 0x2245, 0x0391, 0x0392, 0x03a7, 0x0394, 0x0395, 0x03a6, 0x0393, + 0x0397, 0x0399, 0x03d1, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f, + 0x03a0, 0x0398, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03c2, 0x03a9, + 0x039e, 0x03a8, 0x0396, 0x005b, 0x2234, 0x005d, 0x22a5, 0x005f, + 0xf8e5, 0x03b1, 0x03b2, 0x03c7, 0x03b4, 0x03b5, 0x03c6, 0x03b3, + 0x03b7, 0x03b9, 0x03d5, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, + 0x03c0, 0x03b8, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03d6, 0x03c9, + 0x03be, 0x03c8, 0x03b6, 0x007b, 0x007c, 0x007d, 0x223c, 0x007f, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0x20ac, 0x03d2, 0x2032, 0x2264, 0x2044, 0x221e, 0x0192, 0x2663, + 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, + 0x00b0, 0x00b1, 0x2033, 0x2265, 0x00d7, 0x221d, 0x2202, 0x2022, + 0x00f7, 0x2260, 0x2261, 0x2248, 0x2026, 0x23d0, 0x23af, 0x21b5, + 0x2135, 0x2111, 0x211c, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229, + 0x222a, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209, + 0x2220, 0x2207, 0x00ae, 0x00a9, 0x2122, 0x220f, 0x221a, 0x22c5, + 0x00ac, 0x2227, 0x2228, 0x21d4, 0x21d0, 0x21d1, 0x21d2, 0x21d3, + 0x25ca, 0x3008, 0x00ae, 0x00a9, 0x2122, 0x2211, 0x239b, 0x239c, + 0x239d, 0x23a1, 0x23a2, 0x23a3, 0x23a7, 0x23a8, 0x23a9, 0x23aa, + 0xf8ff, 0x3009, 0x222b, 0x2320, 0x23ae, 0x2321, 0x239e, 0x239f, + 0x23a0, 0x23a4, 0x23a5, 0x23a6, 0x23ab, 0x23ac, 0x23ad, 0xfffd +}; + +/* Unicode to ASCII character lookup tables for the MacSymbol codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x0390[ 72 ] = { + 0x1a, 0x41, 0x42, 0x47, 0x44, 0x45, 0x5a, 0x48, + 0x51, 0x49, 0x4b, 0x4c, 0x4d, 0x4e, 0x58, 0x4f, + 0x50, 0x52, 0x1a, 0x53, 0x54, 0x55, 0x46, 0x43, + 0x59, 0x57, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x61, 0x62, 0x67, 0x64, 0x65, 0x7a, 0x68, + 0x71, 0x69, 0x6b, 0x6c, 0x6d, 0x6e, 0x78, 0x6f, + 0x70, 0x72, 0x56, 0x73, 0x74, 0x75, 0x66, 0x63, + 0x79, 0x77, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x4a, 0xa1, 0x1a, 0x1a, 0x6a, 0x76, 0x1a +}; + +const uint8_t libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x2200[ 80 ] = { + 0x22, 0x1a, 0xb6, 0x24, 0x1a, 0xc6, 0x1a, 0xd1, + 0xce, 0xcf, 0x1a, 0x1a, 0x1a, 0x27, 0x1a, 0xd5, + 0x1a, 0xe5, 0x2d, 0x1a, 0x1a, 0x1a, 0x1a, 0x2a, + 0x1a, 0x1a, 0xd6, 0x1a, 0x1a, 0xb5, 0xa5, 0x1a, + 0xd0, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xd9, + 0xda, 0xc7, 0xc8, 0xf2, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x5c, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x7e, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x40, 0x1a, 0x1a, + 0xbb, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x2280[ 40 ] = { + 0x1a, 0x1a, 0xcc, 0xc9, 0xcb, 0x1a, 0xcd, 0xca, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0xc5, 0x1a, 0xc4, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x5e, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x2398[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xe6, 0xe7, 0xe8, 0xf6, 0xf7, + 0xf8, 0xe9, 0xea, 0xeb, 0xf9, 0xfa, 0xfb, 0xec, + 0xed, 0xee, 0xef, 0xfc, 0xfd, 0xfe, 0xf4, 0xbe +}; + +/* Determines the size of a MacSymbol encoded byte stream from an Unicode character + * Adds the size to the byte stream character size value + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error + */ +int libuna_codepage_mac_symbol_unicode_character_size_to_byte_stream( + libuna_unicode_character_t unicode_character, + size_t *byte_stream_character_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_symbol_unicode_character_size_to_byte_stream"; + int result = 0; + + if( byte_stream_character_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream character size.", + function ); + + return( -1 ); + } + switch( unicode_character ) + { + case 0x000000aeUL: + case 0x000000a9UL: + case 0x00002122UL: + result = 0; + break; + + default: + *byte_stream_character_size += 1; + + result = 1; + break; + } + return( result ); +} + +/* Copies an Unicode character from a MacSymbol encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_symbol_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_symbol_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x20 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x20; + + safe_unicode_character = libuna_codepage_mac_symbol_byte_stream_to_unicode_base_0x20[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacSymbol encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_symbol_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_symbol_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( ( unicode_character <= 0x0021 ) + || ( unicode_character == 0x0023 ) + || ( unicode_character == 0x0025 ) + || ( unicode_character == 0x0026 ) + || ( unicode_character == 0x0028 ) + || ( unicode_character == 0x0029 ) + || ( unicode_character == 0x002b ) + || ( unicode_character == 0x002c ) + || ( ( unicode_character >= 0x002e ) + && ( unicode_character <= 0x003f ) ) + || ( unicode_character == 0x005b ) + || ( unicode_character == 0x005d ) + || ( unicode_character == 0x005f ) + || ( unicode_character == 0x007b ) + || ( unicode_character == 0x007c ) + || ( unicode_character == 0x007d ) + || ( unicode_character == 0x007f ) + || ( unicode_character == 0x00b0 ) + || ( unicode_character == 0x00b1 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0390 ) + && ( unicode_character < 0x03d8 ) ) + { + unicode_character -= 0x0390; + + byte_stream_value = libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x0390[ unicode_character ]; + } + else if( ( unicode_character >= 0x2200 ) + && ( unicode_character < 0x2250 ) ) + { + unicode_character -= 0x2200; + + byte_stream_value = libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x2200[ unicode_character ]; + } + else if( ( unicode_character >= 0x2280 ) + && ( unicode_character < 0x22a8 ) ) + { + unicode_character -= 0x2280; + + byte_stream_value = libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x2280[ unicode_character ]; + } + else if( ( unicode_character >= 0x2398 ) + && ( unicode_character < 0x23b0 ) ) + { + unicode_character -= 0x2398; + + byte_stream_value = libuna_codepage_mac_symbol_unicode_to_byte_stream_base_0x2398[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00a9: + byte_stream_value = 0xd3; + break; + + case 0x00ac: + byte_stream_value = 0xd8; + break; + + case 0x00ae: + byte_stream_value = 0xd2; + break; + + case 0x00d7: + byte_stream_value = 0xb4; + break; + + case 0x00f7: + byte_stream_value = 0xb8; + break; + + case 0x0192: + byte_stream_value = 0xa6; + break; + + case 0x2022: + byte_stream_value = 0xb7; + break; + + case 0x2026: + byte_stream_value = 0xbc; + break; + + case 0x2032: + byte_stream_value = 0xa2; + break; + + case 0x2033: + byte_stream_value = 0xb2; + break; + + case 0x2044: + byte_stream_value = 0xa4; + break; + + case 0x20ac: + byte_stream_value = 0xa0; + break; + + case 0x2111: + byte_stream_value = 0xc1; + break; + + case 0x2118: + byte_stream_value = 0xc3; + break; + + case 0x211c: + byte_stream_value = 0xc2; + break; + + case 0x2122: + byte_stream_value = 0xd4; + break; + + case 0x2135: + byte_stream_value = 0xc0; + break; + + case 0x2190: + byte_stream_value = 0xac; + break; + + case 0x2191: + byte_stream_value = 0xad; + break; + + case 0x2192: + byte_stream_value = 0xae; + break; + + case 0x2193: + byte_stream_value = 0xaf; + break; + + case 0x2194: + byte_stream_value = 0xab; + break; + + case 0x21b5: + byte_stream_value = 0xbf; + break; + + case 0x21d0: + byte_stream_value = 0xdc; + break; + + case 0x21d1: + byte_stream_value = 0xdd; + break; + + case 0x21d2: + byte_stream_value = 0xde; + break; + + case 0x21d3: + byte_stream_value = 0xdf; + break; + + case 0x21d4: + byte_stream_value = 0xdb; + break; + + case 0x2260: + byte_stream_value = 0xb9; + break; + + case 0x2261: + byte_stream_value = 0xba; + break; + + case 0x2264: + byte_stream_value = 0xa3; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x22c5: + byte_stream_value = 0xd7; + break; + + case 0x2320: + byte_stream_value = 0xf3; + break; + + case 0x2321: + byte_stream_value = 0xf5; + break; + + case 0x23d0: + byte_stream_value = 0xbd; + break; + + case 0x25ca: + byte_stream_value = 0xe0; + break; + + case 0x2660: + byte_stream_value = 0xaa; + break; + + case 0x2663: + byte_stream_value = 0xa7; + break; + + case 0x2665: + byte_stream_value = 0xa9; + break; + + case 0x2666: + byte_stream_value = 0xa8; + break; + + case 0x3008: + byte_stream_value = 0xe1; + break; + + case 0x3009: + byte_stream_value = 0xf1; + break; + + case 0xf8e5: + byte_stream_value = 0x60; + break; + + case 0xf8ff: + byte_stream_value = 0xf0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_symbol.h libbde-20240223/libuna/libuna_codepage_mac_symbol.h --- libbde-20190102/libuna/libuna_codepage_mac_symbol.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_symbol.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * MacSymbol codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_SYMBOL_H ) +#define _LIBUNA_CODEPAGE_MAC_SYMBOL_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_symbol_unicode_character_size_to_byte_stream( + libuna_unicode_character_t unicode_character, + size_t *byte_stream_character_size, + libcerror_error_t **error ); + +int libuna_codepage_mac_symbol_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_symbol_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_SYMBOL_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_thai.c libbde-20240223/libuna/libuna_codepage_mac_thai.c --- libbde-20190102/libuna/libuna_codepage_mac_thai.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_thai.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,330 @@ +/* + * MacThai codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_thai.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacThai codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_thai_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00ab, 0x00bb, 0x2026, 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x201c, 0x201d, 0x0e4d, + 0xfffd, 0x2022, 0x0e31, 0x0e47, 0x0e34, 0x0e35, 0x0e36, 0x0e37, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x2018, 0x2019, 0xfffd, + 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, + 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, + 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, + 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, + 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, + 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, + 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, + 0x0e38, 0x0e39, 0x0e3a, 0x2060, 0x200b, 0x2013, 0x2014, 0x0e3f, + 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x2122, 0x0e4f, + 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, + 0x0e58, 0x0e59, 0x00ae, 0x00a9, 0xfffd, 0xfffd, 0xfffd, 0xfffd +}; + +/* Unicode to ASCII character lookup tables for the MacThai codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_thai_unicode_to_byte_stream_base_0x0e00[ 96 ] = { + 0x1a, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0x1a, 0x1a, 0x1a, 0x1a, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0x1a, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_thai_unicode_to_byte_stream_base_0x2008[ 32 ] = { + 0x1a, 0x1a, 0x1a, 0xdc, 0x1a, 0x1a, 0x1a, 0x1a, + 0x1a, 0x1a, 0x1a, 0xdd, 0xde, 0x1a, 0x1a, 0x1a, + 0x9d, 0x9e, 0x1a, 0x1a, 0x8d, 0x8e, 0x1a, 0x1a, + 0x1a, 0x1a, 0x91, 0x1a, 0x1a, 0x1a, 0x82, 0x1a +}; + +/* Determines the size of a MacThai encoded byte stream from an Unicode character + * Adds the size to the byte stream character size value + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error + */ +int libuna_codepage_mac_thai_unicode_character_size_to_byte_stream( + libuna_unicode_character_t unicode_character, + size_t *byte_stream_character_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_thai_unicode_character_size_to_byte_stream"; + int result = 0; + + if( byte_stream_character_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream character size.", + function ); + + return( -1 ); + } + switch( unicode_character ) + { + case 0x00000e31UL: + case 0x00000e34UL: + case 0x00000e35UL: + case 0x00000e36UL: + case 0x00000e37UL: + case 0x00000e47UL: + case 0x00000e48UL: + case 0x00000e49UL: + case 0x00000e4aUL: + case 0x00000e4bUL: + case 0x00000e4cUL: + case 0x00000e4dUL: + result = 0; + break; + + default: + *byte_stream_character_size += 1; + + result = 1; + break; + } + return( result ); +} + +/* Copies an Unicode character from a MacThai encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_thai_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_thai_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_thai_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacThai encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_thai_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_thai_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( ( unicode_character < 0x0080 ) + || ( unicode_character == 0x00a0 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0e00 ) + && ( unicode_character < 0x0e60 ) ) + { + unicode_character -= 0x0e00; + + byte_stream_value = libuna_codepage_mac_thai_unicode_to_byte_stream_base_0x0e00[ unicode_character ]; + } + else if( ( unicode_character >= 0x2008 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2008; + + byte_stream_value = libuna_codepage_mac_thai_unicode_to_byte_stream_base_0x2008[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00a9: + byte_stream_value = 0xfb; + break; + + case 0x00ab: + byte_stream_value = 0x80; + break; + + case 0x00ae: + byte_stream_value = 0xfa; + break; + + case 0x00bb: + byte_stream_value = 0x81; + break; + + case 0x2060: + byte_stream_value = 0xdb; + break; + + case 0x2122: + byte_stream_value = 0xee; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_thai.h libbde-20240223/libuna/libuna_codepage_mac_thai.h --- libbde-20190102/libuna/libuna_codepage_mac_thai.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_thai.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * MacThai codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_THAI_H ) +#define _LIBUNA_CODEPAGE_MAC_THAI_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_thai_unicode_character_size_to_byte_stream( + libuna_unicode_character_t unicode_character, + size_t *byte_stream_character_size, + libcerror_error_t **error ); + +int libuna_codepage_mac_thai_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_thai_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_THAI_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_turkish.c libbde-20240223/libuna/libuna_codepage_mac_turkish.c --- libbde-20190102/libuna/libuna_codepage_mac_turkish.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_turkish.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,397 @@ +/* + * MacTurkish codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_turkish.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacTurkish codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_turkish_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, + 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, + 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, + 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, + 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, + 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, + 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x03a9, 0x00e6, 0x00f8, + 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, + 0x00ff, 0x0178, 0x011e, 0x011f, 0x0130, 0x0131, 0x015e, 0x015f, + 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, + 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, + 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0xf8a0, 0x02c6, 0x02dc, + 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 +}; + +/* Unicode to ASCII character lookup tables for the MacTurkish codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_turkish_unicode_to_byte_stream_base_0x00a0[ 96 ] = { + 0xca, 0xc1, 0xa2, 0xa3, 0x1a, 0xb4, 0x1a, 0xa4, + 0xac, 0xa9, 0xbb, 0xc7, 0xc2, 0x1a, 0xa8, 0xf8, + 0xa1, 0xb1, 0x1a, 0x1a, 0xab, 0xb5, 0xa6, 0xe1, + 0xfc, 0x1a, 0xbc, 0xc8, 0x1a, 0x1a, 0x1a, 0xc0, + 0xcb, 0xe7, 0xe5, 0xcc, 0x80, 0x81, 0xae, 0x82, + 0xe9, 0x83, 0xe6, 0xe8, 0xed, 0xea, 0xeb, 0xec, + 0x1a, 0x84, 0xf1, 0xee, 0xef, 0xcd, 0x85, 0x1a, + 0xaf, 0xf4, 0xf2, 0xf3, 0x86, 0x1a, 0x1a, 0xa7, + 0x88, 0x87, 0x89, 0x8b, 0x8a, 0x8c, 0xbe, 0x8d, + 0x8f, 0x8e, 0x90, 0x91, 0x93, 0x92, 0x94, 0x95, + 0x1a, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, + 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0x1a, 0x1a, 0xd8 +}; + +const uint8_t libuna_codepage_mac_turkish_unicode_to_byte_stream_base_0x2010[ 40 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0xe2, 0x1a, 0xd2, 0xd3, 0xe3, 0x1a, + 0xa0, 0xe0, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a, + 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, + 0xe4, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a +}; + +/* Copies an Unicode character from a MacTurkish encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_turkish_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_turkish_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_turkish_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacTurkish encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_turkish_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_turkish_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_turkish_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2038 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_turkish_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x011e: + byte_stream_value = 0xda; + break; + + case 0x011f: + byte_stream_value = 0xdb; + break; + + case 0x0130: + byte_stream_value = 0xdc; + break; + + case 0x0131: + byte_stream_value = 0xdd; + break; + + case 0x0152: + byte_stream_value = 0xce; + break; + + case 0x0153: + byte_stream_value = 0xcf; + break; + + case 0x015e: + byte_stream_value = 0xde; + break; + + case 0x015f: + byte_stream_value = 0xdf; + break; + + case 0x0178: + byte_stream_value = 0xd9; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x02c6: + byte_stream_value = 0xf6; + break; + + case 0x02c7: + byte_stream_value = 0xff; + break; + + case 0x02d8: + byte_stream_value = 0xf9; + break; + + case 0x02d9: + byte_stream_value = 0xfa; + break; + + case 0x02da: + byte_stream_value = 0xfb; + break; + + case 0x02db: + byte_stream_value = 0xfe; + break; + + case 0x02dc: + byte_stream_value = 0xf7; + break; + + case 0x02dd: + byte_stream_value = 0xfd; + break; + + case 0x03a9: + byte_stream_value = 0xbd; + break; + + case 0x03c0: + byte_stream_value = 0xb9; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2202: + byte_stream_value = 0xb6; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x220f: + byte_stream_value = 0xb8; + break; + + case 0x2211: + byte_stream_value = 0xb7; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x222b: + byte_stream_value = 0xba; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + case 0x25ca: + byte_stream_value = 0xd7; + break; + + case 0xf8a0: + byte_stream_value = 0xf5; + break; + + case 0xf8ff: + byte_stream_value = 0xf0; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_turkish.h libbde-20240223/libuna/libuna_codepage_mac_turkish.h --- libbde-20190102/libuna/libuna_codepage_mac_turkish.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_turkish.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacTurkish codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_TURKISH_H ) +#define _LIBUNA_CODEPAGE_MAC_TURKISH_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_turkish_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_turkish_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_TURKISH_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_ukrainian.c libbde-20240223/libuna/libuna_codepage_mac_ukrainian.c --- libbde-20190102/libuna/libuna_codepage_mac_ukrainian.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_ukrainian.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,321 @@ +/* + * MacUkrainian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_codepage_mac_ukrainian.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" + +/* Extended ASCII to Unicode character lookup table for the MacUkrainian codepage + * Unknown are filled with the Unicode replacement character 0xfffd + */ +const uint16_t libuna_codepage_mac_ukrainian_byte_stream_to_unicode_base_0x80[ 128 ] = { + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, + 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, + 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, + 0x2020, 0x00b0, 0x0490, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x0406, + 0x00ae, 0x00a9, 0x2122, 0x0402, 0x0452, 0x2260, 0x0403, 0x0453, + 0x221e, 0x00b1, 0x2264, 0x2265, 0x0456, 0x00b5, 0x0491, 0x0408, + 0x0404, 0x0454, 0x0407, 0x0457, 0x0409, 0x0459, 0x040a, 0x045a, + 0x0458, 0x0405, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, + 0x00bb, 0x2026, 0x00a0, 0x040b, 0x045b, 0x040c, 0x045c, 0x0455, + 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x201e, + 0x040e, 0x045e, 0x040f, 0x045f, 0x2116, 0x0401, 0x0451, 0x044f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x00a4 +}; + +/* Unicode to ASCII character lookup tables for the MacUkrainian codepage + * Unknown are filled with the ASCII replacement character 0x1a + */ +const uint8_t libuna_codepage_mac_ukrainian_unicode_to_byte_stream_base_0x00a0[ 32 ] = { + 0xca, 0x1a, 0x1a, 0xa3, 0xff, 0x1a, 0x1a, 0xa4, + 0x1a, 0xa9, 0x1a, 0xc7, 0xc2, 0x1a, 0xa8, 0x1a, + 0xa1, 0xb1, 0x1a, 0x1a, 0x1a, 0xb5, 0xa6, 0x1a, + 0x1a, 0x1a, 0x1a, 0xc8, 0x1a, 0x1a, 0x1a, 0x1a +}; + +const uint8_t libuna_codepage_mac_ukrainian_unicode_to_byte_stream_base_0x0400[ 96 ] = { + 0x1a, 0xdd, 0xab, 0xae, 0xb8, 0xc1, 0xa7, 0xba, + 0xb7, 0xbc, 0xbe, 0xcb, 0xcd, 0x1a, 0xd8, 0xda, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xdf, + 0x1a, 0xde, 0xac, 0xaf, 0xb9, 0xcf, 0xb4, 0xbb, + 0xc0, 0xbd, 0xbf, 0xcc, 0xce, 0x1a, 0xd9, 0xdb +}; + +const uint8_t libuna_codepage_mac_ukrainian_unicode_to_byte_stream_base_0x2010[ 24 ] = { + 0x1a, 0x1a, 0x1a, 0xd0, 0xd1, 0x1a, 0x1a, 0x1a, + 0xd4, 0xd5, 0x1a, 0x1a, 0xd2, 0xd3, 0xd7, 0x1a, + 0xa0, 0x1a, 0xa5, 0x1a, 0x1a, 0x1a, 0xc9, 0x1a +}; + +/* Copies an Unicode character from a MacUkrainian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_ukrainian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_ukrainian_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_mac_ukrainian_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a MacUkrainian encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_mac_ukrainian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_mac_ukrainian_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_mac_ukrainian_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0400 ) + && ( unicode_character < 0x0460 ) ) + { + unicode_character -= 0x0400; + + byte_stream_value = libuna_codepage_mac_ukrainian_unicode_to_byte_stream_base_0x0400[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_mac_ukrainian_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00f7: + byte_stream_value = 0xd6; + break; + + case 0x0192: + byte_stream_value = 0xc4; + break; + + case 0x0490: + byte_stream_value = 0xa2; + break; + + case 0x0491: + byte_stream_value = 0xb6; + break; + + case 0x2116: + byte_stream_value = 0xdc; + break; + + case 0x2122: + byte_stream_value = 0xaa; + break; + + case 0x2206: + byte_stream_value = 0xc6; + break; + + case 0x221a: + byte_stream_value = 0xc3; + break; + + case 0x221e: + byte_stream_value = 0xb0; + break; + + case 0x2248: + byte_stream_value = 0xc5; + break; + + case 0x2260: + byte_stream_value = 0xad; + break; + + case 0x2264: + byte_stream_value = 0xb2; + break; + + case 0x2265: + byte_stream_value = 0xb3; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_mac_ukrainian.h libbde-20240223/libuna/libuna_codepage_mac_ukrainian.h --- libbde-20190102/libuna/libuna_codepage_mac_ukrainian.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_mac_ukrainian.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * MacUkrainian codepage functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_CODEPAGE_MAC_UKRAINIAN_H ) +#define _LIBUNA_CODEPAGE_MAC_UKRAINIAN_H + +#include +#include + +#include "libuna_libcerror.h" +#include "libuna_types.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int libuna_codepage_mac_ukrainian_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_mac_ukrainian_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_CODEPAGE_MAC_UKRAINIAN_H ) */ + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1250.c libbde-20240223/libuna/libuna_codepage_windows_1250.c --- libbde-20190102/libuna/libuna_codepage_windows_1250.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1250.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1250 codepage (Central European) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1250.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1250 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1250 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 }; -/* Unicode to ASCII character lookup table for Windows 1250 codepage +/* Unicode to ASCII character lookup tables for the Windows 1250 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ 128 ] = { @@ -95,3 +97,217 @@ 0x1a, 0x8b, 0x9b, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }; +/* Copies an Unicode character from a Windows 1250 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1250_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1250_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1250 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1250_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1250_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0120 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0138 ) + && ( unicode_character < 0x0180 ) ) + { + unicode_character -= 0x0138; + + byte_stream_value = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x0138[ unicode_character ]; + } + else if( ( unicode_character >= 0x02d8 ) + && ( unicode_character < 0x02e0 ) ) + { + unicode_character -= 0x02d8; + + byte_stream_value = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x02d8[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else if( ( unicode_character >= 0x2030 ) + && ( unicode_character < 0x2040 ) ) + { + unicode_character -= 0x2030; + + byte_stream_value = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2030[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x02c7: + byte_stream_value = 0xa1; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1250.h libbde-20240223/libuna/libuna_codepage_windows_1250.h --- libbde-20190102/libuna/libuna_codepage_windows_1250.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1250.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1250 codepage (Central European) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1250_H ) @@ -25,17 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ 128 ]; -extern const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x0138[ 72 ]; -extern const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x02d8[ 8 ]; -extern const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2010[ 24 ]; -extern const uint8_t libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2030[ 16 ]; +int libuna_codepage_windows_1250_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1250_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1251.c libbde-20240223/libuna/libuna_codepage_windows_1251.c --- libbde-20190102/libuna/libuna_codepage_windows_1251.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1251.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1251 codepage (Cyrillic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1251.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1251 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1251 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f }; -/* Unicode to ASCII character lookup table for Windows 1251 codepage +/* Unicode to ASCII character lookup tables for the Windows 1251 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ 32 ] = { @@ -77,3 +79,223 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1251 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1251_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1251_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1251 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1251_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1251_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0400 ) + && ( unicode_character < 0x0460 ) ) + { + unicode_character -= 0x0400; + + byte_stream_value = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x0400[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0490: + byte_stream_value = 0xa5; + break; + + case 0x0491: + byte_stream_value = 0xb4; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ac: + byte_stream_value = 0x88; + break; + + case 0x2116: + byte_stream_value = 0xb9; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1251.h libbde-20240223/libuna/libuna_codepage_windows_1251.h --- libbde-20190102/libuna/libuna_codepage_windows_1251.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1251.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1251 codepage (Cyrillic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1251_H ) @@ -25,15 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ 32 ]; -extern const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x0400[ 96 ]; -extern const uint8_t libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1251_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1251_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1252.c libbde-20240223/libuna/libuna_codepage_windows_1252.c --- libbde-20190102/libuna/libuna_codepage_windows_1252.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1252.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1252 codepage (Western European/Latin 1) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1252.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1252 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1252 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ 32 ] = { @@ -34,7 +36,7 @@ 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0xfffd, 0x017e, 0x0178 }; -/* Unicode to ASCII character lookup table for Windows 1252 codepage +/* Unicode to ASCII character lookup tables for the Windows 1252 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ 24 ] = { @@ -43,3 +45,243 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1252 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1252_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1252_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( ( byte_stream_character < 0x80 ) + || ( byte_stream_character >= 0xa0 ) ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1252 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1252_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1252_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0100 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0152: + byte_stream_value = 0x8c; + break; + + case 0x0153: + byte_stream_value = 0x9c; + break; + + case 0x0160: + byte_stream_value = 0x8a; + break; + + case 0x0161: + byte_stream_value = 0x9a; + break; + + case 0x0178: + byte_stream_value = 0x9f; + break; + + case 0x017d: + byte_stream_value = 0x8e; + break; + + case 0x017e: + byte_stream_value = 0x9e; + break; + + case 0x0192: + byte_stream_value = 0x83; + break; + + case 0x02c6: + byte_stream_value = 0x88; + break; + + case 0x02dc: + byte_stream_value = 0x98; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1252.h libbde-20240223/libuna/libuna_codepage_windows_1252.h --- libbde-20190102/libuna/libuna_codepage_windows_1252.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1252.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1252 codepage (Western European/Latin 1) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1252_H ) @@ -25,13 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ 32 ]; - -extern const uint8_t libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1252_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1252_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1253.c libbde-20240223/libuna/libuna_codepage_windows_1253.c --- libbde-20190102/libuna/libuna_codepage_windows_1253.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1253.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1253 codepage (Greek) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1253.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1253 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1253 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0xfffd }; -/* Unicode to ASCII character lookup table for Windows 1253 codepage +/* Unicode to ASCII character lookup tables for the Windows 1253 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ 32 ] = { @@ -75,3 +77,215 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1253 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1253_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1253_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1253 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1253_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1253_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0380 ) + && ( unicode_character < 0x03d0 ) ) + { + unicode_character -= 0x0380; + + byte_stream_value = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x0380[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0192: + byte_stream_value = 0x83; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1253.h libbde-20240223/libuna/libuna_codepage_windows_1253.h --- libbde-20190102/libuna/libuna_codepage_windows_1253.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1253.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1253 codepage (Greek) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1253_H ) @@ -25,15 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ 32 ]; -extern const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x0380[ 80 ]; -extern const uint8_t libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1253_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1253_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1254.c libbde-20240223/libuna/libuna_codepage_windows_1254.c --- libbde-20190102/libuna/libuna_codepage_windows_1254.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1254.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1254 codepage (Turkish) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1254.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1254 codepage +/* Extended ASCII to Unicode character lookup tables for the Windows 1254 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ 32 ] = { @@ -44,7 +46,7 @@ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, }; -/* Unicode to ASCII character lookup table for Windows 1254 codepage +/* Unicode to ASCII character lookup tables for the Windows 1254 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ 48 ] = { @@ -62,3 +64,285 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a, }; +/* Copies an Unicode character from a Windows 1254 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1254_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1254_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else if( byte_stream_character < 0xa0 ) + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + else if( byte_stream_character < 0xd0 ) + { + safe_unicode_character = byte_stream_character; + } + else if( byte_stream_character < 0xe0 ) + { + byte_stream_character -= 0xd0; + + safe_unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xd0[ byte_stream_character ]; + } + else if( byte_stream_character < 0xf0 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0xf0; + + safe_unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xf0[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1254 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1254_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1254_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00d0 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00d0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00d0; + + byte_stream_value = libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x011e: + byte_stream_value = 0xd0; + break; + + case 0x011f: + byte_stream_value = 0xf0; + break; + + case 0x0130: + byte_stream_value = 0xdd; + break; + + case 0x0131: + byte_stream_value = 0xfd; + break; + + case 0x0152: + byte_stream_value = 0x8c; + break; + + case 0x0153: + byte_stream_value = 0x9c; + break; + + case 0x015e: + byte_stream_value = 0xde; + break; + + case 0x015f: + byte_stream_value = 0xfe; + break; + + case 0x0160: + byte_stream_value = 0x8a; + break; + + case 0x0161: + byte_stream_value = 0x9a; + break; + + case 0x0178: + byte_stream_value = 0x9f; + break; + + case 0x0192: + byte_stream_value = 0x83; + break; + + case 0x02c6: + byte_stream_value = 0x88; + break; + + case 0x02dc: + byte_stream_value = 0x98; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1254.h libbde-20240223/libuna/libuna_codepage_windows_1254.h --- libbde-20190102/libuna/libuna_codepage_windows_1254.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1254.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1254 codepage (Turkish) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1254_H ) @@ -25,16 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ 32 ]; -extern const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xd0[ 16 ]; -extern const uint16_t libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xf0[ 16 ]; - -extern const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ 48 ]; -extern const uint8_t libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1254_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1254_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1255.c libbde-20240223/libuna/libuna_codepage_windows_1255.c --- libbde-20190102/libuna/libuna_codepage_windows_1255.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1255.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1255 codepage (Hebrew) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1255.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1255 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1255 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x05e8, 0x05e9, 0x05ea, 0xfffd, 0xfffd, 0x200e, 0x200f, 0xfffd }; -/* Unicode to ASCII character lookup table for Windows 1255 codepage +/* Unicode to ASCII character lookup tables for the Windows 1255 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ 32 ] = { @@ -76,3 +78,251 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1255 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1255_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1255_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1255 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1255_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1255_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x05b0 ) + && ( unicode_character < 0x05c8 ) ) + { + unicode_character -= 0x05b0; + + byte_stream_value = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05b0[ unicode_character ]; + } + else if( ( unicode_character >= 0x05d0 ) + && ( unicode_character < 0x05f8 ) ) + { + unicode_character -= 0x05d0; + + byte_stream_value = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05d0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00d7: + byte_stream_value = 0xaa; + break; + + case 0x00f7: + byte_stream_value = 0xba; + break; + + case 0x0192: + byte_stream_value = 0x83; + break; + + case 0x02c6: + byte_stream_value = 0x88; + break; + + case 0x02dc: + byte_stream_value = 0x98; + break; + + case 0x200e: + byte_stream_value = 0xfd; + break; + + case 0x200f: + byte_stream_value = 0xfe; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20aa: + byte_stream_value = 0xa4; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1255.h libbde-20240223/libuna/libuna_codepage_windows_1255.h --- libbde-20190102/libuna/libuna_codepage_windows_1255.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1255.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1255 codepage (Hebrew) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1255_H ) @@ -25,16 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ 32 ]; -extern const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05b0[ 24 ]; -extern const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05d0[ 40 ]; -extern const uint8_t libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1255_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1255_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1256.c libbde-20240223/libuna/libuna_codepage_windows_1256.c --- libbde-20190102/libuna/libuna_codepage_windows_1256.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1256.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1256 codepage (Arabic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1256.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1256 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1256 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x0651, 0x00f9, 0x0652, 0x00fb, 0x00fc, 0x200e, 0x200f, 0x06d2 }; -/* Unicode to ASCII character lookup table for Windows 1256 codepage +/* Unicode to ASCII character lookup tables for the Windows 1256 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ 32 ] = { @@ -81,3 +83,290 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1256 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1256_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1256_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1256 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1256_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1256_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x00e0 ) + && ( unicode_character < 0x0100 ) ) + { + unicode_character -= 0x00e0; + + byte_stream_value = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00e0[ unicode_character ]; + } + else if( ( unicode_character >= 0x0618 ) + && ( unicode_character < 0x0658 ) ) + { + unicode_character -= 0x0618; + + byte_stream_value = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x0618[ unicode_character ]; + } + else if( ( unicode_character >= 0x2008 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2008; + + byte_stream_value = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x2008[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x00d7: + byte_stream_value = 0xd7; + break; + + case 0x0152: + byte_stream_value = 0x8c; + break; + + case 0x0153: + byte_stream_value = 0x9c; + break; + + case 0x0192: + byte_stream_value = 0x83; + break; + + case 0x02c6: + byte_stream_value = 0x88; + break; + + case 0x060c: + byte_stream_value = 0xa1; + break; + + case 0x0679: + byte_stream_value = 0x8a; + break; + + case 0x067e: + byte_stream_value = 0x81; + break; + + case 0x0686: + byte_stream_value = 0x8d; + break; + + case 0x0688: + byte_stream_value = 0x8f; + break; + + case 0x0691: + byte_stream_value = 0x9a; + break; + + case 0x0698: + byte_stream_value = 0x8e; + break; + + case 0x06a9: + byte_stream_value = 0x98; + break; + + case 0x06af: + byte_stream_value = 0x90; + break; + + case 0x06ba: + byte_stream_value = 0x9f; + break; + + case 0x06be: + byte_stream_value = 0xaa; + break; + + case 0x06c1: + byte_stream_value = 0xc0; + break; + + case 0x06d2: + byte_stream_value = 0xff; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1256.h libbde-20240223/libuna/libuna_codepage_windows_1256.h --- libbde-20190102/libuna/libuna_codepage_windows_1256.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1256.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1256 codepage (Arabic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1256_H ) @@ -25,16 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ 32 ]; -extern const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00e0[ 32 ]; -extern const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x0618[ 64 ]; -extern const uint8_t libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x2008[ 32 ]; +int libuna_codepage_windows_1256_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1256_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1257.c libbde-20240223/libuna/libuna_codepage_windows_1257.c --- libbde-20190102/libuna/libuna_codepage_windows_1257.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1257.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1257 codepage (Baltic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1257.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1257 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1257 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x02d9 }; -/* Unicode to ASCII character lookup table for Windows 1257 codepage +/* Unicode to ASCII character lookup tables for the Windows 1257 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ 224 ] = { @@ -86,3 +88,216 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1257 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1257_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1257_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1257 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1257_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1257_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x0180 ) ) + { + unicode_character -= 0x00a0; + + byte_stream_value = libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x02c7: + byte_stream_value = 0x8e; + break; + + case 0x02d9: + byte_stream_value = 0xff; + break; + + case 0x02db: + byte_stream_value = 0x9e; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1257.h libbde-20240223/libuna/libuna_codepage_windows_1257.h --- libbde-20190102/libuna/libuna_codepage_windows_1257.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1257.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1257 codepage (Baltic) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1257_H ) @@ -25,14 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ 224 ]; -extern const uint8_t libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1257_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1257_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1258.c libbde-20240223/libuna/libuna_codepage_windows_1258.c --- libbde-20190102/libuna/libuna_codepage_windows_1258.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1258.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 1258 codepage (Vietnamese) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_1258.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 1258 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 1258 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x01b0, 0x20ab, 0x00ff }; -/* Unicode to ASCII character lookup table for Windows 1258 codepage +/* Unicode to ASCII character lookup tables for the Windows 1258 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ 72 ] = { @@ -67,3 +69,281 @@ 0x86, 0x87, 0x95, 0x1a, 0x1a, 0x1a, 0x85, 0x1a }; +/* Copies an Unicode character from a Windows 1258 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1258_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1258_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 1258 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_1258_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_1258_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( unicode_character < 0x0080 ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00a0 ) + && ( unicode_character < 0x00c0 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x00c0 ) + && ( unicode_character < 0x0108 ) ) + { + unicode_character -= 0x00c0; + + byte_stream_value = libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; + } + else if( ( unicode_character >= 0x2010 ) + && ( unicode_character < 0x2028 ) ) + { + unicode_character -= 0x2010; + + byte_stream_value = libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x2010[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x0110: + byte_stream_value = 0xd0; + break; + + case 0x0111: + byte_stream_value = 0xf0; + break; + + case 0x0152: + byte_stream_value = 0x8c; + break; + + case 0x0153: + byte_stream_value = 0x9c; + break; + + case 0x0178: + byte_stream_value = 0x9f; + break; + + case 0x0192: + byte_stream_value = 0x83; + break; + + case 0x01a0: + byte_stream_value = 0xd5; + break; + + case 0x01a1: + byte_stream_value = 0xf5; + break; + + case 0x01af: + byte_stream_value = 0xdd; + break; + + case 0x01b0: + byte_stream_value = 0xfd; + break; + + case 0x02c6: + byte_stream_value = 0x88; + break; + + case 0x02dc: + byte_stream_value = 0x98; + break; + + case 0x0300: + byte_stream_value = 0xcc; + break; + + case 0x0301: + byte_stream_value = 0xec; + break; + + case 0x0303: + byte_stream_value = 0xde; + break; + + case 0x0309: + byte_stream_value = 0xd2; + break; + + case 0x0323: + byte_stream_value = 0xf2; + break; + + case 0x2030: + byte_stream_value = 0x89; + break; + + case 0x2039: + byte_stream_value = 0x8b; + break; + + case 0x203a: + byte_stream_value = 0x9b; + break; + + case 0x20ab: + byte_stream_value = 0xfe; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + case 0x2122: + byte_stream_value = 0x99; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_1258.h libbde-20240223/libuna/libuna_codepage_windows_1258.h --- libbde-20190102/libuna/libuna_codepage_windows_1258.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_1258.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 1258 codepage (Vietnamese) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_1258_H ) @@ -25,14 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ 72 ]; -extern const uint8_t libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x2010[ 24 ]; +int libuna_codepage_windows_1258_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_1258_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_874.c libbde-20240223/libuna/libuna_codepage_windows_874.c --- libbde-20190102/libuna/libuna_codepage_windows_874.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_874.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,30 +1,32 @@ /* * Windows 874 codepage (Thai) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include #include #include "libuna_codepage_windows_874.h" +#include "libuna_libcerror.h" +#include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 874 codepage +/* Extended ASCII to Unicode character lookup table for the Windows 874 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ 128 ] = { @@ -46,7 +48,7 @@ 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0xfffd, 0xfffd, 0xfffd, 0xfffd }; -/* Unicode to ASCII character lookup table for Windows 874 codepage +/* Unicode to ASCII character lookup tables for the Windows 874 codepage * Unknown are filled with the ASCII replacement character 0x1a */ const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ 96 ] = { @@ -68,3 +70,205 @@ 0x91, 0x92, 0x1a, 0x1a, 0x93, 0x94, 0x1a, 0x1a }; +/* Copies an Unicode character from a Windows 874 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_874_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_874_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + byte_stream_character = byte_stream[ safe_byte_stream_index++ ]; + + if( byte_stream_character < 0x80 ) + { + safe_unicode_character = byte_stream_character; + } + else + { + byte_stream_character -= 0x80; + + safe_unicode_character = libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; + } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + +/* Copies an Unicode character to a Windows 874 encoded byte stream + * Returns 1 if successful or -1 on error + */ +int libuna_codepage_windows_874_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_codepage_windows_874_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; + + if( byte_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream.", + function ); + + return( -1 ); + } + if( byte_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid byte stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( byte_stream_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid byte stream index.", + function ); + + return( -1 ); + } + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: byte stream too small.", + function ); + + return( -1 ); + } + if( ( unicode_character < 0x0080 ) + || ( unicode_character == 0x00a0 ) ) + { + byte_stream_value = (uint16_t) unicode_character; + } + else if( ( unicode_character >= 0x0e00 ) + && ( unicode_character < 0x0e60 ) ) + { + unicode_character -= 0x0e00; + + byte_stream_value = libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ unicode_character ]; + } + else if( ( unicode_character >= 0x2018 ) + && ( unicode_character < 0x2020 ) ) + { + unicode_character -= 0x2018; + + byte_stream_value = libuna_codepage_windows_874_unicode_to_byte_stream_base_0x2018[ unicode_character ]; + } + else switch( unicode_character ) + { + case 0x2013: + byte_stream_value = 0x96; + break; + + case 0x2014: + byte_stream_value = 0x97; + break; + + case 0x2022: + byte_stream_value = 0x95; + break; + + case 0x2026: + byte_stream_value = 0x85; + break; + + case 0x20ac: + byte_stream_value = 0x80; + break; + + default: + byte_stream_value = 0x1a; + break; + } + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); + + *byte_stream_index = safe_byte_stream_index; + + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_codepage_windows_874.h libbde-20240223/libuna/libuna_codepage_windows_874.h --- libbde-20190102/libuna/libuna_codepage_windows_874.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_874.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 874 codepage (Thai) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_874_H ) @@ -25,14 +25,26 @@ #include #include +#include "libuna_libcerror.h" +#include "libuna_types.h" + #if defined( __cplusplus ) extern "C" { #endif -extern const uint16_t libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ 128 ]; - -extern const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ 96 ]; -extern const uint8_t libuna_codepage_windows_874_unicode_to_byte_stream_base_0x2018[ 8 ]; +int libuna_codepage_windows_874_copy_from_byte_stream( + libuna_unicode_character_t *unicode_character, + const uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); + +int libuna_codepage_windows_874_copy_to_byte_stream( + libuna_unicode_character_t unicode_character, + uint8_t *byte_stream, + size_t byte_stream_size, + size_t *byte_stream_index, + libcerror_error_t **error ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_932.c libbde-20240223/libuna/libuna_codepage_windows_932.c --- libbde-20190102/libuna/libuna_codepage_windows_932.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_932.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 932 codepage (Japanese Shift-JIS) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -26,7 +26,7 @@ #include "libuna_libcerror.h" #include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 932 codepage +/* Extended ASCII to Unicode character lookup tables for the Windows 932 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8140[ 109 ] = { @@ -1134,10 +1134,9 @@ 0x9d6b, 0xfa2d, 0x9e19, 0x9ed1 }; -/* Unicode to ASCII character lookup table for Windows 932 codepage +/* Unicode to ASCII character lookup tables for the Windows 932 codepage * Unknown are filled with the ASCII replacement character 0x1a */ - const uint16_t libuna_codepage_windows_932_unicode_to_byte_stream_base_0x0080[ 128 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, @@ -4181,9 +4180,9 @@ 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; -/* Determines the size of a byte stream character from an Unicode character +/* Determines the size of a Windows 932 encoded byte stream from an Unicode character * Adds the size to the byte stream character size value - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error */ int libuna_codepage_windows_932_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, @@ -4285,9 +4284,11 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_932_copy_from_byte_stream"; - uint8_t additional_character = 0; - uint8_t byte_stream_character = 0; + static char *function = "libuna_codepage_windows_932_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t additional_character = 0; + uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { @@ -4333,7 +4334,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -4344,22 +4347,22 @@ return( -1 ); } - byte_stream_character = byte_stream[ *byte_stream_index ]; + byte_stream_character = byte_stream[ safe_byte_stream_index ]; if( byte_stream_character < 0x80 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else if( ( byte_stream_character >= 0xa1 ) && ( byte_stream_character < 0xe0 ) ) { - *unicode_character = 0xff61 + byte_stream_character - 0xa1; + safe_unicode_character = 0xff61 + byte_stream_character - 0xa1; } - else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) + else if( ( safe_byte_stream_index + 1 ) <= byte_stream_size ) { - *byte_stream_index += 1; + safe_byte_stream_index += 1; - additional_character = byte_stream[ *byte_stream_index ]; + additional_character = byte_stream[ safe_byte_stream_index ]; if( byte_stream_character == 0x81 ) { @@ -4368,43 +4371,39 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8140[ additional_character ]; } else if( ( additional_character >= 0xb8 ) && ( additional_character < 0xc0 ) ) { additional_character -= 0xb8; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81b8[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81b8[ additional_character ]; } else if( ( additional_character >= 0xc8 ) && ( additional_character < 0xcf ) ) { additional_character -= 0xc8; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81c8[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81c8[ additional_character ]; } else if( ( additional_character >= 0xda ) && ( additional_character < 0xe9 ) ) { additional_character -= 0xda; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81da[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81da[ additional_character ]; } else if( ( additional_character >= 0xf0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xf0; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81f0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x81f0[ additional_character ]; } else if( additional_character == 0xfc ) { - *unicode_character = 0x25ef; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x25ef; } } else if( byte_stream_character == 0x82 ) @@ -4412,26 +4411,22 @@ if( ( additional_character >= 0x4f ) && ( additional_character < 0x59 ) ) { - *unicode_character = 0xff10 - 0x4f + additional_character; + safe_unicode_character = 0xff10 - 0x4f + additional_character; } else if( ( additional_character >= 0x60 ) && ( additional_character < 0x7a ) ) { - *unicode_character = 0xff21 - 0x60 + additional_character; + safe_unicode_character = 0xff21 - 0x60 + additional_character; } else if( ( additional_character >= 0x81 ) && ( additional_character < 0x9b ) ) { - *unicode_character = 0xff41 - 0x81 + additional_character; + safe_unicode_character = 0xff41 - 0x81 + additional_character; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xf2 ) ) { - *unicode_character = 0x3041 - 0x9f + additional_character; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x3041 - 0x9f + additional_character; } } else if( byte_stream_character == 0x83 ) @@ -4439,36 +4434,32 @@ if( ( additional_character >= 0x40 ) && ( additional_character < 0x7f ) ) { - *unicode_character = 0x30a1 - 0x40 + additional_character; + safe_unicode_character = 0x30a1 - 0x40 + additional_character; } else if( ( additional_character >= 0x80 ) && ( additional_character < 0x97 ) ) { - *unicode_character = 0x30e0 - 0x80 + additional_character; + safe_unicode_character = 0x30e0 - 0x80 + additional_character; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xb0 ) ) { - *unicode_character = 0x0391 - 0x9f + additional_character; + safe_unicode_character = 0x0391 - 0x9f + additional_character; } else if( ( additional_character >= 0xb0 ) && ( additional_character < 0xb7 ) ) { - *unicode_character = 0x03a3 - 0xb0 + additional_character; + safe_unicode_character = 0x03a3 - 0xb0 + additional_character; } else if( ( additional_character >= 0xbf ) && ( additional_character < 0xd0 ) ) { - *unicode_character = 0x03b1 - 0xbf + additional_character; + safe_unicode_character = 0x03b1 - 0xbf + additional_character; } else if( ( additional_character >= 0xd0 ) && ( additional_character < 0xd7 ) ) { - *unicode_character = 0x03c3 - 0xd0 + additional_character; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x03c3 - 0xd0 + additional_character; } } else if( byte_stream_character == 0x84 ) @@ -4478,30 +4469,26 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8440[ additional_character ]; } else if( ( additional_character >= 0x70 ) && ( additional_character < 0x7f ) ) { additional_character -= 0x70; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8470[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8470[ additional_character ]; } else if( ( additional_character >= 0x80 ) && ( additional_character < 0x92 ) ) { - *unicode_character = 0x043e - 0x80 + additional_character; + safe_unicode_character = 0x043e - 0x80 + additional_character; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xbf ) ) { additional_character -= 0x9f; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x849f[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x849f[ additional_character ]; } } else if( byte_stream_character == 0x87 ) @@ -4509,34 +4496,30 @@ if( ( additional_character >= 0x40 ) && ( additional_character < 0x54 ) ) { - *unicode_character = 0x2460 - 0x40 + additional_character; + safe_unicode_character = 0x2460 - 0x40 + additional_character; } else if( ( additional_character >= 0x54 ) && ( additional_character < 0x5e ) ) { - *unicode_character = 0x2160 - 0x54 + additional_character; + safe_unicode_character = 0x2160 - 0x54 + additional_character; } else if( ( additional_character >= 0x5f ) && ( additional_character < 0x76 ) ) { additional_character -= 0x5f; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x875f[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x875f[ additional_character ]; } else if( additional_character == 0x7e ) { - *unicode_character = 0x337b; + safe_unicode_character = 0x337b; } else if( ( additional_character >= 0x80 ) && ( additional_character < 0x9d ) ) { additional_character -= 0x80; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8780[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8780[ additional_character ]; } } else if( byte_stream_character == 0x88 ) @@ -4546,11 +4529,7 @@ { additional_character -= 0x9f; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x889f[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x889f[ additional_character ]; } } else if( ( byte_stream_character >= 0x89 ) @@ -4564,70 +4543,66 @@ switch( byte_stream_character ) { case 0x89: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8940[ additional_character ]; break; case 0x8a: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8a40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8a40[ additional_character ]; break; case 0x8b: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8b40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8b40[ additional_character ]; break; case 0x8c: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8c40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8c40[ additional_character ]; break; case 0x8d: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8d40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8d40[ additional_character ]; break; case 0x8e: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8e40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8e40[ additional_character ]; break; case 0x8f: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8f40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x8f40[ additional_character ]; break; case 0x90: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9040[ additional_character ]; break; case 0x91: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9140[ additional_character ]; break; case 0x92: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9240[ additional_character ]; break; case 0x93: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9340[ additional_character ]; break; case 0x94: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9440[ additional_character ]; break; case 0x95: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9540[ additional_character ]; break; case 0x96: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9640[ additional_character ]; break; case 0x97: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9740[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0x98 ) { @@ -4636,18 +4611,14 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9840[ additional_character ]; } else if( ( additional_character >= 0x9f ) && ( additional_character < 0xfd ) ) { additional_character -= 0x9f; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x989f[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x989f[ additional_character ]; } } else if( ( byte_stream_character >= 0x99 ) @@ -4661,38 +4632,34 @@ switch( byte_stream_character ) { case 0x99: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9940[ additional_character ]; break; case 0x9a: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9a40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9a40[ additional_character ]; break; case 0x9b: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9b40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9b40[ additional_character ]; break; case 0x9c: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9c40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9c40[ additional_character ]; break; case 0x9d: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9d40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9d40[ additional_character ]; break; case 0x9e: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9e40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9e40[ additional_character ]; break; case 0x9f: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9f40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0x9f40[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( ( byte_stream_character >= 0xe0 ) && ( byte_stream_character <= 0xe9 ) ) @@ -4705,50 +4672,46 @@ switch( byte_stream_character ) { case 0xe0: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe040[ additional_character ]; break; case 0xe1: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe140[ additional_character ]; break; case 0xe2: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe240[ additional_character ]; break; case 0xe3: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe340[ additional_character ]; break; case 0xe4: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe440[ additional_character ]; break; case 0xe5: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe540[ additional_character ]; break; case 0xe6: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe640[ additional_character ]; break; case 0xe7: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe740[ additional_character ]; break; case 0xe8: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe840[ additional_character ]; break; case 0xe9: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xe940[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xea ) { @@ -4757,11 +4720,7 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xea40[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xea40[ additional_character ]; } } else if( ( byte_stream_character >= 0xed ) @@ -4775,18 +4734,14 @@ switch( byte_stream_character ) { case 0xed: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xed40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xed40[ additional_character ]; break; case 0xee: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xee40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xee40[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( ( byte_stream_character >= 0xfa ) && ( byte_stream_character <= 0xfb ) ) @@ -4799,18 +4754,14 @@ switch( byte_stream_character ) { case 0xfa: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfa40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfa40[ additional_character ]; break; case 0xfb: - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfb40[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xfc ) { @@ -4819,23 +4770,12 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfc40[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_932_byte_stream_to_unicode_base_0xfc40[ additional_character ]; } } - else - { - *unicode_character = 0xfffd; - } } - else - { - *unicode_character = 0xfffd; - } - *byte_stream_index += 1; + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index + 1; return( 1 ); } @@ -4850,8 +4790,9 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_932_copy_to_byte_stream"; - uint16_t byte_stream_value = 0x001a; + static char *function = "libuna_codepage_windows_932_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { @@ -4886,7 +4827,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -4955,17 +4898,15 @@ unicode_character -= 0xff00; byte_stream_value = libuna_codepage_windows_932_unicode_to_byte_stream_base_0xff00[ unicode_character ]; } - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); - - byte_stream_value >>= 8; - - if( byte_stream_value != 0 ) + do { - *byte_stream_index += 1; + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); + byte_stream_value >>= 8; } - *byte_stream_index += 1; + while( byte_stream_value != 0 ); + + *byte_stream_index = safe_byte_stream_index; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_932.h libbde-20240223/libuna/libuna_codepage_windows_932.h --- libbde-20190102/libuna/libuna_codepage_windows_932.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_932.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 932 codepage (Japanese Shift-JIS) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_932_H ) @@ -25,7 +25,6 @@ #include #include -#include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" @@ -33,13 +32,11 @@ extern "C" { #endif -LIBUNA_EXTERN \ int libuna_codepage_windows_932_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_932_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, @@ -47,7 +44,6 @@ size_t *byte_stream_index, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_932_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, diff -Nru libbde-20190102/libuna/libuna_codepage_windows_936.c libbde-20240223/libuna/libuna_codepage_windows_936.c --- libbde-20190102/libuna/libuna_codepage_windows_936.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_936.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 936 codepage (Chinese Simplified) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -26,7 +26,7 @@ #include "libuna_libcerror.h" #include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 936 codepage +/* Extended ASCII to Unicode character lookup tables for the Windows 936 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8140[ 192 ] = { @@ -3177,10 +3177,9 @@ 0xfa1f, 0xfa20, 0xfa21, 0xfa23, 0xfa24, 0xfa27, 0xfa28, 0xfa29 }; -/* Unicode to ASCII character lookup table for Windows 936 codepage +/* Unicode to ASCII character lookup tables for the Windows 936 codepage * Unknown are filled with the ASCII replacement character 0x1a */ - const uint16_t libuna_codepage_windows_936_unicode_to_byte_stream_base_0x0080[ 1024 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, @@ -6351,9 +6350,9 @@ 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a }; -/* Determines the size of a byte stream character from an Unicode character +/* Determines the size of a Windows 936 encoded byte stream from an Unicode character * Adds the size to the byte stream character size value - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error */ int libuna_codepage_windows_936_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, @@ -6443,9 +6442,11 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_936_copy_from_byte_stream"; - uint8_t additional_character = 0; - uint8_t byte_stream_character = 0; + static char *function = "libuna_codepage_windows_936_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t additional_character = 0; + uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { @@ -6491,7 +6492,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -6502,21 +6505,21 @@ return( -1 ); } - byte_stream_character = byte_stream[ *byte_stream_index ]; + byte_stream_character = byte_stream[ safe_byte_stream_index ]; if( byte_stream_character < 0x80 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else if( byte_stream_character == 0x80 ) { - *unicode_character = 0x20ac; + safe_unicode_character = 0x20ac; } - else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) + else if( ( safe_byte_stream_index + 1 ) <= byte_stream_size ) { - *byte_stream_index += 1; + safe_byte_stream_index += 1; - additional_character = byte_stream[ *byte_stream_index ]; + additional_character = byte_stream[ safe_byte_stream_index ]; if( ( byte_stream_character >= 0x81 ) && ( byte_stream_character <= 0xa0 ) ) @@ -6528,138 +6531,134 @@ switch( byte_stream_character ) { case 0x81: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8140[ additional_character ]; break; case 0x82: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8240[ additional_character ]; break; case 0x83: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8340[ additional_character ]; break; case 0x84: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8440[ additional_character ]; break; case 0x85: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8540[ additional_character ]; break; case 0x86: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8640[ additional_character ]; break; case 0x87: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8740[ additional_character ]; break; case 0x88: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8840[ additional_character ]; break; case 0x89: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8940[ additional_character ]; break; case 0x8a: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8a40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8a40[ additional_character ]; break; case 0x8b: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8b40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8b40[ additional_character ]; break; case 0x8c: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8c40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8c40[ additional_character ]; break; case 0x8d: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8d40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8d40[ additional_character ]; break; case 0x8e: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8e40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8e40[ additional_character ]; break; case 0x8f: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8f40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x8f40[ additional_character ]; break; case 0x90: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9040[ additional_character ]; break; case 0x91: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9140[ additional_character ]; break; case 0x92: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9240[ additional_character ]; break; case 0x93: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9340[ additional_character ]; break; case 0x94: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9440[ additional_character ]; break; case 0x95: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9540[ additional_character ]; break; case 0x96: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9640[ additional_character ]; break; case 0x97: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9740[ additional_character ]; break; case 0x98: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9840[ additional_character ]; break; case 0x99: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9940[ additional_character ]; break; case 0x9a: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9a40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9a40[ additional_character ]; break; case 0x9b: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9b40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9b40[ additional_character ]; break; case 0x9c: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9c40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9c40[ additional_character ]; break; case 0x9d: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9d40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9d40[ additional_character ]; break; case 0x9e: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9e40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9e40[ additional_character ]; break; case 0x9f: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9f40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0x9f40[ additional_character ]; break; case 0xa0: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa040[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( ( byte_stream_character >= 0xa1 ) && ( byte_stream_character <= 0xa3 ) ) @@ -6671,22 +6670,18 @@ switch( byte_stream_character ) { case 0xa1: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa1a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa1a0[ additional_character ]; break; case 0xa2: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa2a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa2a0[ additional_character ]; break; case 0xa3: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa3a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa3a0[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( ( byte_stream_character >= 0xa4 ) && ( byte_stream_character <= 0xa6 ) ) @@ -6699,22 +6694,18 @@ switch( byte_stream_character ) { case 0xa4: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa4a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa4a0[ additional_character ]; break; case 0xa5: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa5a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa5a0[ additional_character ]; break; case 0xa6: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa6a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa6a0[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xa7 ) { @@ -6723,18 +6714,14 @@ { additional_character -= 0xa0; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7a0[ additional_character ]; } else if( ( additional_character >= 0xd0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xd0; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7d0[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa7d0[ additional_character ]; } } else if( byte_stream_character == 0xa8 ) @@ -6744,18 +6731,14 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa840[ additional_character ]; } else if( ( additional_character >= 0xa0 ) && ( additional_character < 0xf0 ) ) { additional_character -= 0xa0; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa8a0[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa8a0[ additional_character ]; } } else if( byte_stream_character == 0xa9 ) @@ -6765,26 +6748,22 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa940[ additional_character ]; } else if( additional_character == 0x88 ) { - *unicode_character = 0xfe6b; + safe_unicode_character = 0xfe6b; } else if( additional_character == 0x96 ) { - *unicode_character = 0x3007; + safe_unicode_character = 0x3007; } else if( ( additional_character >= 0xa0 ) && ( additional_character < 0xf0 ) ) { additional_character -= 0xa0; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa9a0[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xa9a0[ additional_character ]; } } else if( byte_stream_character == 0xaa ) @@ -6794,15 +6773,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaa40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaa40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x7371; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x7371; } } else if( byte_stream_character == 0xab ) @@ -6812,15 +6787,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xab40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xab40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x73f7; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x73f7; } } else if( byte_stream_character == 0xac ) @@ -6830,15 +6801,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xac40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xac40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x747a; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x747a; } } else if( byte_stream_character == 0xad ) @@ -6848,15 +6815,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xad40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xad40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x74f2; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x74f2; } } else if( byte_stream_character == 0xae ) @@ -6866,15 +6829,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xae40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xae40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x7587; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x7587; } } else if( byte_stream_character == 0xaf ) @@ -6884,15 +6843,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xaf40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x7644; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x7644; } } else if( ( byte_stream_character >= 0xb0 ) @@ -6905,298 +6860,294 @@ switch( byte_stream_character ) { case 0xb0: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb040[ additional_character ]; break; case 0xb1: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb140[ additional_character ]; break; case 0xb2: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb240[ additional_character ]; break; case 0xb3: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb340[ additional_character ]; break; case 0xb4: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb440[ additional_character ]; break; case 0xb5: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb540[ additional_character ]; break; case 0xb6: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb640[ additional_character ]; break; case 0xb7: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb740[ additional_character ]; break; case 0xb8: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb840[ additional_character ]; break; case 0xb9: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xb940[ additional_character ]; break; case 0xba: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xba40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xba40[ additional_character ]; break; case 0xbb: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbb40[ additional_character ]; break; case 0xbc: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbc40[ additional_character ]; break; case 0xbd: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbd40[ additional_character ]; break; case 0xbe: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbe40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbe40[ additional_character ]; break; case 0xbf: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xbf40[ additional_character ]; break; case 0xc0: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc040[ additional_character ]; break; case 0xc1: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc140[ additional_character ]; break; case 0xc2: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc240[ additional_character ]; break; case 0xc3: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc340[ additional_character ]; break; case 0xc4: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc440[ additional_character ]; break; case 0xc5: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc540[ additional_character ]; break; case 0xc6: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc640[ additional_character ]; break; case 0xc7: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc740[ additional_character ]; break; case 0xc8: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc840[ additional_character ]; break; case 0xc9: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xc940[ additional_character ]; break; case 0xca: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xca40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xca40[ additional_character ]; break; case 0xcb: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcb40[ additional_character ]; break; case 0xcc: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcc40[ additional_character ]; break; case 0xcd: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcd40[ additional_character ]; break; case 0xce: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xce40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xce40[ additional_character ]; break; case 0xcf: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xcf40[ additional_character ]; break; case 0xd0: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd040[ additional_character ]; break; case 0xd1: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd140[ additional_character ]; break; case 0xd2: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd240[ additional_character ]; break; case 0xd3: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd340[ additional_character ]; break; case 0xd4: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd440[ additional_character ]; break; case 0xd5: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd540[ additional_character ]; break; case 0xd6: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd640[ additional_character ]; break; case 0xd7: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd740[ additional_character ]; break; case 0xd8: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd840[ additional_character ]; break; case 0xd9: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xd940[ additional_character ]; break; case 0xda: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xda40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xda40[ additional_character ]; break; case 0xdb: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdb40[ additional_character ]; break; case 0xdc: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdc40[ additional_character ]; break; case 0xdd: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdd40[ additional_character ]; break; case 0xde: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xde40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xde40[ additional_character ]; break; case 0xdf: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xdf40[ additional_character ]; break; case 0xe0: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe040[ additional_character ]; break; case 0xe1: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe140[ additional_character ]; break; case 0xe2: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe240[ additional_character ]; break; case 0xe3: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe340[ additional_character ]; break; case 0xe4: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe440[ additional_character ]; break; case 0xe5: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe540[ additional_character ]; break; case 0xe6: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe640[ additional_character ]; break; case 0xe7: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe740[ additional_character ]; break; case 0xe8: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe840[ additional_character ]; break; case 0xe9: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xe940[ additional_character ]; break; case 0xea: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xea40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xea40[ additional_character ]; break; case 0xeb: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xeb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xeb40[ additional_character ]; break; case 0xec: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xec40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xec40[ additional_character ]; break; case 0xed: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xed40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xed40[ additional_character ]; break; case 0xee: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xee40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xee40[ additional_character ]; break; case 0xef: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xef40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xef40[ additional_character ]; break; case 0xf0: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf040[ additional_character ]; break; case 0xf1: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf140[ additional_character ]; break; case 0xf2: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf240[ additional_character ]; break; case 0xf3: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf340[ additional_character ]; break; case 0xf4: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf440[ additional_character ]; break; case 0xf5: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf540[ additional_character ]; break; case 0xf6: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf640[ additional_character ]; break; case 0xf7: - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf740[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xf8 ) { @@ -7205,15 +7156,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf840[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x9d42; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x9d42; } } else if( byte_stream_character == 0xf9 ) @@ -7223,15 +7170,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xf940[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x9da2; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x9da2; } } else if( byte_stream_character == 0xfa ) @@ -7241,15 +7184,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfa40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfa40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x9e02; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x9e02; } } else if( byte_stream_character == 0xfb ) @@ -7259,15 +7198,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfb40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x9eaa; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x9eaa; } } else if( byte_stream_character == 0xfc ) @@ -7277,15 +7212,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfc40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0x9f31; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x9f31; } } else if( byte_stream_character == 0xfd ) @@ -7295,15 +7226,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfd40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0xf9f1; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0xf9f1; } } else if( byte_stream_character == 0xfe ) @@ -7313,23 +7240,12 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfe40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_936_byte_stream_to_unicode_base_0xfe40[ additional_character ]; } - else - { - *unicode_character = 0xfffd; - } - } - else - { - *unicode_character = 0xfffd; } } - else - { - *unicode_character = 0xfffd; - } - *byte_stream_index += 1; + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index + 1; return( 1 ); } @@ -7344,8 +7260,9 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_936_copy_to_byte_stream"; - uint16_t byte_stream_value = 0x001a; + static char *function = "libuna_codepage_windows_936_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { @@ -7380,7 +7297,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -7437,17 +7356,15 @@ unicode_character -= 0xfe00; byte_stream_value = libuna_codepage_windows_936_unicode_to_byte_stream_base_0xfe00[ unicode_character ]; } - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); - - byte_stream_value >>= 8; - - if( byte_stream_value != 0 ) + do { - *byte_stream_index += 1; + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); + byte_stream_value >>= 8; } - *byte_stream_index += 1; + while( byte_stream_value != 0 ); + + *byte_stream_index = safe_byte_stream_index; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_936.h libbde-20240223/libuna/libuna_codepage_windows_936.h --- libbde-20190102/libuna/libuna_codepage_windows_936.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_936.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 936 codepage (Chinese Simplified) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_936_H ) @@ -25,7 +25,6 @@ #include #include -#include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" @@ -33,13 +32,11 @@ extern "C" { #endif -LIBUNA_EXTERN \ int libuna_codepage_windows_936_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_936_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, @@ -47,7 +44,6 @@ size_t *byte_stream_index, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_936_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, diff -Nru libbde-20190102/libuna/libuna_codepage_windows_949.c libbde-20240223/libuna/libuna_codepage_windows_949.c --- libbde-20190102/libuna/libuna_codepage_windows_949.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_949.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 949 codepage (Korean) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -26,7 +26,7 @@ #include "libuna_libcerror.h" #include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 949 codepage +/* Extended ASCII to Unicode character lookup tables for the Windows 949 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ const uint16_t libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8140[ 192 ] = { @@ -2678,10 +2678,9 @@ 0x71b9, 0x71ba, 0x72a7, 0x79a7, 0x7a00, 0x7fb2, 0x8a70, 0xfffd }; -/* Unicode to ASCII character lookup table for Windows 949 codepage +/* Unicode to ASCII character lookup tables for the Windows 949 codepage * Unknown are filled with the ASCII replacement character 0x1a */ - const uint16_t libuna_codepage_windows_949_unicode_to_byte_stream_base_0x0080[ 256 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, @@ -7210,9 +7209,9 @@ }; -/* Determines the size of a byte stream character from an Unicode character +/* Determines the size of a Windows 949 encoded byte stream from an Unicode character * Adds the size to the byte stream character size value - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error */ int libuna_codepage_windows_949_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, @@ -7308,9 +7307,11 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_949_copy_from_byte_stream"; - uint8_t additional_character = 0; - uint8_t byte_stream_character = 0; + static char *function = "libuna_codepage_windows_949_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t additional_character = 0; + uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { @@ -7356,7 +7357,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -7367,17 +7370,17 @@ return( -1 ); } - byte_stream_character = byte_stream[ *byte_stream_index ]; + byte_stream_character = byte_stream[ safe_byte_stream_index ]; if( byte_stream_character < 0x80 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } - else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) + else if( ( safe_byte_stream_index + 1 ) <= byte_stream_size ) { - *byte_stream_index += 1; + safe_byte_stream_index += 1; - additional_character = byte_stream[ *byte_stream_index ]; + additional_character = byte_stream[ safe_byte_stream_index ]; if( ( byte_stream_character >= 0x81 ) && ( byte_stream_character <= 0xa1 ) ) @@ -7389,142 +7392,138 @@ switch( byte_stream_character ) { case 0x81: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8140[ additional_character ]; break; case 0x82: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8240[ additional_character ]; break; case 0x83: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8340[ additional_character ]; break; case 0x84: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8440[ additional_character ]; break; case 0x85: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8540[ additional_character ]; break; case 0x86: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8640[ additional_character ]; break; case 0x87: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8740[ additional_character ]; break; case 0x88: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8840[ additional_character ]; break; case 0x89: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8940[ additional_character ]; break; case 0x8a: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8a40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8a40[ additional_character ]; break; case 0x8b: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8b40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8b40[ additional_character ]; break; case 0x8c: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8c40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8c40[ additional_character ]; break; case 0x8d: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8d40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8d40[ additional_character ]; break; case 0x8e: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8e40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8e40[ additional_character ]; break; case 0x8f: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8f40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x8f40[ additional_character ]; break; case 0x90: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9040[ additional_character ]; break; case 0x91: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9140[ additional_character ]; break; case 0x92: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9240[ additional_character ]; break; case 0x93: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9340[ additional_character ]; break; case 0x94: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9440[ additional_character ]; break; case 0x95: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9540[ additional_character ]; break; case 0x96: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9640[ additional_character ]; break; case 0x97: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9740[ additional_character ]; break; case 0x98: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9840[ additional_character ]; break; case 0x99: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9940[ additional_character ]; break; case 0x9a: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9a40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9a40[ additional_character ]; break; case 0x9b: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9b40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9b40[ additional_character ]; break; case 0x9c: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9c40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9c40[ additional_character ]; break; case 0x9d: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9d40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9d40[ additional_character ]; break; case 0x9e: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9e40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9e40[ additional_character ]; break; case 0x9f: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9f40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0x9f40[ additional_character ]; break; case 0xa0: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa040[ additional_character ]; break; case 0xa1: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa140[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xa2 ) { @@ -7533,11 +7532,7 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa240[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa240[ additional_character ]; } } else if( ( byte_stream_character >= 0xa3 ) @@ -7550,18 +7545,14 @@ switch( byte_stream_character ) { case 0xa3: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa340[ additional_character ]; break; case 0xa4: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa440[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xa5 ) { @@ -7569,11 +7560,7 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa540[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa540[ additional_character ]; } } else if( byte_stream_character == 0xa6 ) @@ -7583,11 +7570,7 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa640[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa640[ additional_character ]; } } else if( byte_stream_character == 0xa7 ) @@ -7597,11 +7580,7 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa740[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa740[ additional_character ]; } } else if( ( byte_stream_character >= 0xa8 ) @@ -7614,18 +7593,14 @@ switch( byte_stream_character ) { case 0xa8: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa840[ additional_character ]; break; case 0xa9: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xa940[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( ( byte_stream_character >= 0xaa ) && ( byte_stream_character <= 0xab ) ) @@ -7638,18 +7613,14 @@ switch( byte_stream_character ) { case 0xaa: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaa40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaa40[ additional_character ]; break; case 0xab: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xab40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xab40[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xac ) { @@ -7658,18 +7629,14 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xac40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xac40[ additional_character ]; } else if( ( additional_character >= 0xd0 ) && ( additional_character < 0xf8 ) ) { additional_character -= 0xd0; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xacd0[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xacd0[ additional_character ]; } } else if( byte_stream_character == 0xad ) @@ -7679,15 +7646,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xad40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xad40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0xcdc5; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0xcdc5; } } else if( byte_stream_character == 0xae ) @@ -7697,15 +7660,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xae40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xae40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0xce2b; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0xce2b; } } else if( byte_stream_character == 0xaf ) @@ -7715,15 +7674,11 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xaf40[ additional_character ]; } else if( additional_character == 0xa0 ) { - *unicode_character = 0xce99; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0xce99; } } else if( ( byte_stream_character >= 0xb0 ) @@ -7736,98 +7691,94 @@ switch( byte_stream_character ) { case 0xb0: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb040[ additional_character ]; break; case 0xb1: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb140[ additional_character ]; break; case 0xb2: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb240[ additional_character ]; break; case 0xb3: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb340[ additional_character ]; break; case 0xb4: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb440[ additional_character ]; break; case 0xb5: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb540[ additional_character ]; break; case 0xb6: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb640[ additional_character ]; break; case 0xb7: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb740[ additional_character ]; break; case 0xb8: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb840[ additional_character ]; break; case 0xb9: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xb940[ additional_character ]; break; case 0xba: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xba40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xba40[ additional_character ]; break; case 0xbb: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbb40[ additional_character ]; break; case 0xbc: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbc40[ additional_character ]; break; case 0xbd: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbd40[ additional_character ]; break; case 0xbe: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbe40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbe40[ additional_character ]; break; case 0xbf: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xbf40[ additional_character ]; break; case 0xc0: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc040[ additional_character ]; break; case 0xc1: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc140[ additional_character ]; break; case 0xc2: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc240[ additional_character ]; break; case 0xc3: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc340[ additional_character ]; break; case 0xc4: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc440[ additional_character ]; break; case 0xc5: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc540[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xc6 ) { @@ -7836,17 +7787,13 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc640[ additional_character ]; } else if( additional_character >= 0xa0 ) { additional_character -= 0xa0; - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc6a0[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc6a0[ additional_character ]; } } else if( ( byte_stream_character >= 0xc7 ) @@ -7859,18 +7806,14 @@ switch( byte_stream_character ) { case 0xc7: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc7a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc7a0[ additional_character ]; break; case 0xc8: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc8a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xc8a0[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( ( byte_stream_character >= 0xca ) && ( byte_stream_character <= 0xfd ) ) @@ -7882,229 +7825,218 @@ switch( byte_stream_character ) { case 0xca: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcaa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcaa0[ additional_character ]; break; case 0xcb: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcba0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcba0[ additional_character ]; break; case 0xcc: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcca0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcca0[ additional_character ]; break; case 0xcd: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcda0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcda0[ additional_character ]; break; case 0xce: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcea0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcea0[ additional_character ]; break; case 0xcf: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcfa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xcfa0[ additional_character ]; break; case 0xd0: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd0a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd0a0[ additional_character ]; break; case 0xd1: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd1a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd1a0[ additional_character ]; break; case 0xd2: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd2a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd2a0[ additional_character ]; break; case 0xd3: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd3a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd3a0[ additional_character ]; break; case 0xd4: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd4a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd4a0[ additional_character ]; break; case 0xd5: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd5a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd5a0[ additional_character ]; break; case 0xd6: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd6a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd6a0[ additional_character ]; break; case 0xd7: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd7a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd7a0[ additional_character ]; break; case 0xd8: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd8a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd8a0[ additional_character ]; break; case 0xd9: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd9a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xd9a0[ additional_character ]; break; case 0xda: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdaa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdaa0[ additional_character ]; break; case 0xdb: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdba0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdba0[ additional_character ]; break; case 0xdc: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdca0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdca0[ additional_character ]; break; case 0xdd: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdda0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdda0[ additional_character ]; break; case 0xde: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdea0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdea0[ additional_character ]; break; case 0xdf: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdfa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xdfa0[ additional_character ]; break; case 0xe0: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe0a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe0a0[ additional_character ]; break; case 0xe1: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe1a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe1a0[ additional_character ]; break; case 0xe2: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe2a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe2a0[ additional_character ]; break; case 0xe3: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe3a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe3a0[ additional_character ]; break; case 0xe4: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe4a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe4a0[ additional_character ]; break; case 0xe5: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe5a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe5a0[ additional_character ]; break; case 0xe6: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe6a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe6a0[ additional_character ]; break; case 0xe7: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe7a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe7a0[ additional_character ]; break; case 0xe8: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe8a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe8a0[ additional_character ]; break; case 0xe9: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe9a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xe9a0[ additional_character ]; break; case 0xea: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeaa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeaa0[ additional_character ]; break; case 0xeb: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeba0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeba0[ additional_character ]; break; case 0xec: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeca0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeca0[ additional_character ]; break; case 0xed: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeda0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeda0[ additional_character ]; break; case 0xee: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeea0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xeea0[ additional_character ]; break; case 0xef: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xefa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xefa0[ additional_character ]; break; case 0xf0: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf0a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf0a0[ additional_character ]; break; case 0xf1: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf1a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf1a0[ additional_character ]; break; case 0xf2: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf2a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf2a0[ additional_character ]; break; case 0xf3: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf3a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf3a0[ additional_character ]; break; case 0xf4: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf4a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf4a0[ additional_character ]; break; case 0xf5: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf5a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf5a0[ additional_character ]; break; case 0xf6: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf6a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf6a0[ additional_character ]; break; case 0xf7: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf7a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf7a0[ additional_character ]; break; case 0xf8: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf8a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf8a0[ additional_character ]; break; case 0xf9: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf9a0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xf9a0[ additional_character ]; break; case 0xfa: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfaa0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfaa0[ additional_character ]; break; case 0xfb: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfba0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfba0[ additional_character ]; break; case 0xfc: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfca0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfca0[ additional_character ]; break; case 0xfd: - *unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfda0[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_949_byte_stream_to_unicode_base_0xfda0[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } - else - { - *unicode_character = 0xfffd; - } - } - else - { - *unicode_character = 0xfffd; } - *byte_stream_index += 1; + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index + 1; return( 1 ); } @@ -8119,8 +8051,9 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_949_copy_to_byte_stream"; - uint16_t byte_stream_value = 0x001a; + static char *function = "libuna_codepage_windows_949_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { @@ -8155,7 +8088,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -8218,17 +8153,15 @@ unicode_character -= 0xff00; byte_stream_value = libuna_codepage_windows_949_unicode_to_byte_stream_base_0xff00[ unicode_character ]; } - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); - - byte_stream_value >>= 8; - - if( byte_stream_value != 0 ) + do { - *byte_stream_index += 1; + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); + byte_stream_value >>= 8; } - *byte_stream_index += 1; + while( byte_stream_value != 0 ); + + *byte_stream_index = safe_byte_stream_index; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_949.h libbde-20240223/libuna/libuna_codepage_windows_949.h --- libbde-20190102/libuna/libuna_codepage_windows_949.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_949.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 949 codepage (Korean) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_949_H ) @@ -25,7 +25,6 @@ #include #include -#include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" @@ -33,13 +32,11 @@ extern "C" { #endif -LIBUNA_EXTERN \ int libuna_codepage_windows_949_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_949_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, @@ -47,7 +44,6 @@ size_t *byte_stream_index, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_949_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, diff -Nru libbde-20190102/libuna/libuna_codepage_windows_950.c libbde-20240223/libuna/libuna_codepage_windows_950.c --- libbde-20190102/libuna/libuna_codepage_windows_950.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_950.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 950 codepage (Traditional Chinese) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -26,10 +26,9 @@ #include "libuna_libcerror.h" #include "libuna_types.h" -/* Extended ASCII to Unicode character lookup table for Windows 950 codepage +/* Extended ASCII to Unicode character lookup tables for the Windows 950 codepage * Unknown are filled with the Unicode replacement character 0xfffd */ - const uint16_t libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa140[ 63 ] = { 0x3000, 0xff0c, 0x3001, 0x3002, 0xff0e, 0x2027, 0xff1b, 0xff1a, 0xff1f, 0xff01, 0xfe30, 0x2026, 0x2025, 0xfe50, 0xfe51, 0xfe52, @@ -2269,10 +2268,9 @@ 0x2551, 0x2550, 0x256d, 0x256e, 0x2570, 0x256f, 0x2593, }; -/* Unicode to ASCII character lookup table for Windows 950 codepage +/* Unicode to ASCII character lookup tables for the Windows 950 codepage * Unknown are filled with the ASCII replacement character 0x1a */ - const uint16_t libuna_codepage_windows_950_unicode_to_byte_stream_base_0x0080[ 128 ] = { 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, @@ -5314,9 +5312,9 @@ }; -/* Determines the size of a byte stream character from an Unicode character +/* Determines the size of a Windows 950 encoded byte stream from an Unicode character * Adds the size to the byte stream character size value - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error */ int libuna_codepage_windows_950_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, @@ -5412,9 +5410,11 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_950_copy_from_byte_stream"; - uint8_t additional_character = 0; - uint8_t byte_stream_character = 0; + static char *function = "libuna_codepage_windows_950_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0xfffd; + size_t safe_byte_stream_index = 0; + uint8_t additional_character = 0; + uint8_t byte_stream_character = 0; if( unicode_character == NULL ) { @@ -5460,7 +5460,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -5471,17 +5473,17 @@ return( -1 ); } - byte_stream_character = byte_stream[ *byte_stream_index ]; + byte_stream_character = byte_stream[ safe_byte_stream_index ]; if( byte_stream_character < 0x80 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } - else if( ( *byte_stream_index + 1 ) <= byte_stream_size ) + else if( ( safe_byte_stream_index + 1 ) <= byte_stream_size ) { - *byte_stream_index += 1; + safe_byte_stream_index += 1; - additional_character = byte_stream[ *byte_stream_index ]; + additional_character = byte_stream[ safe_byte_stream_index ]; if( ( byte_stream_character >= 0xa1 ) && ( byte_stream_character <= 0xa2 ) ) @@ -5494,11 +5496,11 @@ switch( byte_stream_character ) { case 0xa1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa140[ additional_character ]; break; case 0xa2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa240[ additional_character ]; break; } } @@ -5510,18 +5512,14 @@ switch( byte_stream_character ) { case 0xa1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa1a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa1a1[ additional_character ]; break; case 0xa2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa2a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa2a1[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xa3 ) { @@ -5530,22 +5528,18 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa340[ additional_character ]; } else if( ( additional_character >= 0xa1 ) && ( additional_character < 0xc0 ) ) { additional_character -= 0xa1; - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa3a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa3a1[ additional_character ]; } else if( additional_character == 0xe1 ) { - *unicode_character = 0x20ac; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = 0x20ac; } } else if( ( byte_stream_character >= 0xa4 ) @@ -5559,139 +5553,139 @@ switch( byte_stream_character ) { case 0xa4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa440[ additional_character ]; break; case 0xa5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa540[ additional_character ]; break; case 0xa6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa640[ additional_character ]; break; case 0xa7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa740[ additional_character ]; break; case 0xa8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa840[ additional_character ]; break; case 0xa9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa940[ additional_character ]; break; case 0xaa: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaa40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaa40[ additional_character ]; break; case 0xab: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xab40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xab40[ additional_character ]; break; case 0xac: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xac40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xac40[ additional_character ]; break; case 0xad: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xad40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xad40[ additional_character ]; break; case 0xae: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xae40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xae40[ additional_character ]; break; case 0xaf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaf40[ additional_character ]; break; case 0xb0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb040[ additional_character ]; break; case 0xb1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb140[ additional_character ]; break; case 0xb2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb240[ additional_character ]; break; case 0xb3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb340[ additional_character ]; break; case 0xb4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb440[ additional_character ]; break; case 0xb5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb540[ additional_character ]; break; case 0xb6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb640[ additional_character ]; break; case 0xb7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb740[ additional_character ]; break; case 0xb8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb840[ additional_character ]; break; case 0xb9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb940[ additional_character ]; break; case 0xba: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xba40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xba40[ additional_character ]; break; case 0xbb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbb40[ additional_character ]; break; case 0xbc: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbc40[ additional_character ]; break; case 0xbd: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbd40[ additional_character ]; break; case 0xbe: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbe40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbe40[ additional_character ]; break; case 0xbf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbf40[ additional_character ]; break; case 0xc0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc040[ additional_character ]; break; case 0xc1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc140[ additional_character ]; break; case 0xc2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc240[ additional_character ]; break; case 0xc3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc340[ additional_character ]; break; case 0xc4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc440[ additional_character ]; break; case 0xc5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc540[ additional_character ]; break; } } @@ -5703,146 +5697,142 @@ switch( byte_stream_character ) { case 0xa4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa4a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa4a1[ additional_character ]; break; case 0xa5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa5a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa5a1[ additional_character ]; break; case 0xa6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa6a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa6a1[ additional_character ]; break; case 0xa7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa7a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa7a1[ additional_character ]; break; case 0xa8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa8a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa8a1[ additional_character ]; break; case 0xa9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa9a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xa9a1[ additional_character ]; break; case 0xaa: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaaa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaaa1[ additional_character ]; break; case 0xab: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaba1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaba1[ additional_character ]; break; case 0xac: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaca1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaca1[ additional_character ]; break; case 0xad: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xada1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xada1[ additional_character ]; break; case 0xae: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaea1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xaea1[ additional_character ]; break; case 0xaf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xafa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xafa1[ additional_character ]; break; case 0xb0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb0a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb0a1[ additional_character ]; break; case 0xb1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb1a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb1a1[ additional_character ]; break; case 0xb2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb2a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb2a1[ additional_character ]; break; case 0xb3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb3a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb3a1[ additional_character ]; break; case 0xb4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb4a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb4a1[ additional_character ]; break; case 0xb5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb5a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb5a1[ additional_character ]; break; case 0xb6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb6a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb6a1[ additional_character ]; break; case 0xb7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb7a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb7a1[ additional_character ]; break; case 0xb8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb8a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb8a1[ additional_character ]; break; case 0xb9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb9a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xb9a1[ additional_character ]; break; case 0xba: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbaa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbaa1[ additional_character ]; break; case 0xbb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbba1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbba1[ additional_character ]; break; case 0xbc: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbca1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbca1[ additional_character ]; break; case 0xbd: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbda1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbda1[ additional_character ]; break; case 0xbe: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbea1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbea1[ additional_character ]; break; case 0xbf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbfa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xbfa1[ additional_character ]; break; case 0xc0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc0a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc0a1[ additional_character ]; break; case 0xc1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc1a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc1a1[ additional_character ]; break; case 0xc2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc2a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc2a1[ additional_character ]; break; case 0xc3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc3a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc3a1[ additional_character ]; break; case 0xc4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc4a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc4a1[ additional_character ]; break; case 0xc5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc5a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc5a1[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } } else if( byte_stream_character == 0xc6 ) { @@ -5851,11 +5841,7 @@ { additional_character -= 0x40; - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc640[ additional_character ]; - } - else - { - *unicode_character = 0xfffd; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc640[ additional_character ]; } } else if( ( byte_stream_character >= 0xc9 ) @@ -5869,199 +5855,199 @@ switch( byte_stream_character ) { case 0xc9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc940[ additional_character ]; break; case 0xca: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xca40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xca40[ additional_character ]; break; case 0xcb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcb40[ additional_character ]; break; case 0xcc: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcc40[ additional_character ]; break; case 0xcd: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcd40[ additional_character ]; break; case 0xce: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xce40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xce40[ additional_character ]; break; case 0xcf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcf40[ additional_character ]; break; case 0xd0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd040[ additional_character ]; break; case 0xd1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd140[ additional_character ]; break; case 0xd2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd240[ additional_character ]; break; case 0xd3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd340[ additional_character ]; break; case 0xd4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd440[ additional_character ]; break; case 0xd5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd540[ additional_character ]; break; case 0xd6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd640[ additional_character ]; break; case 0xd7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd740[ additional_character ]; break; case 0xd8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd840[ additional_character ]; break; case 0xd9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd940[ additional_character ]; break; case 0xda: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xda40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xda40[ additional_character ]; break; case 0xdb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdb40[ additional_character ]; break; case 0xdc: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdc40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdc40[ additional_character ]; break; case 0xdd: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdd40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdd40[ additional_character ]; break; case 0xde: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xde40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xde40[ additional_character ]; break; case 0xdf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdf40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdf40[ additional_character ]; break; case 0xe0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe040[ additional_character ]; break; case 0xe1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe140[ additional_character ]; break; case 0xe2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe240[ additional_character ]; break; case 0xe3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe340[ additional_character ]; break; case 0xe4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe440[ additional_character ]; break; case 0xe5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe540[ additional_character ]; break; case 0xe6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe640[ additional_character ]; break; case 0xe7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe740[ additional_character ]; break; case 0xe8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe840[ additional_character ]; break; case 0xe9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe940[ additional_character ]; break; case 0xea: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xea40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xea40[ additional_character ]; break; case 0xeb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeb40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeb40[ additional_character ]; break; case 0xec: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xec40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xec40[ additional_character ]; break; case 0xed: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xed40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xed40[ additional_character ]; break; case 0xee: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xee40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xee40[ additional_character ]; break; case 0xef: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xef40[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xef40[ additional_character ]; break; case 0xf0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf040[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf040[ additional_character ]; break; case 0xf1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf140[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf140[ additional_character ]; break; case 0xf2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf240[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf240[ additional_character ]; break; case 0xf3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf340[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf340[ additional_character ]; break; case 0xf4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf440[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf440[ additional_character ]; break; case 0xf5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf540[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf540[ additional_character ]; break; case 0xf6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf640[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf640[ additional_character ]; break; case 0xf7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf740[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf740[ additional_character ]; break; case 0xf8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf840[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf840[ additional_character ]; break; case 0xf9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf940[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf940[ additional_character ]; break; } } @@ -6073,217 +6059,206 @@ switch( byte_stream_character ) { case 0xc9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc9a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xc9a1[ additional_character ]; break; case 0xca: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcaa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcaa1[ additional_character ]; break; case 0xcb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcba1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcba1[ additional_character ]; break; case 0xcc: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcca1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcca1[ additional_character ]; break; case 0xcd: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcda1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcda1[ additional_character ]; break; case 0xce: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcea1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcea1[ additional_character ]; break; case 0xcf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcfa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xcfa1[ additional_character ]; break; case 0xd0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd0a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd0a1[ additional_character ]; break; case 0xd1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd1a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd1a1[ additional_character ]; break; case 0xd2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd2a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd2a1[ additional_character ]; break; case 0xd3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd3a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd3a1[ additional_character ]; break; case 0xd4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd4a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd4a1[ additional_character ]; break; case 0xd5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd5a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd5a1[ additional_character ]; break; case 0xd6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd6a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd6a1[ additional_character ]; break; case 0xd7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd7a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd7a1[ additional_character ]; break; case 0xd8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd8a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd8a1[ additional_character ]; break; case 0xd9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd9a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xd9a1[ additional_character ]; break; case 0xda: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdaa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdaa1[ additional_character ]; break; case 0xdb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdba1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdba1[ additional_character ]; break; case 0xdc: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdca1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdca1[ additional_character ]; break; case 0xdd: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdda1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdda1[ additional_character ]; break; case 0xde: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdea1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdea1[ additional_character ]; break; case 0xdf: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdfa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xdfa1[ additional_character ]; break; case 0xe0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe0a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe0a1[ additional_character ]; break; case 0xe1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe1a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe1a1[ additional_character ]; break; case 0xe2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe2a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe2a1[ additional_character ]; break; case 0xe3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe3a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe3a1[ additional_character ]; break; case 0xe4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe4a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe4a1[ additional_character ]; break; case 0xe5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe5a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe5a1[ additional_character ]; break; case 0xe6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe6a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe6a1[ additional_character ]; break; case 0xe7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe7a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe7a1[ additional_character ]; break; case 0xe8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe8a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe8a1[ additional_character ]; break; case 0xe9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe9a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xe9a1[ additional_character ]; break; case 0xea: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeaa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeaa1[ additional_character ]; break; case 0xeb: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeba1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeba1[ additional_character ]; break; case 0xec: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeca1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeca1[ additional_character ]; break; case 0xed: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeda1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeda1[ additional_character ]; break; case 0xee: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeea1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xeea1[ additional_character ]; break; case 0xef: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xefa1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xefa1[ additional_character ]; break; case 0xf0: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf0a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf0a1[ additional_character ]; break; case 0xf1: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf1a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf1a1[ additional_character ]; break; case 0xf2: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf2a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf2a1[ additional_character ]; break; case 0xf3: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf3a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf3a1[ additional_character ]; break; case 0xf4: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf4a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf4a1[ additional_character ]; break; case 0xf5: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf5a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf5a1[ additional_character ]; break; case 0xf6: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf6a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf6a1[ additional_character ]; break; case 0xf7: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf7a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf7a1[ additional_character ]; break; case 0xf8: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf8a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf8a1[ additional_character ]; break; case 0xf9: - *unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf9a1[ additional_character ]; + safe_unicode_character = libuna_codepage_windows_950_byte_stream_to_unicode_base_0xf9a1[ additional_character ]; break; } } - else - { - *unicode_character = 0xfffd; - } - } - else - { - *unicode_character = 0xfffd; } } - else - { - *unicode_character = 0xfffd; - } - *byte_stream_index += 1; + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index + 1; return( 1 ); } @@ -6298,8 +6273,9 @@ size_t *byte_stream_index, libcerror_error_t **error ) { - static char *function = "libuna_codepage_windows_950_copy_to_byte_stream"; - uint16_t byte_stream_value = 0x001a; + static char *function = "libuna_codepage_windows_950_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + uint16_t byte_stream_value = 0x001a; if( byte_stream == NULL ) { @@ -6334,7 +6310,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -6397,17 +6375,15 @@ unicode_character -= 0xfe00; byte_stream_value = libuna_codepage_windows_950_unicode_to_byte_stream_base_0xfe00[ unicode_character ]; } - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); - - byte_stream_value >>= 8; - - if( byte_stream_value != 0 ) + do { - *byte_stream_index += 1; + byte_stream[ safe_byte_stream_index++ ] = (uint8_t) ( byte_stream_value & 0x00ff ); - byte_stream[ *byte_stream_index ] = (uint8_t) ( byte_stream_value & 0x00ff ); + byte_stream_value >>= 8; } - *byte_stream_index += 1; + while( byte_stream_value != 0 ); + + *byte_stream_index = safe_byte_stream_index; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_codepage_windows_950.h libbde-20240223/libuna/libuna_codepage_windows_950.h --- libbde-20190102/libuna/libuna_codepage_windows_950.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_codepage_windows_950.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Windows 950 codepage (Traditional Chinese) functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_CODEPAGE_WINDOWS_950_H ) @@ -25,7 +25,6 @@ #include #include -#include "libuna_extern.h" #include "libuna_libcerror.h" #include "libuna_types.h" @@ -33,13 +32,11 @@ extern "C" { #endif -LIBUNA_EXTERN \ int libuna_codepage_windows_950_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, size_t *byte_stream_character_size, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_950_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, const uint8_t *byte_stream, @@ -47,7 +44,6 @@ size_t *byte_stream_index, libcerror_error_t **error ); -LIBUNA_EXTERN \ int libuna_codepage_windows_950_copy_to_byte_stream( libuna_unicode_character_t unicode_character, uint8_t *byte_stream, diff -Nru libbde-20190102/libuna/libuna_definitions.h libbde-20240223/libuna/libuna_definitions.h --- libbde-20190102/libuna/libuna_definitions.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_definitions.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_INTERNAL_DEFINITIONS_H ) @@ -35,11 +35,11 @@ #else #include -#define LIBUNA_VERSION 20181006 +#define LIBUNA_VERSION 20240130 /* The libuna version string */ -#define LIBUNA_VERSION_STRING "20181006" +#define LIBUNA_VERSION_STRING "20240130" /* The endian definitions */ @@ -71,6 +71,31 @@ LIBUNA_CODEPAGE_KOI8_R = 20866, LIBUNA_CODEPAGE_KOI8_U = 21866, + LIBUNA_CODEPAGE_MAC_ROMAN = 10000, + LIBUNA_CODEPAGE_MAC_JAPANESE = 10001, + LIBUNA_CODEPAGE_MAC_CHINESETRAD = 10002, + LIBUNA_CODEPAGE_MAC_KOREAN = 10003, + LIBUNA_CODEPAGE_MAC_ARABIC = 10004, + LIBUNA_CODEPAGE_MAC_HEBREW = 10005, + LIBUNA_CODEPAGE_MAC_GREEK = 10006, + LIBUNA_CODEPAGE_MAC_RUSSIAN = 10007, + LIBUNA_CODEPAGE_MAC_CHINESESIMP = 10008, + LIBUNA_CODEPAGE_MAC_ROMANIAN = 10010, + LIBUNA_CODEPAGE_MAC_UKRAINIAN = 10017, + LIBUNA_CODEPAGE_MAC_THAI = 10021, + LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN = 10029, + LIBUNA_CODEPAGE_MAC_ICELANDIC = 10079, + LIBUNA_CODEPAGE_MAC_TURKISH = 10081, + LIBUNA_CODEPAGE_MAC_CROATIAN = 10082, + + LIBUNA_CODEPAGE_MAC_CYRILLIC = 11007, + LIBUNA_CODEPAGE_MAC_SYMBOL = 11033, + LIBUNA_CODEPAGE_MAC_DINGBATS = 11034, + LIBUNA_CODEPAGE_MAC_CELTIC = 11039, + LIBUNA_CODEPAGE_MAC_GAELIC = 11040, + LIBUNA_CODEPAGE_MAC_FARSI = 11140, + LIBUNA_CODEPAGE_MAC_INUIT = 11236, + LIBUNA_CODEPAGE_OEM_437 = 437, LIBUNA_CODEPAGE_OEM_720 = 720, LIBUNA_CODEPAGE_OEM_737 = 737, @@ -83,6 +108,14 @@ LIBUNA_CODEPAGE_OEM_862 = 862, LIBUNA_CODEPAGE_OEM_866 = 866, + LIBUNA_CODEPAGE_UTF16_LITTLE_ENDIAN = 1200, + LIBUNA_CODEPAGE_UTF16_BIG_ENDIAN = 1201, + LIBUNA_CODEPAGE_UTF32_LITTLE_ENDIAN = 12000, + LIBUNA_CODEPAGE_UTF32_BIG_ENDIAN = 12001, + LIBUNA_CODEPAGE_UTF7 = 65000, + LIBUNA_CODEPAGE_UTF8 = 65001, + LIBUNA_CODEPAGE_SCSU = 65002, + LIBUNA_CODEPAGE_WINDOWS_874 = 874, LIBUNA_CODEPAGE_WINDOWS_932 = 932, LIBUNA_CODEPAGE_WINDOWS_936 = 936, @@ -154,6 +187,30 @@ #define LIBUNA_CODEPAGE_OEM_CHINESE_TRADITIONAL LIBUNA_CODEPAGE_WINDOWS_950 #define LIBUNA_CODEPAGE_OEM_VIETNAMESE LIBUNA_CODEPAGE_WINDOWS_1258 +#define LIBUNA_CODEPAGE_MACOS_ROMAN LIBUNA_CODEPAGE_MAC_ROMAN +#define LIBUNA_CODEPAGE_MACOS_JAPANESE LIBUNA_CODEPAGE_MAC_JAPANESE +#define LIBUNA_CODEPAGE_MACOS_CHINESE_TRADITIONAL LIBUNA_CODEPAGE_MAC_CHINESETRAD +#define LIBUNA_CODEPAGE_MACOS_KOREAN LIBUNA_CODEPAGE_MAC_KOREAN +#define LIBUNA_CODEPAGE_MACOS_ARABIC LIBUNA_CODEPAGE_MAC_ARABIC +#define LIBUNA_CODEPAGE_MACOS_HEBREW LIBUNA_CODEPAGE_MAC_HEBREW +#define LIBUNA_CODEPAGE_MACOS_GREEK LIBUNA_CODEPAGE_MAC_GREEK +#define LIBUNA_CODEPAGE_MACOS_RUSSIAN LIBUNA_CODEPAGE_MAC_RUSSIAN +#define LIBUNA_CODEPAGE_MACOS_CHINESE_SIMPLIFIED LIBUNA_CODEPAGE_MAC_CHINESESIMP +#define LIBUNA_CODEPAGE_MACOS_ROMANIAN LIBUNA_CODEPAGE_MAC_ROMANIAN +#define LIBUNA_CODEPAGE_MACOS_UKRAINIAN LIBUNA_CODEPAGE_MAC_UKRAINIAN +#define LIBUNA_CODEPAGE_MACOS_THAI LIBUNA_CODEPAGE_MAC_THAI +#define LIBUNA_CODEPAGE_MACOS_CENTRALEURROMAN LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN +#define LIBUNA_CODEPAGE_MACOS_ICELANDIC LIBUNA_CODEPAGE_MAC_ICELANDIC +#define LIBUNA_CODEPAGE_MACOS_TURKISH LIBUNA_CODEPAGE_MAC_TURKISH +#define LIBUNA_CODEPAGE_MACOS_CROATIAN LIBUNA_CODEPAGE_MAC_CROATIAN + +#define LIBUNA_CODEPAGE_MACOS_CYRILLIC LIBUNA_CODEPAGE_MAC_CYRILLIC +#define LIBUNA_CODEPAGE_MACOS_SYMBOL LIBUNA_CODEPAGE_MAC_SYMBOL +#define LIBUNA_CODEPAGE_MACOS_CELTIC LIBUNA_CODEPAGE_MAC_CELTIC +#define LIBUNA_CODEPAGE_MACOS_GAELIC LIBUNA_CODEPAGE_MAC_GAELIC +#define LIBUNA_CODEPAGE_MACOS_FARSI LIBUNA_CODEPAGE_MAC_FARSI +#define LIBUNA_CODEPAGE_MACOS_INUIT LIBUNA_CODEPAGE_MAC_INUIT + #define LIBUNA_CODEPAGE_WINDOWS_THAI LIBUNA_CODEPAGE_WINDOWS_874 #define LIBUNA_CODEPAGE_WINDOWS_JAPANESE LIBUNA_CODEPAGE_WINDOWS_932 #define LIBUNA_CODEPAGE_WINDOWS_CHINESE_SIMPLIFIED LIBUNA_CODEPAGE_WINDOWS_936 @@ -331,6 +388,8 @@ LIBUNA_BASE64_FLAG_STRIP_WHITESPACE = 0x01 }; +#define LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE 0x8000 + #endif /* !defined( HAVE_LOCAL_LIBUNA ) */ #define LIBUNA_BASE32_VARIANT_ENCODING_BYTE_STREAM 0 @@ -365,8 +424,7 @@ #define LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END 0x0000dbffUL #define LIBUNA_UNICODE_CHARACTER_MAX 0x0010ffffUL -#define LIBUNA_UTF16_CHARACTER_MAX 0x0010ffffUL -#define LIBUNA_UTF32_CHARACTER_MAX 0x7fffffffUL +#define LIBUNA_UCS_CHARACTER_MAX 0x7fffffffUL #define LIBUNA_ASCII_REPLACEMENT_CHARACTER 0x1a diff -Nru libbde-20190102/libuna/libuna_error.c libbde-20240223/libuna/libuna_error.c --- libbde-20190102/libuna/libuna_error.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_error.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_error.h libbde-20240223/libuna/libuna_error.h --- libbde-20190102/libuna/libuna_error.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_error.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_INTERNAL_ERROR_H ) diff -Nru libbde-20190102/libuna/libuna_extern.h libbde-20240223/libuna/libuna_extern.h --- libbde-20190102/libuna/libuna_extern.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_extern.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal extern definition * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_INTERNAL_EXTERN_H ) @@ -30,7 +30,11 @@ #include +#if defined( __CYGWIN__ ) || defined( __MINGW32__ ) +#define LIBUNA_EXTERN_VARIABLE extern +#else #define LIBUNA_EXTERN_VARIABLE LIBUNA_EXTERN +#endif #else #define LIBUNA_EXTERN /* extern */ diff -Nru libbde-20190102/libuna/libuna_libcerror.h libbde-20240223/libuna/libuna_libcerror.h --- libbde-20190102/libuna/libuna_libcerror.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_libcerror.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_LIBCERROR_H ) diff -Nru libbde-20190102/libuna/libuna_scsu.c libbde-20240223/libuna/libuna_scsu.c --- libbde-20190102/libuna/libuna_scsu.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_scsu.c 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * Standard Compression Scheme for Unicode (SCSU) functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "libuna_scsu.h" + +const uint32_t libuna_scsu_static_window_positions[ 8 ] = { + 0x0000, 0x0080, 0x0100, 0x0300, 0x2000, 0x2080, 0x2100, 0x3000 }; + +const uint32_t libuna_scsu_window_offset_table[ 256 ] = { + 0x0000, 0x0080, 0x0100, 0x0180, 0x0200, 0x0280, 0x0300, 0x0380, + 0x0400, 0x0480, 0x0500, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780, + 0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b00, 0x0b80, + 0x0c00, 0x0c80, 0x0d00, 0x0d80, 0x0e00, 0x0e80, 0x0f00, 0x0f80, + 0x1000, 0x1080, 0x1100, 0x1180, 0x1200, 0x1280, 0x1300, 0x1380, + 0x1400, 0x1480, 0x1500, 0x1580, 0x1600, 0x1680, 0x1700, 0x1780, + 0x1800, 0x1880, 0x1900, 0x1980, 0x1a00, 0x1a80, 0x1b00, 0x1b80, + 0x1c00, 0x1c80, 0x1d00, 0x1d80, 0x1e00, 0x1e80, 0x1f00, 0x1f80, + 0x2000, 0x2080, 0x2100, 0x2180, 0x2200, 0x2280, 0x2300, 0x2380, + 0x2400, 0x2480, 0x2500, 0x2580, 0x2600, 0x2680, 0x2700, 0x2780, + 0x2800, 0x2880, 0x2900, 0x2980, 0x2a00, 0x2a80, 0x2b00, 0x2b80, + 0x2c00, 0x2c80, 0x2d00, 0x2d80, 0x2e00, 0x2e80, 0x2f00, 0x2f80, + 0x3000, 0x3080, 0x3100, 0x3180, 0x3200, 0x3280, 0x3300, 0x3380, + 0xe000, 0xe080, 0xe100, 0xe180, 0xe200, 0xe280, 0xe300, 0xe380, + 0xe400, 0xe480, 0xe500, 0xe580, 0xe600, 0xe680, 0xe700, 0xe780, + 0xe800, 0xe880, 0xe900, 0xe980, 0xea00, 0xea80, 0xeb00, 0xeb80, + 0xec00, 0xec80, 0xed00, 0xed80, 0xee00, 0xee80, 0xef00, 0xef80, + 0xf000, 0xf080, 0xf100, 0xf180, 0xf200, 0xf280, 0xf300, 0xf380, + 0xf400, 0xf480, 0xf500, 0xf580, 0xf600, 0xf680, 0xf700, 0xf780, + 0xf800, 0xf880, 0xf900, 0xf980, 0xfa00, 0xfa80, 0xfb00, 0xfb80, + 0xfc00, 0xfc80, 0xfd00, 0xfd80, 0xfe00, 0xfe80, 0xff00, 0xff80, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x00c0, 0x0250, 0x0370, 0x0530, 0x3040, 0x30a0, 0xff60 +}; + diff -Nru libbde-20190102/libuna/libuna_scsu.h libbde-20240223/libuna/libuna_scsu.h --- libbde-20190102/libuna/libuna_scsu.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/libuna/libuna_scsu.h 2024-02-23 03:03:41.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Standard Compression Scheme for Unicode (SCSU) functions + * + * Copyright (C) 2008-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _LIBUNA_SCSU_H ) +#define _LIBUNA_SCSU_H + +#include +#include + +#include "libuna_extern.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +LIBUNA_EXTERN_VARIABLE \ +const uint32_t libuna_scsu_static_window_positions[ 8 ]; + +LIBUNA_EXTERN_VARIABLE \ +const uint32_t libuna_scsu_window_offset_table[ 256 ]; + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBUNA_SCSU_H ) */ + diff -Nru libbde-20190102/libuna/libuna_support.c libbde-20240223/libuna/libuna_support.c --- libbde-20190102/libuna/libuna_support.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_support.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_support.h libbde-20240223/libuna/libuna_support.h --- libbde-20190102/libuna/libuna_support.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_support.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Support functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_SUPPORT_H ) diff -Nru libbde-20190102/libuna/libuna_types.h libbde-20240223/libuna/libuna_types.h --- libbde-20190102/libuna/libuna_types.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_types.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal type definitions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_INTERNAL_TYPES_H ) diff -Nru libbde-20190102/libuna/libuna_unicode_character.c libbde-20240223/libuna/libuna_unicode_character.c --- libbde-20190102/libuna/libuna_unicode_character.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_unicode_character.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Unicode character functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -38,6 +38,24 @@ #include "libuna_codepage_iso_8859_16.h" #include "libuna_codepage_koi8_r.h" #include "libuna_codepage_koi8_u.h" +#include "libuna_codepage_mac_arabic.h" +#include "libuna_codepage_mac_celtic.h" +#include "libuna_codepage_mac_centraleurroman.h" +#include "libuna_codepage_mac_croatian.h" +#include "libuna_codepage_mac_cyrillic.h" +#include "libuna_codepage_mac_dingbats.h" +#include "libuna_codepage_mac_farsi.h" +#include "libuna_codepage_mac_gaelic.h" +#include "libuna_codepage_mac_greek.h" +#include "libuna_codepage_mac_icelandic.h" +#include "libuna_codepage_mac_inuit.h" +#include "libuna_codepage_mac_roman.h" +#include "libuna_codepage_mac_romanian.h" +#include "libuna_codepage_mac_russian.h" +#include "libuna_codepage_mac_symbol.h" +#include "libuna_codepage_mac_thai.h" +#include "libuna_codepage_mac_turkish.h" +#include "libuna_codepage_mac_ukrainian.h" #include "libuna_codepage_windows_874.h" #include "libuna_codepage_windows_932.h" #include "libuna_codepage_windows_936.h" @@ -102,7 +120,7 @@ /* Determines the size of a byte stream character from an Unicode character * Adds the size to the byte stream character size value - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error */ int libuna_unicode_character_size_to_byte_stream( libuna_unicode_character_t unicode_character, @@ -110,8 +128,9 @@ size_t *byte_stream_character_size, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_size_to_byte_stream"; - int result = 1; + static char *function = "libuna_unicode_character_size_to_byte_stream"; + size_t safe_byte_stream_character_size = 0; + int result = 1; if( byte_stream_character_size == NULL ) { @@ -124,6 +143,8 @@ return( -1 ); } + safe_byte_stream_character_size = *byte_stream_character_size; + switch( codepage ) { case LIBUNA_CODEPAGE_ASCII: @@ -144,6 +165,22 @@ case LIBUNA_CODEPAGE_ISO_8859_16: case LIBUNA_CODEPAGE_KOI8_R: case LIBUNA_CODEPAGE_KOI8_U: + case LIBUNA_CODEPAGE_MAC_ARABIC: + case LIBUNA_CODEPAGE_MAC_CELTIC: + case LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN: + case LIBUNA_CODEPAGE_MAC_CROATIAN: + case LIBUNA_CODEPAGE_MAC_CYRILLIC: + case LIBUNA_CODEPAGE_MAC_DINGBATS: + case LIBUNA_CODEPAGE_MAC_FARSI: + case LIBUNA_CODEPAGE_MAC_GAELIC: + case LIBUNA_CODEPAGE_MAC_GREEK: + case LIBUNA_CODEPAGE_MAC_ICELANDIC: + case LIBUNA_CODEPAGE_MAC_INUIT: + case LIBUNA_CODEPAGE_MAC_ROMAN: + case LIBUNA_CODEPAGE_MAC_ROMANIAN: + case LIBUNA_CODEPAGE_MAC_RUSSIAN: + case LIBUNA_CODEPAGE_MAC_TURKISH: + case LIBUNA_CODEPAGE_MAC_UKRAINIAN: case LIBUNA_CODEPAGE_WINDOWS_874: case LIBUNA_CODEPAGE_WINDOWS_1250: case LIBUNA_CODEPAGE_WINDOWS_1251: @@ -154,34 +191,48 @@ case LIBUNA_CODEPAGE_WINDOWS_1256: case LIBUNA_CODEPAGE_WINDOWS_1257: case LIBUNA_CODEPAGE_WINDOWS_1258: - *byte_stream_character_size += 1; + safe_byte_stream_character_size += 1; + break; + + case LIBUNA_CODEPAGE_MAC_SYMBOL: + result = libuna_codepage_mac_symbol_unicode_character_size_to_byte_stream( + unicode_character, + &safe_byte_stream_character_size, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_THAI: + result = libuna_codepage_mac_thai_unicode_character_size_to_byte_stream( + unicode_character, + &safe_byte_stream_character_size, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_932: result = libuna_codepage_windows_932_unicode_character_size_to_byte_stream( unicode_character, - byte_stream_character_size, + &safe_byte_stream_character_size, error ); break; case LIBUNA_CODEPAGE_WINDOWS_936: result = libuna_codepage_windows_936_unicode_character_size_to_byte_stream( unicode_character, - byte_stream_character_size, + &safe_byte_stream_character_size, error ); break; case LIBUNA_CODEPAGE_WINDOWS_949: result = libuna_codepage_windows_949_unicode_character_size_to_byte_stream( unicode_character, - byte_stream_character_size, + &safe_byte_stream_character_size, error ); break; case LIBUNA_CODEPAGE_WINDOWS_950: result = libuna_codepage_windows_950_unicode_character_size_to_byte_stream( unicode_character, - byte_stream_character_size, + &safe_byte_stream_character_size, error ); break; @@ -196,7 +247,7 @@ return( -1 ); } - if( result != 1 ) + if( result == -1 ) { libcerror_error_set( error, @@ -207,11 +258,13 @@ return( -1 ); } + *byte_stream_character_size = safe_byte_stream_character_size; + return( result ); } /* Copies an Unicode character from a byte stream - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the byte stream character is valid but not supported since it requires special handling or -1 on error */ int libuna_unicode_character_copy_from_byte_stream( libuna_unicode_character_t *unicode_character, @@ -221,9 +274,11 @@ int codepage, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_byte_stream"; - uint8_t byte_stream_character = 0; - int result = 1; + static char *function = "libuna_unicode_character_copy_from_byte_stream"; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_byte_stream_index = 0; + uint8_t byte_stream_character = 0; + int result = 1; if( unicode_character == NULL ) { @@ -269,7 +324,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -280,217 +337,217 @@ return( -1 ); } - byte_stream_character = byte_stream[ *byte_stream_index ]; + byte_stream_character = byte_stream[ safe_byte_stream_index ]; switch( codepage ) { case LIBUNA_CODEPAGE_ASCII: if( byte_stream_character < 0x80 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { - *unicode_character = 0xfffd; + safe_unicode_character = 0xfffd; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_1: - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_2: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_2_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_3: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_3_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_4: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_4_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_5: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_5_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_6: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_6_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_7: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_7_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_8: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_8_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_9: if( byte_stream_character < 0xd0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xd0; - *unicode_character = libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_9_byte_stream_to_unicode_base_0xd0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_10: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_10_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_11: if( byte_stream_character < 0xa1 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else if( byte_stream_character < 0xdb ) { - *unicode_character = byte_stream_character + 0x0d60; + safe_unicode_character = byte_stream_character + 0x0d60; } else if( byte_stream_character < 0xdf ) { - *unicode_character = 0xfffd; + safe_unicode_character = 0xfffd; } else if( byte_stream_character < 0xfc ) { - *unicode_character = byte_stream_character + 0x0d60; + safe_unicode_character = byte_stream_character + 0x0d60; } else { - *unicode_character = 0xfffd; + safe_unicode_character = 0xfffd; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_13: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_13_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_14: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_14_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; @@ -500,266 +557,335 @@ { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_15_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } else { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_16: if( byte_stream_character < 0xa0 ) { - *unicode_character = byte_stream_character; + safe_unicode_character = byte_stream_character; } else { byte_stream_character -= 0xa0; - *unicode_character = libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; + safe_unicode_character = libuna_codepage_iso_8859_16_byte_stream_to_unicode_base_0xa0[ byte_stream_character ]; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_KOI8_R: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; + result = libuna_codepage_koi8_r_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - *unicode_character = libuna_codepage_koi8_r_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; + case LIBUNA_CODEPAGE_KOI8_U: + result = libuna_codepage_koi8_u_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + case LIBUNA_CODEPAGE_MAC_ARABIC: + result = libuna_codepage_mac_arabic_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; - case LIBUNA_CODEPAGE_KOI8_U: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; + case LIBUNA_CODEPAGE_MAC_CELTIC: + result = libuna_codepage_mac_celtic_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - *unicode_character = libuna_codepage_koi8_u_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; + case LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN: + result = libuna_codepage_mac_centraleurroman_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + case LIBUNA_CODEPAGE_MAC_CROATIAN: + result = libuna_codepage_mac_croatian_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; - case LIBUNA_CODEPAGE_WINDOWS_874: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; + case LIBUNA_CODEPAGE_MAC_CYRILLIC: + result = libuna_codepage_mac_cyrillic_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - *unicode_character = libuna_codepage_windows_874_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; + case LIBUNA_CODEPAGE_MAC_DINGBATS: + result = libuna_codepage_mac_dingbats_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_FARSI: + result = libuna_codepage_mac_farsi_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_GAELIC: + result = libuna_codepage_mac_gaelic_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_GREEK: + result = libuna_codepage_mac_greek_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + case LIBUNA_CODEPAGE_MAC_ICELANDIC: + result = libuna_codepage_mac_icelandic_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_INUIT: + result = libuna_codepage_mac_inuit_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_ROMAN: + result = libuna_codepage_mac_roman_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_ROMANIAN: + result = libuna_codepage_mac_romanian_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_RUSSIAN: + result = libuna_codepage_mac_russian_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_SYMBOL: + result = libuna_codepage_mac_symbol_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_THAI: + result = libuna_codepage_mac_thai_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_TURKISH: + result = libuna_codepage_mac_turkish_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_MAC_UKRAINIAN: + result = libuna_codepage_mac_ukrainian_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + + case LIBUNA_CODEPAGE_WINDOWS_874: + result = libuna_codepage_windows_874_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_932: result = libuna_codepage_windows_932_copy_from_byte_stream( - unicode_character, + &safe_unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_936: result = libuna_codepage_windows_936_copy_from_byte_stream( - unicode_character, + &safe_unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_949: result = libuna_codepage_windows_949_copy_from_byte_stream( - unicode_character, + &safe_unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_950: result = libuna_codepage_windows_950_copy_from_byte_stream( - unicode_character, + &safe_unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_1250: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1250_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1250_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1251: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1251_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1251_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1252: - if( ( byte_stream_character < 0x80 ) - || ( byte_stream_character >= 0xa0 ) ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1252_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1252_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1253: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1253_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1253_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1254: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else if( byte_stream_character < 0xa0 ) - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - else if( byte_stream_character < 0xd0 ) - { - *unicode_character = byte_stream_character; - } - else if( byte_stream_character < 0xe0 ) - { - byte_stream_character -= 0xd0; - - *unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xd0[ byte_stream_character ]; - } - else if( byte_stream_character < 0xf0 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0xf0; - - *unicode_character = libuna_codepage_windows_1254_byte_stream_to_unicode_base_0xf0[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1254_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1255: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1255_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1255_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1256: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1256_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1256_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1257: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1257_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1257_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1258: - if( byte_stream_character < 0x80 ) - { - *unicode_character = byte_stream_character; - } - else - { - byte_stream_character -= 0x80; - - *unicode_character = libuna_codepage_windows_1258_byte_stream_to_unicode_base_0x80[ byte_stream_character ]; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1258_copy_from_byte_stream( + &safe_unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; default: @@ -773,7 +899,7 @@ return( -1 ); } - if( result != 1 ) + if( result == -1 ) { libcerror_error_set( error, @@ -784,11 +910,14 @@ return( -1 ); } + *unicode_character = safe_unicode_character; + *byte_stream_index = safe_byte_stream_index; + return( result ); } /* Copies an Unicode character to a byte stream - * Returns 1 if successful or -1 on error + * Returns 1 if successful, 0 if the Unicode character is valid but not supported since it requires special handling or -1 on error */ int libuna_unicode_character_copy_to_byte_stream( libuna_unicode_character_t unicode_character, @@ -798,8 +927,9 @@ int codepage, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_to_byte_stream"; - int result = 1; + static char *function = "libuna_unicode_character_copy_to_byte_stream"; + size_t safe_byte_stream_index = 0; + int result = 1; if( byte_stream == NULL ) { @@ -834,7 +964,9 @@ return( -1 ); } - if( *byte_stream_index >= byte_stream_size ) + safe_byte_stream_index = *byte_stream_index; + + if( safe_byte_stream_index >= byte_stream_size ) { libcerror_error_set( error, @@ -850,1255 +982,1024 @@ case LIBUNA_CODEPAGE_ASCII: if( unicode_character < 0x0080 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else { - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_1: if( unicode_character < 0x0100 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else { - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_2: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0120 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0138 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0138; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x0138[ unicode_character ]; } else if( ( unicode_character >= 0x02d8 ) && ( unicode_character < 0x02e0 ) ) { unicode_character -= 0x02d8; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_2_unicode_to_byte_stream_base_0x02d8[ unicode_character ]; } else if( unicode_character == 0x02c7 ) { - byte_stream[ *byte_stream_index ] = 0xb7; + byte_stream[ safe_byte_stream_index ] = 0xb7; } else { - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_3: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0108 ) && ( unicode_character < 0x0110 ) ) { unicode_character -= 0x0108; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0108[ unicode_character ]; } else if( ( unicode_character >= 0x0118 ) && ( unicode_character < 0x0128 ) ) { unicode_character -= 0x0118; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0118[ unicode_character ]; } else if( ( unicode_character >= 0x0130 ) && ( unicode_character < 0x0138 ) ) { unicode_character -= 0x0130; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0130[ unicode_character ]; } else if( ( unicode_character >= 0x0158 ) && ( unicode_character < 0x0160 ) ) { unicode_character -= 0x0158; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_3_unicode_to_byte_stream_base_0x0158[ unicode_character ]; } else switch( unicode_character ) { case 0x016c: - byte_stream[ *byte_stream_index ] = 0xdd; + byte_stream[ safe_byte_stream_index ] = 0xdd; break; case 0x016d: - byte_stream[ *byte_stream_index ] = 0xfd; + byte_stream[ safe_byte_stream_index ] = 0xfd; break; case 0x017b: - byte_stream[ *byte_stream_index ] = 0xaf; + byte_stream[ safe_byte_stream_index ] = 0xaf; break; case 0x017c: - byte_stream[ *byte_stream_index ] = 0xbf; + byte_stream[ safe_byte_stream_index ] = 0xbf; break; case 0x02d8: - byte_stream[ *byte_stream_index ] = 0xa2; + byte_stream[ safe_byte_stream_index ] = 0xa2; break; case 0x02d9: - byte_stream[ *byte_stream_index ] = 0xff; + byte_stream[ safe_byte_stream_index ] = 0xff; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_4: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0158 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0160 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0160; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_4_unicode_to_byte_stream_base_0x0160[ unicode_character ]; } else switch( unicode_character ) { case 0x02c7: - byte_stream[ *byte_stream_index ] = 0xb7; + byte_stream[ safe_byte_stream_index ] = 0xb7; break; case 0x02d9: - byte_stream[ *byte_stream_index ] = 0xff; + byte_stream[ safe_byte_stream_index ] = 0xff; break; case 0x02db: - byte_stream[ *byte_stream_index ] = 0xb2; + byte_stream[ safe_byte_stream_index ] = 0xb2; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_5: if( unicode_character < 0x00a1 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0400 ) && ( unicode_character < 0x0460 ) ) { unicode_character -= 0x0400; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_5_unicode_to_byte_stream_base_0x0400[ unicode_character ]; } else switch( unicode_character ) { case 0x00a7: - byte_stream[ *byte_stream_index ] = 0xfd; + byte_stream[ safe_byte_stream_index ] = 0xfd; break; case 0x00ad: - byte_stream[ *byte_stream_index ] = 0xad; + byte_stream[ safe_byte_stream_index ] = 0xad; break; case 0x2116: - byte_stream[ *byte_stream_index ] = 0xf0; + byte_stream[ safe_byte_stream_index ] = 0xf0; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_6: if( unicode_character < 0x00a1 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0618 ) && ( unicode_character < 0x658 ) ) { unicode_character -= 0x0618; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_6_unicode_to_byte_stream_base_0x0618[ unicode_character ]; } else switch( unicode_character ) { case 0x00a4: - byte_stream[ *byte_stream_index ] = 0xa4; + byte_stream[ safe_byte_stream_index ] = 0xa4; break; case 0x00ad: - byte_stream[ *byte_stream_index ] = 0xad; + byte_stream[ safe_byte_stream_index ] = 0xad; break; case 0x060c: - byte_stream[ *byte_stream_index ] = 0xac; + byte_stream[ safe_byte_stream_index ] = 0xac; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_7: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00b8 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x0380 ) && ( unicode_character < 0x03d0 ) ) { unicode_character -= 0x0380; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_7_unicode_to_byte_stream_base_0x0380[ unicode_character ]; } else switch( unicode_character ) { case 0x00bb: - byte_stream[ *byte_stream_index ] = 0xbb; + byte_stream[ safe_byte_stream_index ] = 0xbb; break; case 0x00bd: - byte_stream[ *byte_stream_index ] = 0xbd; + byte_stream[ safe_byte_stream_index ] = 0xbd; break; case 0x037a: - byte_stream[ *byte_stream_index ] = 0xaa; + byte_stream[ safe_byte_stream_index ] = 0xaa; break; case 0x2015: - byte_stream[ *byte_stream_index ] = 0xaf; + byte_stream[ safe_byte_stream_index ] = 0xaf; break; case 0x2018: - byte_stream[ *byte_stream_index ] = 0xa1; + byte_stream[ safe_byte_stream_index ] = 0xa1; break; case 0x2019: - byte_stream[ *byte_stream_index ] = 0xa2; + byte_stream[ safe_byte_stream_index ] = 0xa2; break; case 0x20ac: - byte_stream[ *byte_stream_index ] = 0xa4; + byte_stream[ safe_byte_stream_index ] = 0xa4; break; case 0x20af: - byte_stream[ *byte_stream_index ] = 0xa5; + byte_stream[ safe_byte_stream_index ] = 0xa5; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_8: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x05d0 ) && ( unicode_character < 0x05f0 ) ) { unicode_character -= 0x05d0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_8_unicode_to_byte_stream_base_0x05d0[ unicode_character ]; } else switch( unicode_character ) { case 0x00d7: - byte_stream[ *byte_stream_index ] = 0xaa; + byte_stream[ safe_byte_stream_index ] = 0xaa; break; case 0x00f7: - byte_stream[ *byte_stream_index ] = 0xba; + byte_stream[ safe_byte_stream_index ] = 0xba; break; case 0x200e: - byte_stream[ *byte_stream_index ] = 0xfd; + byte_stream[ safe_byte_stream_index ] = 0xfd; break; case 0x200f: - byte_stream[ *byte_stream_index ] = 0xfe; + byte_stream[ safe_byte_stream_index ] = 0xfe; break; case 0x2017: - byte_stream[ *byte_stream_index ] = 0xdf; + byte_stream[ safe_byte_stream_index ] = 0xdf; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_9: if( unicode_character < 0x00d0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00d0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00d0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_9_unicode_to_byte_stream_base_0x00d0[ unicode_character ]; } else switch( unicode_character ) { case 0x011e: - byte_stream[ *byte_stream_index ] = 0xd0; + byte_stream[ safe_byte_stream_index ] = 0xd0; break; case 0x011f: - byte_stream[ *byte_stream_index ] = 0xf0; + byte_stream[ safe_byte_stream_index ] = 0xf0; break; case 0x0130: - byte_stream[ *byte_stream_index ] = 0xdd; + byte_stream[ safe_byte_stream_index ] = 0xdd; break; case 0x0131: - byte_stream[ *byte_stream_index ] = 0xfd; + byte_stream[ safe_byte_stream_index ] = 0xfd; break; case 0x015e: - byte_stream[ *byte_stream_index ] = 0xde; + byte_stream[ safe_byte_stream_index ] = 0xde; break; case 0x015f: - byte_stream[ *byte_stream_index ] = 0xfe; + byte_stream[ safe_byte_stream_index ] = 0xfe; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_10: if( unicode_character < 0x00a1 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00c0 ) && ( unicode_character < 0x0150 ) ) { unicode_character -= 0x00c0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; } else if( ( unicode_character >= 0x0160 ) && ( unicode_character < 0x0170 ) ) { unicode_character -= 0x0160; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_10_unicode_to_byte_stream_base_0x0160[ unicode_character ]; } else switch( unicode_character ) { case 0x00a7: - byte_stream[ *byte_stream_index ] = 0xa7; + byte_stream[ safe_byte_stream_index ] = 0xa7; break; case 0x00ad: - byte_stream[ *byte_stream_index ] = 0xad; + byte_stream[ safe_byte_stream_index ] = 0xad; break; case 0x00b0: - byte_stream[ *byte_stream_index ] = 0xb0; + byte_stream[ safe_byte_stream_index ] = 0xb0; break; case 0x00b7: - byte_stream[ *byte_stream_index ] = 0xb7; + byte_stream[ safe_byte_stream_index ] = 0xb7; break; case 0x0172: - byte_stream[ *byte_stream_index ] = 0xd9; + byte_stream[ safe_byte_stream_index ] = 0xd9; break; case 0x0173: - byte_stream[ *byte_stream_index ] = 0xf9; + byte_stream[ safe_byte_stream_index ] = 0xf9; break; case 0x017d: - byte_stream[ *byte_stream_index ] = 0xac; + byte_stream[ safe_byte_stream_index ] = 0xac; break; case 0x017e: - byte_stream[ *byte_stream_index ] = 0xbc; + byte_stream[ safe_byte_stream_index ] = 0xbc; break; case 0x2015: - byte_stream[ *byte_stream_index ] = 0xbd; + byte_stream[ safe_byte_stream_index ] = 0xbd; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_11: if( unicode_character < 0x00a1 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x0e01 ) && ( unicode_character < 0x0e3b ) ) { - byte_stream[ *byte_stream_index ] = (uint8_t) ( unicode_character - 0x0d60 ); + byte_stream[ safe_byte_stream_index ] = (uint8_t) ( unicode_character - 0x0d60 ); } else if( ( unicode_character >= 0x0e3f ) && ( unicode_character < 0x0e5c ) ) { - byte_stream[ *byte_stream_index ] = (uint8_t) ( unicode_character - 0x0d60 ); + byte_stream[ safe_byte_stream_index ] = (uint8_t) ( unicode_character - 0x0d60 ); } else { - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_13: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( ( unicode_character >= 0x2018 ) && ( unicode_character < 0x2020 ) ) { unicode_character -= 0x2018; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_13_unicode_to_byte_stream_base_0x2018[ unicode_character ]; } else { - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_14: if( unicode_character < 0x00a1 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00c0 ) && ( unicode_character < 0x0100 ) ) { unicode_character -= 0x00c0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; } else if( ( unicode_character >= 0x0170 ) && ( unicode_character < 0x0178 ) ) { unicode_character -= 0x0170; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x0170[ unicode_character ]; } else if( ( unicode_character >= 0x1e80 ) && ( unicode_character < 0x1e88 ) ) { unicode_character -= 0x1e80; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_14_unicode_to_byte_stream_base_0x1e80[ unicode_character ]; } else switch( unicode_character ) { case 0x00a3: - byte_stream[ *byte_stream_index ] = 0xa3; + byte_stream[ safe_byte_stream_index ] = 0xa3; break; case 0x00a7: - byte_stream[ *byte_stream_index ] = 0xa7; + byte_stream[ safe_byte_stream_index ] = 0xa7; break; case 0x00a9: - byte_stream[ *byte_stream_index ] = 0xa9; + byte_stream[ safe_byte_stream_index ] = 0xa9; break; case 0x00ad: - byte_stream[ *byte_stream_index ] = 0xad; + byte_stream[ safe_byte_stream_index ] = 0xad; break; case 0x00ae: - byte_stream[ *byte_stream_index ] = 0xae; + byte_stream[ safe_byte_stream_index ] = 0xae; break; case 0x00b6: - byte_stream[ *byte_stream_index ] = 0xb6; + byte_stream[ safe_byte_stream_index ] = 0xb6; break; case 0x010a: - byte_stream[ *byte_stream_index ] = 0xa4; + byte_stream[ safe_byte_stream_index ] = 0xa4; break; case 0x010b: - byte_stream[ *byte_stream_index ] = 0xa5; + byte_stream[ safe_byte_stream_index ] = 0xa5; break; case 0x0120: - byte_stream[ *byte_stream_index ] = 0xb2; + byte_stream[ safe_byte_stream_index ] = 0xb2; break; case 0x0121: - byte_stream[ *byte_stream_index ] = 0xb3; + byte_stream[ safe_byte_stream_index ] = 0xb3; break; case 0x0178: - byte_stream[ *byte_stream_index ] = 0xaf; + byte_stream[ safe_byte_stream_index ] = 0xaf; break; case 0x1e02: - byte_stream[ *byte_stream_index ] = 0xa1; + byte_stream[ safe_byte_stream_index ] = 0xa1; break; case 0x1e03: - byte_stream[ *byte_stream_index ] = 0xa2; + byte_stream[ safe_byte_stream_index ] = 0xa2; break; case 0x1e0a: - byte_stream[ *byte_stream_index ] = 0xa6; + byte_stream[ safe_byte_stream_index ] = 0xa6; break; case 0x1e0b: - byte_stream[ *byte_stream_index ] = 0xab; + byte_stream[ safe_byte_stream_index ] = 0xab; break; case 0x1e1e: - byte_stream[ *byte_stream_index ] = 0xb0; + byte_stream[ safe_byte_stream_index ] = 0xb0; break; case 0x1e1f: - byte_stream[ *byte_stream_index ] = 0xb1; + byte_stream[ safe_byte_stream_index ] = 0xb1; break; case 0x1e40: - byte_stream[ *byte_stream_index ] = 0xb4; + byte_stream[ safe_byte_stream_index ] = 0xb4; break; case 0x1e41: - byte_stream[ *byte_stream_index ] = 0xb5; + byte_stream[ safe_byte_stream_index ] = 0xb5; break; case 0x1e56: - byte_stream[ *byte_stream_index ] = 0xb7; + byte_stream[ safe_byte_stream_index ] = 0xb7; break; case 0x1e57: - byte_stream[ *byte_stream_index ] = 0xb9; + byte_stream[ safe_byte_stream_index ] = 0xb9; break; case 0x1e60: - byte_stream[ *byte_stream_index ] = 0xbb; + byte_stream[ safe_byte_stream_index ] = 0xbb; break; case 0x1e61: - byte_stream[ *byte_stream_index ] = 0xbf; + byte_stream[ safe_byte_stream_index ] = 0xbf; break; case 0x1e6a: - byte_stream[ *byte_stream_index ] = 0xd7; + byte_stream[ safe_byte_stream_index ] = 0xd7; break; case 0x1e6b: - byte_stream[ *byte_stream_index ] = 0xf7; + byte_stream[ safe_byte_stream_index ] = 0xf7; break; case 0x1ef2: - byte_stream[ *byte_stream_index ] = 0xac; + byte_stream[ safe_byte_stream_index ] = 0xac; break; case 0x1ef3: - byte_stream[ *byte_stream_index ] = 0xbc; + byte_stream[ safe_byte_stream_index ] = 0xbc; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_15: if( unicode_character < 0x00a0 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a0 ) && ( unicode_character < 0x00c0 ) ) { unicode_character -= 0x00a0; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_15_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; } else if( unicode_character < 0x0100 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else switch( unicode_character ) { case 0x0152: - byte_stream[ *byte_stream_index ] = 0xbc; + byte_stream[ safe_byte_stream_index ] = 0xbc; break; case 0x0153: - byte_stream[ *byte_stream_index ] = 0xbd; + byte_stream[ safe_byte_stream_index ] = 0xbd; break; case 0x0160: - byte_stream[ *byte_stream_index ] = 0xa6; + byte_stream[ safe_byte_stream_index ] = 0xa6; break; case 0x0161: - byte_stream[ *byte_stream_index ] = 0xa8; + byte_stream[ safe_byte_stream_index ] = 0xa8; break; case 0x0178: - byte_stream[ *byte_stream_index ] = 0xbe; + byte_stream[ safe_byte_stream_index ] = 0xbe; break; case 0x017d: - byte_stream[ *byte_stream_index ] = 0xb4; + byte_stream[ safe_byte_stream_index ] = 0xb4; break; case 0x017e: - byte_stream[ *byte_stream_index ] = 0xb8; + byte_stream[ safe_byte_stream_index ] = 0xb8; break; case 0x20ac: - byte_stream[ *byte_stream_index ] = 0xa4; + byte_stream[ safe_byte_stream_index ] = 0xa4; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_ISO_8859_16: if( unicode_character < 0x00a1 ) { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; + byte_stream[ safe_byte_stream_index ] = (uint8_t) unicode_character; } else if( ( unicode_character >= 0x00a8 ) && ( unicode_character < 0x0108 ) ) { unicode_character -= 0x00a8; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x00a8[ unicode_character ]; } else if( ( unicode_character >= 0x0140 ) && ( unicode_character < 0x0148 ) ) { unicode_character -= 0x0140; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0140[ unicode_character ]; } else if( ( unicode_character >= 0x0150 ) && ( unicode_character < 0x0158 ) ) { unicode_character -= 0x0150; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0150[ unicode_character ]; } else if( ( unicode_character >= 0x0178 ) && ( unicode_character < 0x0180 ) ) { unicode_character -= 0x0178; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0178[ unicode_character ]; } else if( ( unicode_character >= 0x0218 ) && ( unicode_character < 0x0220 ) ) { unicode_character -= 0x0218; - byte_stream[ *byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ unicode_character ]; + byte_stream[ safe_byte_stream_index ] = libuna_codepage_iso_8859_16_unicode_to_byte_stream_base_0x0218[ unicode_character ]; } else switch( unicode_character ) { case 0x00a7: - byte_stream[ *byte_stream_index ] = 0xa7; + byte_stream[ safe_byte_stream_index ] = 0xa7; break; case 0x010c: - byte_stream[ *byte_stream_index ] = 0xb2; + byte_stream[ safe_byte_stream_index ] = 0xb2; break; case 0x010d: - byte_stream[ *byte_stream_index ] = 0xb9; + byte_stream[ safe_byte_stream_index ] = 0xb9; break; case 0x0110: - byte_stream[ *byte_stream_index ] = 0xd0; + byte_stream[ safe_byte_stream_index ] = 0xd0; break; case 0x0111: - byte_stream[ *byte_stream_index ] = 0xf0; + byte_stream[ safe_byte_stream_index ] = 0xf0; break; case 0x0118: - byte_stream[ *byte_stream_index ] = 0xdd; + byte_stream[ safe_byte_stream_index ] = 0xdd; break; case 0x0119: - byte_stream[ *byte_stream_index ] = 0xfd; + byte_stream[ safe_byte_stream_index ] = 0xfd; break; case 0x015a: - byte_stream[ *byte_stream_index ] = 0xd7; + byte_stream[ safe_byte_stream_index ] = 0xd7; break; case 0x015b: - byte_stream[ *byte_stream_index ] = 0xf7; + byte_stream[ safe_byte_stream_index ] = 0xf7; break; case 0x0160: - byte_stream[ *byte_stream_index ] = 0xa6; + byte_stream[ safe_byte_stream_index ] = 0xa6; break; case 0x0161: - byte_stream[ *byte_stream_index ] = 0xa8; + byte_stream[ safe_byte_stream_index ] = 0xa8; break; case 0x0170: - byte_stream[ *byte_stream_index ] = 0xd8; + byte_stream[ safe_byte_stream_index ] = 0xd8; break; case 0x0171: - byte_stream[ *byte_stream_index ] = 0xf8; + byte_stream[ safe_byte_stream_index ] = 0xf8; break; case 0x201d: - byte_stream[ *byte_stream_index ] = 0xb5; + byte_stream[ safe_byte_stream_index ] = 0xb5; break; case 0x201e: - byte_stream[ *byte_stream_index ] = 0xa5; + byte_stream[ safe_byte_stream_index ] = 0xa5; break; case 0x20ac: - byte_stream[ *byte_stream_index ] = 0xa4; + byte_stream[ safe_byte_stream_index ] = 0xa4; break; default: - byte_stream[ *byte_stream_index ] = 0x1a; + byte_stream[ safe_byte_stream_index ] = 0x1a; break; } - *byte_stream_index += 1; + safe_byte_stream_index += 1; break; case LIBUNA_CODEPAGE_KOI8_R: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x0410 ) - && ( unicode_character < 0x0450 ) ) - { - unicode_character -= 0x0410; - - byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x0410[ unicode_character ]; - } - else if( ( unicode_character >= 0x2550 ) - && ( unicode_character < 0x2570 ) ) - { - unicode_character -= 0x2550; - - byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_r_unicode_to_byte_stream_base_0x2550[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x00a0: - byte_stream[ *byte_stream_index ] = 0x9a; - break; - - case 0x00a9: - byte_stream[ *byte_stream_index ] = 0xbf; - break; - - case 0x00b0: - byte_stream[ *byte_stream_index ] = 0x9c; - break; - - case 0x00b2: - byte_stream[ *byte_stream_index ] = 0x9d; - break; - - case 0x00b7: - byte_stream[ *byte_stream_index ] = 0x9e; - break; - - case 0x00f7: - byte_stream[ *byte_stream_index ] = 0x9f; - break; - - case 0x0401: - byte_stream[ *byte_stream_index ] = 0xb3; - break; - - case 0x0451: - byte_stream[ *byte_stream_index ] = 0xa3; - break; - - case 0x2219: - byte_stream[ *byte_stream_index ] = 0x95; - break; - - case 0x221a: - byte_stream[ *byte_stream_index ] = 0x96; - break; - - case 0x2248: - byte_stream[ *byte_stream_index ] = 0x97; - break; - - case 0x2264: - byte_stream[ *byte_stream_index ] = 0x98; - break; - - case 0x2265: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - case 0x2320: - byte_stream[ *byte_stream_index ] = 0x93; - break; - - case 0x2321: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x2500: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2502: - byte_stream[ *byte_stream_index ] = 0x81; - break; - - case 0x250c: - byte_stream[ *byte_stream_index ] = 0x82; - break; - - case 0x2510: - byte_stream[ *byte_stream_index ] = 0x83; - break; - - case 0x2514: - byte_stream[ *byte_stream_index ] = 0x84; - break; - - case 0x2518: - byte_stream[ *byte_stream_index ] = 0x85; - break; - - case 0x251c: - byte_stream[ *byte_stream_index ] = 0x86; - break; - - case 0x2524: - byte_stream[ *byte_stream_index ] = 0x87; - break; - - case 0x252c: - byte_stream[ *byte_stream_index ] = 0x88; - break; - - case 0x2534: - byte_stream[ *byte_stream_index ] = 0x89; - break; - - case 0x253c: - byte_stream[ *byte_stream_index ] = 0x8a; - break; - - case 0x2580: - byte_stream[ *byte_stream_index ] = 0x8b; - break; - - case 0x2584: - byte_stream[ *byte_stream_index ] = 0x8c; - break; - - case 0x2588: - byte_stream[ *byte_stream_index ] = 0x8d; - break; - - case 0x258c: - byte_stream[ *byte_stream_index ] = 0x8e; - break; - - case 0x2590: - byte_stream[ *byte_stream_index ] = 0x8f; - break; - - case 0x2591: - byte_stream[ *byte_stream_index ] = 0x90; - break; - - case 0x2592: - byte_stream[ *byte_stream_index ] = 0x91; - break; - - case 0x2593: - byte_stream[ *byte_stream_index ] = 0x92; - break; - - case 0x25a0: - byte_stream[ *byte_stream_index ] = 0x94; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_koi8_r_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_KOI8_U: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x0410 ) - && ( unicode_character < 0x0450 ) ) - { - unicode_character -= 0x0410; - - byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x0410[ unicode_character ]; - } - else if( ( unicode_character >= 0x2550 ) - && ( unicode_character < 0x2570 ) ) - { - unicode_character -= 0x2550; - - byte_stream[ *byte_stream_index ] = libuna_codepage_koi8_u_unicode_to_byte_stream_base_0x2550[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x00a0: - byte_stream[ *byte_stream_index ] = 0x9a; - break; - - case 0x00a9: - byte_stream[ *byte_stream_index ] = 0xbf; - break; - - case 0x00b0: - byte_stream[ *byte_stream_index ] = 0x9c; - break; - - case 0x00b2: - byte_stream[ *byte_stream_index ] = 0x9d; - break; - - case 0x00b7: - byte_stream[ *byte_stream_index ] = 0x9e; - break; - - case 0x00f7: - byte_stream[ *byte_stream_index ] = 0x9f; - break; - - case 0x0401: - byte_stream[ *byte_stream_index ] = 0xb3; - break; - - case 0x0404: - byte_stream[ *byte_stream_index ] = 0xb4; - break; - - case 0x0406: - byte_stream[ *byte_stream_index ] = 0xb6; - break; - - case 0x0407: - byte_stream[ *byte_stream_index ] = 0xb7; - break; - - case 0x0451: - byte_stream[ *byte_stream_index ] = 0xa3; - break; - - case 0x0454: - byte_stream[ *byte_stream_index ] = 0xa4; - break; - - case 0x0456: - byte_stream[ *byte_stream_index ] = 0xa6; - break; - - case 0x0457: - byte_stream[ *byte_stream_index ] = 0xa7; - break; - - case 0x0490: - byte_stream[ *byte_stream_index ] = 0xbd; - break; - - case 0x0491: - byte_stream[ *byte_stream_index ] = 0xad; - break; - - case 0x2219: - byte_stream[ *byte_stream_index ] = 0x95; - break; - - case 0x221a: - byte_stream[ *byte_stream_index ] = 0x96; - break; - - case 0x2248: - byte_stream[ *byte_stream_index ] = 0x97; - break; - - case 0x2264: - byte_stream[ *byte_stream_index ] = 0x98; - break; - - case 0x2265: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - case 0x2320: - byte_stream[ *byte_stream_index ] = 0x93; - break; - - case 0x2321: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x2500: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2502: - byte_stream[ *byte_stream_index ] = 0x81; - break; - - case 0x250c: - byte_stream[ *byte_stream_index ] = 0x82; - break; - - case 0x2510: - byte_stream[ *byte_stream_index ] = 0x83; - break; + result = libuna_codepage_koi8_u_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2514: - byte_stream[ *byte_stream_index ] = 0x84; - break; + case LIBUNA_CODEPAGE_MAC_ARABIC: + result = libuna_codepage_mac_arabic_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2518: - byte_stream[ *byte_stream_index ] = 0x85; - break; + case LIBUNA_CODEPAGE_MAC_CELTIC: + result = libuna_codepage_mac_celtic_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x251c: - byte_stream[ *byte_stream_index ] = 0x86; - break; + case LIBUNA_CODEPAGE_MAC_CENTRALEURROMAN: + result = libuna_codepage_mac_centraleurroman_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2524: - byte_stream[ *byte_stream_index ] = 0x87; - break; + case LIBUNA_CODEPAGE_MAC_CROATIAN: + result = libuna_codepage_mac_croatian_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x252c: - byte_stream[ *byte_stream_index ] = 0x88; - break; + case LIBUNA_CODEPAGE_MAC_CYRILLIC: + result = libuna_codepage_mac_cyrillic_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2534: - byte_stream[ *byte_stream_index ] = 0x89; - break; + case LIBUNA_CODEPAGE_MAC_DINGBATS: + result = libuna_codepage_mac_dingbats_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x253c: - byte_stream[ *byte_stream_index ] = 0x8a; - break; + case LIBUNA_CODEPAGE_MAC_FARSI: + result = libuna_codepage_mac_farsi_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2580: - byte_stream[ *byte_stream_index ] = 0x8b; - break; + case LIBUNA_CODEPAGE_MAC_GAELIC: + result = libuna_codepage_mac_gaelic_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2584: - byte_stream[ *byte_stream_index ] = 0x8c; - break; + case LIBUNA_CODEPAGE_MAC_GREEK: + result = libuna_codepage_mac_greek_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2588: - byte_stream[ *byte_stream_index ] = 0x8d; - break; + case LIBUNA_CODEPAGE_MAC_ICELANDIC: + result = libuna_codepage_mac_icelandic_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x258c: - byte_stream[ *byte_stream_index ] = 0x8e; - break; + case LIBUNA_CODEPAGE_MAC_INUIT: + result = libuna_codepage_mac_inuit_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2590: - byte_stream[ *byte_stream_index ] = 0x8f; - break; + case LIBUNA_CODEPAGE_MAC_ROMAN: + result = libuna_codepage_mac_roman_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2591: - byte_stream[ *byte_stream_index ] = 0x90; - break; + case LIBUNA_CODEPAGE_MAC_ROMANIAN: + result = libuna_codepage_mac_romanian_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2592: - byte_stream[ *byte_stream_index ] = 0x91; - break; + case LIBUNA_CODEPAGE_MAC_RUSSIAN: + result = libuna_codepage_mac_russian_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x2593: - byte_stream[ *byte_stream_index ] = 0x92; - break; + case LIBUNA_CODEPAGE_MAC_SYMBOL: + result = libuna_codepage_mac_symbol_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x25a0: - byte_stream[ *byte_stream_index ] = 0x94; - break; + case LIBUNA_CODEPAGE_MAC_THAI: + result = libuna_codepage_mac_thai_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; + case LIBUNA_CODEPAGE_MAC_TURKISH: + result = libuna_codepage_mac_turkish_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; + case LIBUNA_CODEPAGE_MAC_UKRAINIAN: + result = libuna_codepage_mac_ukrainian_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_874: - if( ( unicode_character < 0x0080 ) - || ( unicode_character == 0x00a0 ) ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x0e00 ) - && ( unicode_character < 0x0e60 ) ) - { - unicode_character -= 0x0e00; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_874_unicode_to_byte_stream_base_0x0e00[ unicode_character ]; - } - else if( ( unicode_character >= 0x2018 ) - && ( unicode_character < 0x2020 ) ) - { - unicode_character -= 0x2018; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_874_unicode_to_byte_stream_base_0x2018[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x2013: - byte_stream[ *byte_stream_index ] = 0x96; - break; - - case 0x2014: - byte_stream[ *byte_stream_index ] = 0x97; - break; - - case 0x2022: - byte_stream[ *byte_stream_index ] = 0x95; - break; - - case 0x2026: - byte_stream[ *byte_stream_index ] = 0x85; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_874_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_932: @@ -2106,7 +2007,7 @@ unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; @@ -2115,7 +2016,7 @@ unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; @@ -2124,7 +2025,7 @@ unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; @@ -2133,836 +2034,598 @@ unicode_character, byte_stream, byte_stream_size, - byte_stream_index, + &safe_byte_stream_index, error ); break; case LIBUNA_CODEPAGE_WINDOWS_1250: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x0120 ) ) - { - unicode_character -= 0x00a0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; - } - else if( ( unicode_character >= 0x0138 ) - && ( unicode_character < 0x0180 ) ) - { - unicode_character -= 0x0138; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x0138[ unicode_character ]; - } - else if( ( unicode_character >= 0x02d8 ) - && ( unicode_character < 0x02e0 ) ) - { - unicode_character -= 0x02d8; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x02d8[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else if( ( unicode_character >= 0x2030 ) - && ( unicode_character < 0x2040 ) ) - { - unicode_character -= 0x2030; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1250_unicode_to_byte_stream_base_0x2030[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x02c7: - byte_stream[ *byte_stream_index ] = 0xa1; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1250_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1251: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x00c0 ) ) - { - unicode_character -= 0x00a0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; - } - else if( ( unicode_character >= 0x0400 ) - && ( unicode_character < 0x0460 ) ) - { - unicode_character -= 0x0400; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x0400[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1251_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x0490: - byte_stream[ *byte_stream_index ] = 0xa5; - break; - - case 0x0491: - byte_stream[ *byte_stream_index ] = 0xb4; - break; - - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; - - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; - - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x88; - break; - - case 0x2116: - byte_stream[ *byte_stream_index ] = 0xb9; - break; - - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1251_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1252: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x0100 ) ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1252_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x0152: - byte_stream[ *byte_stream_index ] = 0x8c; - break; - - case 0x0153: - byte_stream[ *byte_stream_index ] = 0x9c; - break; - - case 0x0160: - byte_stream[ *byte_stream_index ] = 0x8a; - break; - - case 0x0161: - byte_stream[ *byte_stream_index ] = 0x9a; - break; - - case 0x0178: - byte_stream[ *byte_stream_index ] = 0x9f; - break; - - case 0x017d: - byte_stream[ *byte_stream_index ] = 0x8e; - break; - - case 0x017e: - byte_stream[ *byte_stream_index ] = 0x9e; - break; - - case 0x0192: - byte_stream[ *byte_stream_index ] = 0x83; - break; - - case 0x02c6: - byte_stream[ *byte_stream_index ] = 0x88; - break; - - case 0x02dc: - byte_stream[ *byte_stream_index ] = 0x98; - break; - - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; - - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; - - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1252_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1253: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x00c0 ) ) - { - unicode_character -= 0x00a0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; - } - else if( ( unicode_character >= 0x0380 ) - && ( unicode_character < 0x03d0 ) ) - { - unicode_character -= 0x0380; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x0380[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1253_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x0192: - byte_stream[ *byte_stream_index ] = 0x83; - break; - - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; - - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; - - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1253_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1254: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x00d0 ) ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00d0 ) - && ( unicode_character < 0x0100 ) ) - { - unicode_character -= 0x00d0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x00d0[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1254_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x011e: - byte_stream[ *byte_stream_index ] = 0xd0; - break; - - case 0x011f: - byte_stream[ *byte_stream_index ] = 0xf0; - break; - - case 0x0130: - byte_stream[ *byte_stream_index ] = 0xdd; - break; - - case 0x0131: - byte_stream[ *byte_stream_index ] = 0xfd; - break; - - case 0x0152: - byte_stream[ *byte_stream_index ] = 0x8c; - break; - - case 0x0153: - byte_stream[ *byte_stream_index ] = 0x9c; - break; - - case 0x015e: - byte_stream[ *byte_stream_index ] = 0xde; - break; - - case 0x015f: - byte_stream[ *byte_stream_index ] = 0xfe; - break; - - case 0x0160: - byte_stream[ *byte_stream_index ] = 0x8a; - break; - - case 0x0161: - byte_stream[ *byte_stream_index ] = 0x9a; - break; - - case 0x0178: - byte_stream[ *byte_stream_index ] = 0x9f; - break; - - case 0x0192: - byte_stream[ *byte_stream_index ] = 0x83; - break; - - case 0x02c6: - byte_stream[ *byte_stream_index ] = 0x88; - break; - - case 0x02dc: - byte_stream[ *byte_stream_index ] = 0x98; - break; - - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; - - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; - - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1254_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1255: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x00c0 ) ) - { - unicode_character -= 0x00a0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; - } - else if( ( unicode_character >= 0x05b0 ) - && ( unicode_character < 0x05c8 ) ) - { - unicode_character -= 0x05b0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05b0[ unicode_character ]; - } - else if( ( unicode_character >= 0x05d0 ) - && ( unicode_character < 0x05f8 ) ) - { - unicode_character -= 0x05d0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x05d0[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1255_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x00d7: - byte_stream[ *byte_stream_index ] = 0xaa; - break; - - case 0x00f7: - byte_stream[ *byte_stream_index ] = 0xba; - break; - - case 0x0192: - byte_stream[ *byte_stream_index ] = 0x83; - break; - - case 0x02c6: - byte_stream[ *byte_stream_index ] = 0x88; - break; - - case 0x02dc: - byte_stream[ *byte_stream_index ] = 0x98; - break; - - case 0x200e: - byte_stream[ *byte_stream_index ] = 0xfd; - break; - - case 0x200f: - byte_stream[ *byte_stream_index ] = 0xfe; - break; - - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; - - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; - - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; - - case 0x20aa: - byte_stream[ *byte_stream_index ] = 0xa4; - break; - - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; - - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; - - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; - + result = libuna_codepage_windows_1255_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); break; case LIBUNA_CODEPAGE_WINDOWS_1256: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x00c0 ) ) - { - unicode_character -= 0x00a0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; - } - else if( ( unicode_character >= 0x00e0 ) - && ( unicode_character < 0x0100 ) ) - { - unicode_character -= 0x00e0; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x00e0[ unicode_character ]; - } - else if( ( unicode_character >= 0x0618 ) - && ( unicode_character < 0x0658 ) ) - { - unicode_character -= 0x0618; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x0618[ unicode_character ]; - } - else if( ( unicode_character >= 0x2008 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2008; - - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1256_unicode_to_byte_stream_base_0x2008[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x00d7: - byte_stream[ *byte_stream_index ] = 0xd7; - break; - - case 0x0152: - byte_stream[ *byte_stream_index ] = 0x8c; - break; - - case 0x0153: - byte_stream[ *byte_stream_index ] = 0x9c; - break; - - case 0x0192: - byte_stream[ *byte_stream_index ] = 0x83; - break; - - case 0x02c6: - byte_stream[ *byte_stream_index ] = 0x88; - break; - - case 0x060c: - byte_stream[ *byte_stream_index ] = 0xa1; - break; - - case 0x0679: - byte_stream[ *byte_stream_index ] = 0x8a; - break; - - case 0x067e: - byte_stream[ *byte_stream_index ] = 0x81; - break; + result = libuna_codepage_windows_1256_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x0686: - byte_stream[ *byte_stream_index ] = 0x8d; - break; + case LIBUNA_CODEPAGE_WINDOWS_1257: + result = libuna_codepage_windows_1257_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x0688: - byte_stream[ *byte_stream_index ] = 0x8f; - break; + case LIBUNA_CODEPAGE_WINDOWS_1258: + result = libuna_codepage_windows_1258_copy_to_byte_stream( + unicode_character, + byte_stream, + byte_stream_size, + &safe_byte_stream_index, + error ); + break; - case 0x0691: - byte_stream[ *byte_stream_index ] = 0x9a; - break; + default: + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported codepage: %d.", + function, + codepage ); - case 0x0698: - byte_stream[ *byte_stream_index ] = 0x8e; - break; + return( -1 ); + } + if( result == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to copy Unicode character to byte stream.", + function ); - case 0x06a9: - byte_stream[ *byte_stream_index ] = 0x98; - break; + return( -1 ); + } + *byte_stream_index = safe_byte_stream_index; - case 0x06af: - byte_stream[ *byte_stream_index ] = 0x90; - break; + return( result ); +} - case 0x06ba: - byte_stream[ *byte_stream_index ] = 0x9f; - break; +/* Determines the size of an UCS-2 character from an Unicode character + * Adds the size to the UCS-2 character size value + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_size_to_ucs2( + libuna_unicode_character_t unicode_character, + size_t *ucs2_character_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_size_to_ucs2"; - case 0x06be: - byte_stream[ *byte_stream_index ] = 0xaa; - break; + if( ucs2_character_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-2 character size.", + function ); - case 0x06c1: - byte_stream[ *byte_stream_index ] = 0xc0; - break; + return( -1 ); + } + /* Determine if the Unicode character is valid + * UCS-2 with surrogate pairs supports upto 0x10ffff characters + */ + if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); - case 0x06d2: - byte_stream[ *byte_stream_index ] = 0xff; - break; + return( -1 ); + } + if( unicode_character > LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) + { + *ucs2_character_size += 2; + } + else + { + *ucs2_character_size += 1; + } + return( 1 ); +} - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; +/* Copies an Unicode character from an UCS-2 string + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_copy_from_ucs2( + libuna_unicode_character_t *unicode_character, + const libuna_utf16_character_t *ucs2_string, + size_t ucs2_string_size, + size_t *ucs2_string_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_copy_from_ucs2"; + libuna_utf16_character_t ucs2_surrogate = 0; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_ucs2_string_index = 0; - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; + return( -1 ); + } + if( ucs2_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-2 string.", + function ); - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; + return( -1 ); + } + if( ucs2_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UCS-2 string size value exceeds maximum.", + function ); - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; + return( -1 ); + } + if( ucs2_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-2 string index.", + function ); - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; + return( -1 ); + } + safe_ucs2_string_index = *ucs2_string_index; - break; + if( safe_ucs2_string_index >= ucs2_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UCS-2 string too small.", + function ); - case LIBUNA_CODEPAGE_WINDOWS_1257: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x0180 ) ) - { - unicode_character -= 0x00a0; + return( -1 ); + } + safe_unicode_character = ucs2_string[ safe_ucs2_string_index ]; + safe_ucs2_string_index += 1; - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x00a0[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; + /* Determine if the UCS-2 character is within the high surrogate range + */ + if( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) + { + if( safe_ucs2_string_index >= ucs2_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: missing surrogate UCS-2 character bytes.", + function ); - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1257_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x02c7: - byte_stream[ *byte_stream_index ] = 0x8e; - break; + return( -1 ); + } + ucs2_surrogate = ucs2_string[ safe_ucs2_string_index ]; - case 0x02d9: - byte_stream[ *byte_stream_index ] = 0xff; - break; + /* Determine if the UCS-2 character is within the low surrogate range + */ + if( ( ucs2_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) + && ( ucs2_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + { + safe_unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; + safe_unicode_character <<= 10; + safe_unicode_character += ucs2_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START; + safe_unicode_character += 0x010000; - case 0x02db: - byte_stream[ *byte_stream_index ] = 0x9e; - break; + safe_ucs2_string_index += 1; + } + } + /* Determine if the Unicode character is valid + * UCS-2 with surrogate pairs supports upto 0x10ffff characters + */ + if( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; + return( -1 ); + } + *unicode_character = safe_unicode_character; + *ucs2_string_index = safe_ucs2_string_index; - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; + return( 1 ); +} - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; +/* Copies an Unicode character into a UCS-2 string + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_copy_to_ucs2( + libuna_unicode_character_t unicode_character, + libuna_utf16_character_t *ucs2_string, + size_t ucs2_string_size, + size_t *ucs2_string_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_copy_to_ucs2"; + size_t safe_ucs2_string_index = 0; - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; + if( ucs2_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-2 string.", + function ); - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; + return( -1 ); + } + if( ucs2_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UCS-2 string size value exceeds maximum.", + function ); - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; + return( -1 ); + } + if( ucs2_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-2 string index.", + function ); - break; + return( -1 ); + } + safe_ucs2_string_index = *ucs2_string_index; - case LIBUNA_CODEPAGE_WINDOWS_1258: - if( unicode_character < 0x0080 ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00a0 ) - && ( unicode_character < 0x00c0 ) ) - { - byte_stream[ *byte_stream_index ] = (uint8_t) unicode_character; - } - else if( ( unicode_character >= 0x00c0 ) - && ( unicode_character < 0x0108 ) ) - { - unicode_character -= 0x00c0; + if( safe_ucs2_string_index >= ucs2_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UCS-2 string too small.", + function ); - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x00c0[ unicode_character ]; - } - else if( ( unicode_character >= 0x2010 ) - && ( unicode_character < 0x2028 ) ) - { - unicode_character -= 0x2010; + return( -1 ); + } + /* Determine if the Unicode character is valid + */ + if( unicode_character > LIBUNA_UCS_CHARACTER_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); - byte_stream[ *byte_stream_index ] = libuna_codepage_windows_1258_unicode_to_byte_stream_base_0x2010[ unicode_character ]; - } - else switch( unicode_character ) - { - case 0x0110: - byte_stream[ *byte_stream_index ] = 0xd0; - break; + return( -1 ); + } + if( unicode_character <= LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) + { + ucs2_string[ safe_ucs2_string_index++ ] = (libuna_utf16_character_t) unicode_character; + } + else + { + if( ( ucs2_string_size < 2 ) + || ( safe_ucs2_string_index > ( ucs2_string_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UCS-2 string too small.", + function ); - case 0x0111: - byte_stream[ *byte_stream_index ] = 0xf0; - break; + return( -1 ); + } + unicode_character -= 0x010000; + ucs2_string[ safe_ucs2_string_index++ ] = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); + ucs2_string[ safe_ucs2_string_index++ ] = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); + } + *ucs2_string_index = safe_ucs2_string_index; - case 0x0152: - byte_stream[ *byte_stream_index ] = 0x8c; - break; + return( 1 ); +} - case 0x0153: - byte_stream[ *byte_stream_index ] = 0x9c; - break; +/* Determines the size of an UCS-4 character from an Unicode character + * Adds the size to the UCS-4 character size value + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_size_to_ucs4( + libuna_unicode_character_t unicode_character, + size_t *ucs4_character_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_size_to_ucs4"; - case 0x0178: - byte_stream[ *byte_stream_index ] = 0x9f; - break; + LIBUNA_UNREFERENCED_PARAMETER( unicode_character ) - case 0x0192: - byte_stream[ *byte_stream_index ] = 0x83; - break; + if( ucs4_character_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-4 character size.", + function ); - case 0x01a0: - byte_stream[ *byte_stream_index ] = 0xd5; - break; + return( -1 ); + } + if( unicode_character > LIBUNA_UCS_CHARACTER_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); - case 0x01a1: - byte_stream[ *byte_stream_index ] = 0xf5; - break; + return( -1 ); + } + *ucs4_character_size += 1; - case 0x01af: - byte_stream[ *byte_stream_index ] = 0xdd; - break; + return( 1 ); +} - case 0x01b0: - byte_stream[ *byte_stream_index ] = 0xfd; - break; +/* Copies an Unicode character from an UCS-4 string + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_copy_from_ucs4( + libuna_unicode_character_t *unicode_character, + const libuna_utf32_character_t *ucs4_string, + size_t ucs4_string_size, + size_t *ucs4_string_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_copy_from_ucs4"; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_ucs4_string_index = 0; - case 0x02c6: - byte_stream[ *byte_stream_index ] = 0x88; - break; + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); - case 0x02dc: - byte_stream[ *byte_stream_index ] = 0x98; - break; + return( -1 ); + } + if( ucs4_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-4 string.", + function ); - case 0x0300: - byte_stream[ *byte_stream_index ] = 0xcc; - break; + return( -1 ); + } + if( ucs4_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UCS-4 string size value exceeds maximum.", + function ); - case 0x0301: - byte_stream[ *byte_stream_index ] = 0xec; - break; + return( -1 ); + } + if( ucs4_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-4 string index.", + function ); - case 0x0303: - byte_stream[ *byte_stream_index ] = 0xde; - break; + return( -1 ); + } + safe_ucs4_string_index = *ucs4_string_index; - case 0x0309: - byte_stream[ *byte_stream_index ] = 0xd2; - break; + if( safe_ucs4_string_index >= ucs4_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UCS-4 string too small.", + function ); - case 0x0323: - byte_stream[ *byte_stream_index ] = 0xf2; - break; + return( -1 ); + } + safe_unicode_character = ucs4_string[ safe_ucs4_string_index ]; - case 0x2030: - byte_stream[ *byte_stream_index ] = 0x89; - break; + /* Determine if the Unicode character is valid + */ + if( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); - case 0x2039: - byte_stream[ *byte_stream_index ] = 0x8b; - break; + return( -1 ); + } + *unicode_character = safe_unicode_character; + *ucs4_string_index = safe_ucs4_string_index + 1; - case 0x203a: - byte_stream[ *byte_stream_index ] = 0x9b; - break; + return( 1 ); +} - case 0x20ab: - byte_stream[ *byte_stream_index ] = 0xfe; - break; +/* Copies an Unicode character into a UCS-4 string + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_copy_to_ucs4( + libuna_unicode_character_t unicode_character, + libuna_utf32_character_t *ucs4_string, + size_t ucs4_string_size, + size_t *ucs4_string_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_copy_to_ucs4"; + size_t safe_ucs4_string_index = 0; - case 0x20ac: - byte_stream[ *byte_stream_index ] = 0x80; - break; + if( ucs4_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-4 string.", + function ); - case 0x2122: - byte_stream[ *byte_stream_index ] = 0x99; - break; + return( -1 ); + } + if( ucs4_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UCS-4 string size value exceeds maximum.", + function ); - default: - byte_stream[ *byte_stream_index ] = 0x1a; - break; - } - *byte_stream_index += 1; + return( -1 ); + } + if( ucs4_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UCS-4 string index.", + function ); - break; + return( -1 ); + } + safe_ucs4_string_index = *ucs4_string_index; - default: - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported codepage: %d.", - function, - codepage ); + if( safe_ucs4_string_index >= ucs4_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UCS-4 string too small.", + function ); - return( -1 ); + return( -1 ); } - if( result != 1 ) + /* Determine if the Unicode character is valid + */ + if( unicode_character > LIBUNA_UCS_CHARACTER_MAX ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_COPY_FAILED, - "%s: unable to copy Unicode character to byte stream.", + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", function ); return( -1 ); } + ucs4_string[ safe_ucs4_string_index ] = (libuna_utf32_character_t) unicode_character; + + *ucs4_string_index = safe_ucs4_string_index + 1; + return( 1 ); } @@ -3013,9 +2676,18 @@ /* Determine if the Unicode character is valid */ - if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } /* The + character must be escaped */ @@ -3124,8 +2796,8 @@ { safe_utf7_stream_character_size += 4; number_of_bytes = 0; - current_byte = 0; - base64_triplet = 0; + current_byte = 0; + base64_triplet = 0; } unicode_character = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); } @@ -3193,16 +2865,17 @@ uint32_t *utf7_stream_base64_data, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_utf7_stream"; - libuna_utf16_character_t utf16_surrogate = 0; - size_t safe_utf7_stream_index = 0; - uint32_t base64_triplet = 0; - uint32_t safe_utf7_stream_base64_data = 0; - uint8_t byte_bit_shift = 0; - uint8_t current_byte = 0; - uint8_t number_of_bytes = 0; - uint8_t padding_size = 0; - uint8_t utf7_character_value = 0; + static char *function = "libuna_unicode_character_copy_from_utf7_stream"; + libuna_unicode_character_t safe_unicode_character = 0; + libuna_utf16_character_t utf16_surrogate = 0; + size_t safe_utf7_stream_index = 0; + uint32_t base64_triplet = 0; + uint32_t safe_utf7_stream_base64_data = 0; + uint8_t byte_bit_shift = 0; + uint8_t current_byte = 0; + uint8_t number_of_bytes = 0; + uint8_t padding_size = 0; + uint8_t utf7_character_value = 0; if( unicode_character == NULL ) { @@ -3248,31 +2921,31 @@ return( -1 ); } - if( *utf7_stream_index >= utf7_stream_size ) + if( utf7_stream_base64_data == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: UTF-7 stream too small.", + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-7 base64 data.", function ); return( -1 ); } - if( utf7_stream_base64_data == NULL ) + safe_utf7_stream_index = *utf7_stream_index; + safe_utf7_stream_base64_data = *utf7_stream_base64_data; + + if( safe_utf7_stream_index >= utf7_stream_size ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid UTF-7 base64 data.", + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-7 stream too small.", function ); return( -1 ); } - safe_utf7_stream_index = *utf7_stream_index; - safe_utf7_stream_base64_data = *utf7_stream_base64_data; - if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { base64_triplet = safe_utf7_stream_base64_data & 0x00ffffff; @@ -3360,9 +3033,9 @@ } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) == 0 ) { - *unicode_character = utf7_stream[ safe_utf7_stream_index++ ]; + safe_unicode_character = utf7_stream[ safe_utf7_stream_index++ ]; - if( ( *unicode_character == (libuna_unicode_character_t) '+' ) + if( ( safe_unicode_character == (libuna_unicode_character_t) '+' ) && ( utf7_stream[ safe_utf7_stream_index ] == (uint8_t) '-' ) ) { safe_utf7_stream_index++; @@ -3374,7 +3047,7 @@ if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, - utf7_stream_size, + utf7_stream_size - 1, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, @@ -3405,16 +3078,16 @@ } if( ( safe_utf7_stream_base64_data & LIBUNA_UTF7_IS_BASE64_ENCODED ) != 0 ) { - byte_bit_shift = 16 - ( current_byte * 8 ); - *unicode_character = ( ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL ) << 8; - current_byte += 1; + byte_bit_shift = 16 - ( current_byte * 8 ); + safe_unicode_character = ( ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL ) << 8; + current_byte += 1; if( current_byte >= number_of_bytes ) { if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, - utf7_stream_size, + utf7_stream_size - 1, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, @@ -3443,19 +3116,19 @@ number_of_bytes = 3 - padding_size; current_byte = 0; } - byte_bit_shift = 16 - ( current_byte * 8 ); - *unicode_character += ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL; - current_byte += 1; + byte_bit_shift = 16 - ( current_byte * 8 ); + safe_unicode_character += ( base64_triplet >> byte_bit_shift ) & 0x000000ffUL; + current_byte += 1; - if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) + if( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) { if( current_byte >= number_of_bytes ) { if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, - utf7_stream_size, + utf7_stream_size - 1, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, @@ -3493,7 +3166,7 @@ if( libuna_base64_triplet_copy_from_base64_stream( &base64_triplet, utf7_stream, - utf7_stream_size, + utf7_stream_size - 1, &safe_utf7_stream_index, &padding_size, LIBUNA_BASE64_VARIANT_UTF7, @@ -3531,14 +3204,21 @@ if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { - *unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; - *unicode_character <<= 10; - *unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END; - *unicode_character += 0x010000; + safe_unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; + safe_unicode_character <<= 10; + safe_unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START; + safe_unicode_character += 0x010000; } else { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported low surrogate UTF-16 character.", + function ); + + return( -1 ); } } if( safe_utf7_stream_index >= utf7_stream_size ) @@ -3567,6 +3247,7 @@ safe_utf7_stream_base64_data |= (uint32_t) number_of_bytes << 24; safe_utf7_stream_base64_data |= base64_triplet & 0x00ffffff; } + *unicode_character = safe_unicode_character; *utf7_stream_index = safe_utf7_stream_index; *utf7_stream_base64_data = safe_utf7_stream_base64_data; @@ -3651,9 +3332,18 @@ /* Determine if the Unicode character is valid */ - if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } /* A-Z is not a continous range on an EBCDIC based system * it consists of the ranges: A-I, J-R, S-Z @@ -3965,6 +3655,7 @@ } /* Determines the size of an UTF-8 character from an Unicode character + * This function supports upto U+10FFFF (4 byte UTF-8 characters) * Adds the size to the UTF-8 character size value * Returns 1 if successful or -1 on error */ @@ -3973,7 +3664,8 @@ size_t *utf8_character_size, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_size_to_utf8"; + static char *function = "libuna_unicode_character_size_to_utf8"; + size_t safe_utf8_character_size = 0; if( utf8_character_size == NULL ) { @@ -3986,55 +3678,47 @@ return( -1 ); } + /* Determine if the Unicode character is valid + */ + if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } + /* RFC 3629 limits the UTF-8 character to consist of a maximum of 4 bytes + * while its predecessor RFC 2279 allowed up to 6 bytes + */ if( unicode_character < 0x00000080UL ) { - *utf8_character_size += 1; + safe_utf8_character_size += 1; } else if( unicode_character < 0x00000800UL ) { - *utf8_character_size += 2; + safe_utf8_character_size += 2; } else if( unicode_character < 0x00010000UL ) { - *utf8_character_size += 3; - } - else if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) - { - *utf8_character_size += 3; + safe_utf8_character_size += 3; } else { - *utf8_character_size += 4; + safe_utf8_character_size += 4; } + *utf8_character_size += safe_utf8_character_size; -/* If UTF-8 USC support is needed it should be implemented in - * utf8_usc or something, but for now leave this here as a reminder - - else if( unicode_character < 0x010000 ) - { - *utf8_character_size += 3; - } - else if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) - { - *utf8_character_size += 2; - } - else if( unicode_character < 0x0200000 ) - { - *utf8_character_size += 4; - } - else if( unicode_character < 0x0400000 ) - { - *utf8_character_size += 5; - } - else - { - *utf8_character_size += 6; - } -*/ return( 1 ); } /* Copies an Unicode character from an UTF-8 string + * This function supports upto U+10FFFF (4 byte UTF-8 characters) * Returns 1 if successful or -1 on error */ int libuna_unicode_character_copy_from_utf8( @@ -4044,8 +3728,15 @@ size_t *utf8_string_index, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_utf8"; - uint8_t utf8_character_additional_bytes = 0; + static char *function = "libuna_unicode_character_copy_from_utf8"; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_utf8_string_index = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t byte_value4 = 0; + uint8_t utf8_character_additional_bytes = 0; + int result = 0; if( unicode_character == NULL ) { @@ -4091,7 +3782,9 @@ return( -1 ); } - if( *utf8_string_index >= utf8_string_size ) + safe_utf8_string_index = *utf8_string_index; + + if( safe_utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, @@ -4104,31 +3797,42 @@ } /* Determine the number of additional bytes of the UTF-8 character */ - if( utf8_string[ *utf8_string_index ] < 0xc0 ) + byte_value1 = utf8_string[ safe_utf8_string_index ]; + + /* Determine the UTF-8 character and make sure it is valid + * RFC 3629 limits the UTF-8 character to consist of a maximum of 4 bytes + * while its predecessor RFC 2279 allowed up to 6 bytes + */ + if( byte_value1 > 0xf4 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", + function, + byte_value1 ); + + return( -1 ); + } + if( byte_value1 < 0xc0 ) { utf8_character_additional_bytes = 0; } - else if( utf8_string[ *utf8_string_index ] < 0xe0 ) + else if( byte_value1 < 0xe0 ) { utf8_character_additional_bytes = 1; } - else if( utf8_string[ *utf8_string_index ] < 0xf0 ) + else if( byte_value1 < 0xf0 ) { utf8_character_additional_bytes = 2; } - else if( utf8_string[ *utf8_string_index ] < 0xf8 ) - { - utf8_character_additional_bytes = 3; - } - else if( utf8_string[ *utf8_string_index ] < 0xfc ) - { - utf8_character_additional_bytes = 4; - } else { - utf8_character_additional_bytes = 5; + utf8_character_additional_bytes = 3; } - if( ( *utf8_string_index + utf8_character_additional_bytes + 1 ) > utf8_string_size ) + if( ( ( (size_t) utf8_character_additional_bytes + 1 ) > utf8_string_size ) + || ( safe_utf8_string_index > ( utf8_string_size - ( utf8_character_additional_bytes + 1 ) ) ) ) { libcerror_error_set( error, @@ -4139,28 +3843,11 @@ return( -1 ); } - /* Determine the UTF-8 character and make sure it is valid - * Unicode limits the UTF-8 character to consist of a maximum of 4 bytes - * while ISO 10646 Universal Character Set (UCS) allows up to 6 bytes - */ - if( utf8_string[ *utf8_string_index ] > 0xf4 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", - function, - utf8_string[ *utf8_string_index ] ); - - return( -1 ); - } - *unicode_character = utf8_string[ *utf8_string_index ]; + safe_unicode_character = byte_value1; if( utf8_character_additional_bytes == 0 ) { - if( ( utf8_string[ *utf8_string_index ] >= 0x80 ) - && ( utf8_string[ *utf8_string_index ] < 0xc2 ) ) + if( byte_value1 >= 0x80 ) { libcerror_error_set( error, @@ -4168,14 +3855,17 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index ] ); + byte_value1 ); return( -1 ); } } if( utf8_character_additional_bytes >= 1 ) { - if( utf8_string[ *utf8_string_index + 1 ] > 0xbf ) + byte_value2 = utf8_string[ safe_utf8_string_index + 1 ]; + + if( ( byte_value2 < 0x80 ) + || ( byte_value2 > 0xbf ) ) { libcerror_error_set( error, @@ -4183,63 +3873,535 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 1 ] ); + byte_value2 ); return( -1 ); } - if( ( utf8_string[ *utf8_string_index ] == 0xe0 ) - && ( utf8_string[ *utf8_string_index + 1 ] < 0xa0 ) ) + result = 1; + + switch( byte_value1 ) + { + case 0xe0: + if( ( byte_value2 < 0xa0 ) + || ( byte_value2 > 0xbf ) ) + { + result = 0; + } + break; + + case 0xed: + if( ( byte_value2 < 0x80 ) + || ( byte_value2 > 0x9f ) ) + { + result = 0; + } + break; + + case 0xf0: + if( ( byte_value2 < 0x90 ) + || ( byte_value2 > 0xbf ) ) + { + result = 0; + } + break; + + case 0xf4: + if( ( byte_value2 < 0x80 ) + || ( byte_value2 > 0xbf ) ) + { + result = 0; + } + break; + + default: + break; + } + if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", + "%s: invalid 1st and 2nd UTF-8 character byte pair: 0x%02" PRIx8 " 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 1 ] ); + byte_value1, + byte_value2 ); return( -1 ); } - else if( ( utf8_string[ *utf8_string_index ] == 0xed ) - && ( utf8_string[ *utf8_string_index + 1 ] > 0x9f ) ) + safe_unicode_character <<= 6; + safe_unicode_character += byte_value2; + + if( utf8_character_additional_bytes == 1 ) + { + safe_unicode_character -= 0x03080; + } + } + if( utf8_character_additional_bytes >= 2 ) + { + byte_value3 = utf8_string[ safe_utf8_string_index + 2 ]; + + if( ( byte_value3 < 0x80 ) + || ( byte_value3 > 0xbf ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", + "%s: invalid 3rd UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 1 ] ); + byte_value3 ); return( -1 ); } - else if( ( utf8_string[ *utf8_string_index ] == 0xf0 ) - && ( utf8_string[ *utf8_string_index + 1 ] < 0x90 ) ) + result = 1; + + switch( byte_value2 ) + { + case 0xe0: + if( ( byte_value2 < 0xa0 ) + || ( byte_value2 > 0xbf ) ) + { + result = 0; + } + break; + + case 0xed: + if( ( byte_value2 < 0x80 ) + || ( byte_value2 > 0x9f ) ) + { + result = 0; + } + break; + + default: + break; + } + if( result == 0 ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", + "%s: invalid 2nd and 3rd UTF-8 character byte pair: 0x%02" PRIx8 " 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 1 ] ); + byte_value2, + byte_value3 ); return( -1 ); } - else if( ( utf8_string[ *utf8_string_index ] == 0xf4 ) - && ( utf8_string[ *utf8_string_index + 1 ] > 0x8f ) ) + safe_unicode_character <<= 6; + safe_unicode_character += byte_value3; + + if( utf8_character_additional_bytes == 2 ) + { + safe_unicode_character -= 0x0e2080; + } + } + if( utf8_character_additional_bytes >= 3 ) + { + byte_value4 = utf8_string[ safe_utf8_string_index + 3 ]; + + if( ( byte_value4 < 0x80 ) + || ( byte_value4 > 0xbf ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", + "%s: invalid 4th UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 1 ] ); + byte_value4 ); return( -1 ); } - else if( utf8_string[ *utf8_string_index + 1 ] < 0x80 ) + safe_unicode_character <<= 6; + safe_unicode_character += byte_value4; + + if( utf8_character_additional_bytes == 3 ) + { + safe_unicode_character -= 0x03c82080; + } + } + /* Determine if the Unicode character is valid + */ + if( ( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } + *unicode_character = safe_unicode_character; + *utf8_string_index = safe_utf8_string_index + 1 + utf8_character_additional_bytes; + + return( 1 ); +} + +/* Copies an Unicode character into a UTF-8 string + * This function supports upto U+10FFFF (4 byte UTF-8 characters) + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_copy_to_utf8( + libuna_unicode_character_t unicode_character, + libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + size_t *utf8_string_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_copy_to_utf8"; + size_t safe_utf8_string_index = 0; + size_t utf8_character_iterator = 0; + uint8_t utf8_character_additional_bytes = 0; + uint8_t utf8_first_character_mark = 0; + + if( utf8_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string.", + function ); + + return( -1 ); + } + if( utf8_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UTF-8 string size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf8_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string index.", + function ); + + return( -1 ); + } + safe_utf8_string_index = *utf8_string_index; + + if( safe_utf8_string_index >= utf8_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-8 string too small.", + function ); + + return( -1 ); + } + /* Determine if the Unicode character is valid + */ + if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } + /* Determine how many UTF-8 character bytes are required + */ + if( unicode_character < 0x080 ) + { + utf8_character_additional_bytes = 0; + utf8_first_character_mark = 0; + } + else if( unicode_character < 0x0800 ) + { + utf8_character_additional_bytes = 1; + utf8_first_character_mark = 0x0c0; + } + else if( unicode_character < 0x010000 ) + { + utf8_character_additional_bytes = 2; + utf8_first_character_mark = 0x0e0; + } + else + { + utf8_character_additional_bytes = 3; + utf8_first_character_mark = 0x0f0; + } + /* Convert Unicode character into UTF-8 character bytes + */ + if( ( utf8_character_additional_bytes > utf8_string_size ) + || ( safe_utf8_string_index >= ( utf8_string_size - utf8_character_additional_bytes ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-8 string too small.", + function ); + + return( -1 ); + } + for( utf8_character_iterator = safe_utf8_string_index + utf8_character_additional_bytes; + utf8_character_iterator > safe_utf8_string_index; + utf8_character_iterator-- ) + { + utf8_string[ utf8_character_iterator ] = (libuna_utf8_character_t) ( ( unicode_character & 0x0bf ) | 0x080 ); + + unicode_character >>= 6; + } + utf8_string[ safe_utf8_string_index ] = (libuna_utf8_character_t) ( unicode_character | utf8_first_character_mark ); + + *utf8_string_index = safe_utf8_string_index + 1 + utf8_character_additional_bytes; + + return( 1 ); +} + +/* Determines the size of an UTF-8 character from an Unicode character + * This function supports upto U+7FFFFFF (6 byte UTF-8 characters) + * Adds the size to the UTF-8 character size value + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_size_to_utf8_rfc2279( + libuna_unicode_character_t unicode_character, + size_t *utf8_character_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_size_to_utf8_rfc2279"; + size_t safe_utf8_character_size = 0; + + if( utf8_character_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 character size.", + function ); + + return( -1 ); + } + if( unicode_character > LIBUNA_UCS_CHARACTER_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } + /* RFC 3629 limits the UTF-8 character to consist of a maximum of 4 bytes + * while its predecessor RFC 2279 allowed up to 6 bytes + */ + if( unicode_character < 0x00000080UL ) + { + safe_utf8_character_size += 1; + } + else if( unicode_character < 0x00000800UL ) + { + safe_utf8_character_size += 2; + } + else if( unicode_character < 0x00010000UL ) + { + safe_utf8_character_size += 3; + } + else if( unicode_character < 0x00200000UL ) + { + safe_utf8_character_size += 4; + } + else if( unicode_character < 0x04000000UL ) + { + safe_utf8_character_size += 5; + } + else + { + safe_utf8_character_size += 6; + } + *utf8_character_size += safe_utf8_character_size; + + return( 1 ); +} + +/* Copies an Unicode character from an UTF-8 string + * This function supports upto U+7FFFFFF (6 byte UTF-8 characters) + * Returns 1 if successful or -1 on error + */ +int libuna_unicode_character_copy_from_utf8_rfc2279( + libuna_unicode_character_t *unicode_character, + const libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + size_t *utf8_string_index, + libcerror_error_t **error ) +{ + static char *function = "libuna_unicode_character_copy_from_utf8_rfc2279"; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_utf8_string_index = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t byte_value4 = 0; + uint8_t byte_value5 = 0; + uint8_t byte_value6 = 0; + uint8_t utf8_character_additional_bytes = 0; + + if( unicode_character == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid Unicode character.", + function ); + + return( -1 ); + } + if( utf8_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string.", + function ); + + return( -1 ); + } + if( utf8_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UTF-8 string size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf8_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string index.", + function ); + + return( -1 ); + } + safe_utf8_string_index = *utf8_string_index; + + if( safe_utf8_string_index >= utf8_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-8 string too small.", + function ); + + return( -1 ); + } + /* Determine the number of additional bytes of the UTF-8 character + */ + byte_value1 = utf8_string[ safe_utf8_string_index ]; + + /* Determine the UTF-8 character and make sure it is valid + * RFC 3629 limits the UTF-8 character to consist of a maximum of 4 bytes + * while its predecessor RFC 2279 allowed up to 6 bytes + */ + if( byte_value1 > 0xfd ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", + function, + byte_value1 ); + + return( -1 ); + } + if( byte_value1 < 0xc0 ) + { + utf8_character_additional_bytes = 0; + } + else if( byte_value1 < 0xe0 ) + { + utf8_character_additional_bytes = 1; + } + else if( byte_value1 < 0xf0 ) + { + utf8_character_additional_bytes = 2; + } + else if( byte_value1 < 0xf8 ) + { + utf8_character_additional_bytes = 3; + } + else if( byte_value1 < 0xfc ) + { + utf8_character_additional_bytes = 4; + } + else + { + utf8_character_additional_bytes = 5; + } + if( ( ( (size_t) utf8_character_additional_bytes + 1 ) > utf8_string_size ) + || ( safe_utf8_string_index > ( utf8_string_size - ( utf8_character_additional_bytes + 1 ) ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: missing UTF-8 character bytes.", + function ); + + return( -1 ); + } + /* Determine the UTF-8 character and make sure it is valid + * RFC 3629 limits the UTF-8 character to consist of a maximum of 4 bytes + * while its predecessor RFC 2279 allowed up to 6 bytes + */ + safe_unicode_character = byte_value1; + + if( utf8_character_additional_bytes == 0 ) + { + if( byte_value1 >= 0x80 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: invalid 1st UTF-8 character byte: 0x%02" PRIx8 ".", + function, + byte_value1 ); + + return( -1 ); + } + } + if( utf8_character_additional_bytes >= 1 ) + { + byte_value2 = utf8_string[ safe_utf8_string_index + 1 ]; + + if( ( byte_value2 < 0x80 ) + || ( byte_value2 > 0xbf ) ) { libcerror_error_set( error, @@ -4247,22 +4409,24 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 2nd UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 1 ] ); + byte_value2 ); return( -1 ); } - *unicode_character <<= 6; - *unicode_character += utf8_string[ *utf8_string_index + 1 ]; + safe_unicode_character <<= 6; + safe_unicode_character += byte_value2; if( utf8_character_additional_bytes == 1 ) { - *unicode_character -= 0x03080; + safe_unicode_character -= 0x03080; } } if( utf8_character_additional_bytes >= 2 ) { - if( ( utf8_string[ *utf8_string_index + 2 ] < 0x80 ) - || ( utf8_string[ *utf8_string_index + 2 ] > 0xbf ) ) + byte_value3 = utf8_string[ safe_utf8_string_index + 2 ]; + + if( ( byte_value3 < 0x80 ) + || ( byte_value3 > 0xbf ) ) { libcerror_error_set( error, @@ -4270,22 +4434,24 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 3rd UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 2 ] ); + byte_value3 ); return( -1 ); } - *unicode_character <<= 6; - *unicode_character += utf8_string[ *utf8_string_index + 2 ]; + safe_unicode_character <<= 6; + safe_unicode_character += byte_value3; if( utf8_character_additional_bytes == 2 ) { - *unicode_character -= 0x0e2080; + safe_unicode_character -= 0x0e2080; } } if( utf8_character_additional_bytes >= 3 ) { - if( ( utf8_string[ *utf8_string_index + 3 ] < 0x80 ) - || ( utf8_string[ *utf8_string_index + 3 ] > 0xbf ) ) + byte_value4 = utf8_string[ safe_utf8_string_index + 3 ]; + + if( ( byte_value4 < 0x80 ) + || ( byte_value4 > 0xbf ) ) { libcerror_error_set( error, @@ -4293,22 +4459,24 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 4th UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 3 ] ); + byte_value4 ); return( -1 ); } - *unicode_character <<= 6; - *unicode_character += utf8_string[ *utf8_string_index + 3 ]; + safe_unicode_character <<= 6; + safe_unicode_character += byte_value4; if( utf8_character_additional_bytes == 3 ) { - *unicode_character -= 0x03c82080; + safe_unicode_character -= 0x03c82080; } } if( utf8_character_additional_bytes >= 4 ) { - if( ( utf8_string[ *utf8_string_index + 4 ] < 0x80 ) - || ( utf8_string[ *utf8_string_index + 4 ] > 0xbf ) ) + byte_value5 = utf8_string[ safe_utf8_string_index + 4 ]; + + if( ( byte_value5 < 0x80 ) + || ( byte_value5 > 0xbf ) ) { libcerror_error_set( error, @@ -4316,22 +4484,24 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 5th UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 4 ] ); + byte_value5 ); return( -1 ); } - *unicode_character <<= 6; - *unicode_character += utf8_string[ *utf8_string_index + 4 ]; + safe_unicode_character <<= 6; + safe_unicode_character += byte_value5; if( utf8_character_additional_bytes == 4 ) { - *unicode_character -= 0x0fa082080; + safe_unicode_character -= 0x0fa082080; } } if( utf8_character_additional_bytes == 5 ) { - if( ( utf8_string[ *utf8_string_index + 5 ] < 0x80 ) - || ( utf8_string[ *utf8_string_index + 5 ] > 0xbf ) ) + byte_value6 = utf8_string[ safe_utf8_string_index + 5 ]; + + if( ( byte_value6 < 0x80 ) + || ( byte_value6 > 0xbf ) ) { libcerror_error_set( error, @@ -4339,38 +4509,48 @@ LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, "%s: invalid 6th UTF-8 character byte: 0x%02" PRIx8 ".", function, - utf8_string[ *utf8_string_index + 5 ] ); + byte_value6 ); return( -1 ); } - *unicode_character <<= 6; - *unicode_character += utf8_string[ *utf8_string_index + 5 ]; - *unicode_character -= 0x082082080; + safe_unicode_character <<= 6; + safe_unicode_character += byte_value6; + safe_unicode_character -= 0x082082080; } /* Determine if the Unicode character is valid */ - if( *unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + if( safe_unicode_character > LIBUNA_UCS_CHARACTER_MAX ) { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } - *utf8_string_index += 1 + utf8_character_additional_bytes; + *unicode_character = safe_unicode_character; + *utf8_string_index = safe_utf8_string_index + 1 + utf8_character_additional_bytes; return( 1 ); } /* Copies an Unicode character into a UTF-8 string + * This function supports upto U+7FFFFFF (6 byte UTF-8 characters) * Returns 1 if successful or -1 on error */ -int libuna_unicode_character_copy_to_utf8( +int libuna_unicode_character_copy_to_utf8_rfc2279( libuna_unicode_character_t unicode_character, libuna_utf8_character_t *utf8_string, size_t utf8_string_size, size_t *utf8_string_index, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_to_utf8"; + static char *function = "libuna_unicode_character_copy_to_utf8_rfc2279"; + size_t safe_utf8_string_index = 0; + size_t utf8_character_iterator = 0; uint8_t utf8_character_additional_bytes = 0; - uint8_t utf8_character_iterator = 0; uint8_t utf8_first_character_mark = 0; if( utf8_string == NULL ) @@ -4406,7 +4586,9 @@ return( -1 ); } - if( *utf8_string_index >= utf8_string_size ) + safe_utf8_string_index = *utf8_string_index; + + if( safe_utf8_string_index >= utf8_string_size ) { libcerror_error_set( error, @@ -4419,9 +4601,16 @@ } /* Determine if the Unicode character is valid */ - if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) + if( unicode_character > LIBUNA_UCS_CHARACTER_MAX ) { - unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } /* Determine how many UTF-8 character bytes are required */ @@ -4457,7 +4646,8 @@ } /* Convert Unicode character into UTF-8 character bytes */ - if( ( *utf8_string_index + utf8_character_additional_bytes ) >= utf8_string_size ) + if( ( utf8_character_additional_bytes > utf8_string_size ) + || ( safe_utf8_string_index >= ( utf8_string_size - utf8_character_additional_bytes ) ) ) { libcerror_error_set( error, @@ -4468,17 +4658,17 @@ return( -1 ); } - for( utf8_character_iterator = utf8_character_additional_bytes; - utf8_character_iterator > 0; + for( utf8_character_iterator = safe_utf8_string_index + utf8_character_additional_bytes; + utf8_character_iterator > safe_utf8_string_index; utf8_character_iterator-- ) { - utf8_string[ *utf8_string_index + utf8_character_iterator ] = (libuna_utf8_character_t) ( ( unicode_character & 0x0bf ) | 0x080 ); + utf8_string[ utf8_character_iterator ] = (libuna_utf8_character_t) ( ( unicode_character & 0x0bf ) | 0x080 ); unicode_character >>= 6; } - utf8_string[ *utf8_string_index ] = (libuna_utf8_character_t) ( unicode_character | utf8_first_character_mark ); + utf8_string[ safe_utf8_string_index ] = (libuna_utf8_character_t) ( unicode_character | utf8_first_character_mark ); - *utf8_string_index += 1 + utf8_character_additional_bytes; + *utf8_string_index = safe_utf8_string_index + 1 + utf8_character_additional_bytes; return( 1 ); } @@ -4505,8 +4695,20 @@ return( -1 ); } - if( ( unicode_character > LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) - && ( unicode_character <= LIBUNA_UTF16_CHARACTER_MAX ) ) + if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } + if( unicode_character > LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { *utf16_character_size += 2; } @@ -4527,8 +4729,10 @@ size_t *utf16_string_index, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_utf16"; - libuna_utf16_character_t utf16_surrogate = 0; + static char *function = "libuna_unicode_character_copy_from_utf16"; + libuna_unicode_character_t safe_unicode_character = 0; + libuna_utf16_character_t utf16_surrogate = 0; + size_t safe_utf16_string_index = 0; if( unicode_character == NULL ) { @@ -4574,7 +4778,9 @@ return( -1 ); } - if( *utf16_string_index >= utf16_string_size ) + safe_utf16_string_index = *utf16_string_index; + + if( safe_utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, @@ -4585,15 +4791,15 @@ return( -1 ); } - *unicode_character = utf16_string[ *utf16_string_index ]; - *utf16_string_index += 1; + safe_unicode_character = utf16_string[ safe_utf16_string_index ]; + safe_utf16_string_index += 1; /* Determine if the UTF-16 character is within the high surrogate range */ - if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) + if( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) { - if( *utf16_string_index >= utf16_string_size ) + if( safe_utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, @@ -4604,31 +4810,49 @@ return( -1 ); } - utf16_surrogate = utf16_string[ *utf16_string_index ]; - *utf16_string_index += 1; + utf16_surrogate = utf16_string[ safe_utf16_string_index ]; + safe_utf16_string_index += 1; /* Determine if the UTF-16 character is within the low surrogate range */ if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { - *unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; - *unicode_character <<= 10; - *unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END; - *unicode_character += 0x010000; + safe_unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; + safe_unicode_character <<= 10; + safe_unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START; + safe_unicode_character += 0x010000; } else { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported low surrogate UTF-16 character.", + function ); + + return( -1 ); } } /* Determine if the Unicode character is valid */ - else if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) - && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + if( ( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } + *unicode_character = safe_unicode_character; + *utf16_string_index = safe_utf16_string_index; + return( 1 ); } @@ -4642,7 +4866,8 @@ size_t *utf16_string_index, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_to_utf16"; + static char *function = "libuna_unicode_character_copy_to_utf16"; + size_t safe_utf16_string_index = 0; if( utf16_string == NULL ) { @@ -4677,7 +4902,9 @@ return( -1 ); } - if( *utf16_string_index >= utf16_string_size ) + safe_utf16_string_index = *utf16_string_index; + + if( safe_utf16_string_index >= utf16_string_size ) { libcerror_error_set( error, @@ -4691,20 +4918,26 @@ /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) - || ( unicode_character > LIBUNA_UTF16_CHARACTER_MAX ) ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } if( unicode_character <= LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { - utf16_string[ *utf16_string_index ] = (libuna_utf16_character_t) unicode_character; - - *utf16_string_index += 1; + utf16_string[ safe_utf16_string_index++ ] = (libuna_utf16_character_t) unicode_character; } else { - if( ( *utf16_string_index + 1 ) >= utf16_string_size ) + if( ( utf16_string_size < 2 ) + || ( safe_utf16_string_index > ( utf16_string_size - 2 ) ) ) { libcerror_error_set( error, @@ -4715,12 +4948,12 @@ return( -1 ); } - unicode_character -= 0x010000; - utf16_string[ *utf16_string_index ] = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); - utf16_string[ *utf16_string_index + 1 ] = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); - - *utf16_string_index += 2; + unicode_character -= 0x010000; + utf16_string[ safe_utf16_string_index++ ] = (libuna_utf16_character_t) ( ( unicode_character >> 10 ) + LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ); + utf16_string[ safe_utf16_string_index++ ] = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); } + *utf16_string_index = safe_utf16_string_index; + return( 1 ); } @@ -4735,8 +4968,11 @@ int byte_order, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_utf16_stream"; - libuna_utf16_character_t utf16_surrogate = 0; + static char *function = "libuna_unicode_character_copy_from_utf16_stream"; + libuna_unicode_character_t safe_unicode_character = 0; + libuna_utf16_character_t utf16_surrogate = 0; + size_t safe_utf16_stream_index = 0; + int byte_order_without_flags = 0; if( unicode_character == NULL ) { @@ -4782,95 +5018,137 @@ return( -1 ); } - if( ( *utf16_stream_index + 1 ) >= utf16_stream_size ) + byte_order_without_flags = byte_order & 0xff; + + if( ( byte_order_without_flags != LIBUNA_ENDIAN_BIG ) + && ( byte_order_without_flags != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: UTF-16 stream too small.", + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported byte order.", function ); return( -1 ); } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) + safe_utf16_stream_index = *utf16_stream_index; + + if( ( utf16_stream_size < 2 ) + || ( safe_utf16_stream_index > ( utf16_stream_size - 2 ) ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-16 stream too small.", function ); return( -1 ); } - if( byte_order == LIBUNA_ENDIAN_BIG ) + if( byte_order_without_flags == LIBUNA_ENDIAN_BIG ) { - *unicode_character = utf16_stream[ *utf16_stream_index ]; - *unicode_character <<= 8; - *unicode_character += utf16_stream[ *utf16_stream_index + 1 ]; + safe_unicode_character = utf16_stream[ safe_utf16_stream_index ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf16_stream[ safe_utf16_stream_index + 1 ]; } - else if( byte_order == LIBUNA_ENDIAN_LITTLE ) + else if( byte_order_without_flags == LIBUNA_ENDIAN_LITTLE ) { - *unicode_character = utf16_stream[ *utf16_stream_index + 1 ]; - *unicode_character <<= 8; - *unicode_character += utf16_stream[ *utf16_stream_index ]; + safe_unicode_character = utf16_stream[ safe_utf16_stream_index + 1 ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf16_stream[ safe_utf16_stream_index ]; } - *utf16_stream_index += 2; + safe_utf16_stream_index += 2; - /* Determine if the UTF-16 character is within the high surrogate range + /* Determine if the Unicode character is valid */ - if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) + if( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { - if( ( *utf16_stream_index + 1 ) >= utf16_stream_size ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: missing surrogate UTF-16 character bytes.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported UTF-16 character.", function ); return( -1 ); } - if( byte_order == LIBUNA_ENDIAN_BIG ) - { - utf16_surrogate = utf16_stream[ *utf16_stream_index ]; - utf16_surrogate <<= 8; - utf16_surrogate += utf16_stream[ *utf16_stream_index + 1 ]; - } - else if( byte_order == LIBUNA_ENDIAN_LITTLE ) + } + /* Determine if the UTF-16 character is within the high surrogate range + */ + if( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_END ) ) + { + if( safe_utf16_stream_index > ( utf16_stream_size - 2 ) ) { - utf16_surrogate = utf16_stream[ *utf16_stream_index + 1 ]; - utf16_surrogate <<= 8; - utf16_surrogate += utf16_stream[ *utf16_stream_index ]; - } - *utf16_stream_index += 2; + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: missing surrogate UTF-16 character bytes.", + function ); - /* Determine if the UTF-16 character is within the low surrogate range - */ - if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) - && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) - { - *unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; - *unicode_character <<= 10; - *unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END; - *unicode_character += 0x010000; + return( -1 ); + } } else { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + if( byte_order_without_flags == LIBUNA_ENDIAN_BIG ) + { + utf16_surrogate = utf16_stream[ safe_utf16_stream_index ]; + utf16_surrogate <<= 8; + utf16_surrogate += utf16_stream[ safe_utf16_stream_index + 1 ]; + } + else if( byte_order_without_flags == LIBUNA_ENDIAN_LITTLE ) + { + utf16_surrogate = utf16_stream[ safe_utf16_stream_index + 1 ]; + utf16_surrogate <<= 8; + utf16_surrogate += utf16_stream[ safe_utf16_stream_index ]; + } + /* Determine if the UTF-16 character is within the low surrogate range + */ + if( ( utf16_surrogate >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) + && ( utf16_surrogate <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + { + safe_unicode_character -= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START; + safe_unicode_character <<= 10; + safe_unicode_character += utf16_surrogate - LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START; + safe_unicode_character += 0x010000; + + safe_utf16_stream_index += 2; + } + else if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported low surrogate UTF-16 character.", + function ); + + return( -1 ); + } } } - /* Determine if the Unicode character is valid - */ - else if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) - && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + if( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } + *unicode_character = safe_unicode_character; + *utf16_stream_index = safe_utf16_stream_index; + return( 1 ); } @@ -4887,6 +5165,8 @@ { static char *function = "libuna_unicode_character_copy_to_utf16_stream"; libuna_utf16_character_t utf16_surrogate = 0; + size_t safe_utf16_stream_index = 0; + int byte_order_without_flags = 0; if( utf16_stream == NULL ) { @@ -4921,56 +5201,82 @@ return( -1 ); } - if( ( *utf16_stream_index + 1 ) >= utf16_stream_size ) + byte_order_without_flags = byte_order & 0xff; + + if( ( byte_order_without_flags != LIBUNA_ENDIAN_BIG ) + && ( byte_order_without_flags != LIBUNA_ENDIAN_LITTLE ) ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: UTF-16 stream too small.", + LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported byte order.", function ); return( -1 ); } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) + safe_utf16_stream_index = *utf16_stream_index; + + /* Determine if the Unicode character is valid + */ + if( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) { libcerror_error_set( error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", function ); return( -1 ); } - /* Determine if the Unicode character is valid - */ - if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) - || ( unicode_character > LIBUNA_UTF16_CHARACTER_MAX ) ) + if( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) { - unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } } if( unicode_character <= LIBUNA_UNICODE_BASIC_MULTILINGUAL_PLANE_MAX ) { + if( ( utf16_stream_size < 2 ) + || ( safe_utf16_stream_index > ( utf16_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-16 stream too small.", + function ); + + return( -1 ); + } if( byte_order == LIBUNA_ENDIAN_BIG ) { - utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf16_stream[ *utf16_stream_index ] = (uint8_t) ( unicode_character & 0xff ); + utf16_stream[ safe_utf16_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf16_stream[ safe_utf16_stream_index ] = (uint8_t) ( unicode_character & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { - utf16_stream[ *utf16_stream_index ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); + utf16_stream[ safe_utf16_stream_index ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf16_stream[ safe_utf16_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); } - *utf16_stream_index += 2; + safe_utf16_stream_index += 2; } else { - if( ( *utf16_stream_index + 3 ) >= utf16_stream_size ) + if( ( utf16_stream_size < 4 ) + || ( safe_utf16_stream_index > ( utf16_stream_size - 4 ) ) ) { libcerror_error_set( error, @@ -4987,34 +5293,36 @@ if( byte_order == LIBUNA_ENDIAN_BIG ) { - utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); - utf16_surrogate >>= 8; - utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_stream[ safe_utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_surrogate >>= 8; + utf16_stream[ safe_utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { - utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); - utf16_surrogate >>= 8; - utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_stream[ safe_utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_surrogate >>= 8; + utf16_stream[ safe_utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); } - *utf16_stream_index += 2; + safe_utf16_stream_index += 2; utf16_surrogate = (libuna_utf16_character_t) ( ( unicode_character & 0x03ff ) + LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ); if( byte_order == LIBUNA_ENDIAN_BIG ) { - utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); - utf16_surrogate >>= 8; - utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_stream[ safe_utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_surrogate >>= 8; + utf16_stream[ safe_utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { - utf16_stream[ *utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); - utf16_surrogate >>= 8; - utf16_stream[ *utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_stream[ safe_utf16_stream_index ] = (uint8_t) ( utf16_surrogate & 0xff ); + utf16_surrogate >>= 8; + utf16_stream[ safe_utf16_stream_index + 1 ] = (uint8_t) ( utf16_surrogate & 0xff ); } - *utf16_stream_index += 2; + safe_utf16_stream_index += 2; } + *utf16_stream_index = safe_utf16_stream_index; + return( 1 ); } @@ -5023,7 +5331,7 @@ * Returns 1 if successful or -1 on error */ int libuna_unicode_character_size_to_utf32( - libuna_unicode_character_t unicode_character LIBUNA_ATTRIBUTE_UNUSED, + libuna_unicode_character_t unicode_character, size_t *utf32_character_size, libcerror_error_t **error ) { @@ -5042,6 +5350,19 @@ return( -1 ); } + if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); + } *utf32_character_size += 1; return( 1 ); @@ -5057,7 +5378,9 @@ size_t *utf32_string_index, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_utf32"; + static char *function = "libuna_unicode_character_copy_from_utf32"; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_utf32_string_index = 0; if( unicode_character == NULL ) { @@ -5103,7 +5426,9 @@ return( -1 ); } - if( *utf32_string_index >= utf32_string_size ) + safe_utf32_string_index = *utf32_string_index; + + if( safe_utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, @@ -5114,18 +5439,25 @@ return( -1 ); } + safe_unicode_character = utf32_string[ safe_utf32_string_index ]; + /* Determine if the Unicode character is valid */ - if( ( utf32_string[ *utf32_string_index ] >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) - && ( utf32_string[ *utf32_string_index ] <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) - { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; - } - else + if( ( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - *unicode_character = utf32_string[ *utf32_string_index ]; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } - *utf32_string_index += 1; + *unicode_character = safe_unicode_character; + *utf32_string_index = safe_utf32_string_index + 1; return( 1 ); } @@ -5140,7 +5472,8 @@ size_t *utf32_string_index, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_to_utf32"; + static char *function = "libuna_unicode_character_copy_to_utf32"; + size_t safe_utf32_string_index = 0; if( utf32_string == NULL ) { @@ -5175,7 +5508,9 @@ return( -1 ); } - if( *utf32_string_index >= utf32_string_size ) + safe_utf32_string_index = *utf32_string_index; + + if( safe_utf32_string_index >= utf32_string_size ) { libcerror_error_set( error, @@ -5189,16 +5524,21 @@ /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) - || ( unicode_character > LIBUNA_UTF32_CHARACTER_MAX ) ) - { - utf32_string[ *utf32_string_index ] = (libuna_utf32_character_t) LIBUNA_UNICODE_REPLACEMENT_CHARACTER; - } - else + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - utf32_string[ *utf32_string_index ] = (libuna_utf32_character_t) unicode_character; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } - *utf32_string_index += 1; + utf32_string[ safe_utf32_string_index ] = (libuna_utf32_character_t) unicode_character; + + *utf32_string_index = safe_utf32_string_index + 1; return( 1 ); } @@ -5214,7 +5554,9 @@ int byte_order, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_from_utf32_stream"; + static char *function = "libuna_unicode_character_copy_from_utf32_stream"; + libuna_unicode_character_t safe_unicode_character = 0; + size_t safe_utf32_stream_index = 0; if( unicode_character == NULL ) { @@ -5260,7 +5602,10 @@ return( -1 ); } - if( ( *utf32_stream_index + 3 ) >= utf32_stream_size ) + safe_utf32_stream_index = *utf32_stream_index; + + if( ( utf32_stream_size < 4 ) + || ( safe_utf32_stream_index > ( utf32_stream_size - 4 ) ) ) { libcerror_error_set( error, @@ -5285,32 +5630,41 @@ } if( byte_order == LIBUNA_ENDIAN_BIG ) { - *unicode_character = utf32_stream[ *utf32_stream_index ]; - *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 1 ]; - *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 2 ]; - *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 3 ]; + safe_unicode_character = utf32_stream[ safe_utf32_stream_index ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf32_stream[ safe_utf32_stream_index + 1 ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf32_stream[ safe_utf32_stream_index + 2 ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf32_stream[ safe_utf32_stream_index + 3 ]; } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { - *unicode_character = utf32_stream[ *utf32_stream_index + 3 ]; - *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 2 ]; - *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 1 ]; - *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index ]; + safe_unicode_character = utf32_stream[ safe_utf32_stream_index + 3 ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf32_stream[ safe_utf32_stream_index + 2 ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf32_stream[ safe_utf32_stream_index + 1 ]; + safe_unicode_character <<= 8; + safe_unicode_character += utf32_stream[ safe_utf32_stream_index ]; } /* Determine if the Unicode character is valid */ - if( ( *unicode_character >= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_START ) - && ( *unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + if( ( ( safe_unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) + && ( safe_unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( safe_unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - *unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } - *utf32_stream_index += 4; + *unicode_character = safe_unicode_character; + *utf32_stream_index = safe_utf32_stream_index + 4; return( 1 ); } @@ -5326,7 +5680,8 @@ int byte_order, libcerror_error_t **error ) { - static char *function = "libuna_unicode_character_copy_to_utf32_stream"; + static char *function = "libuna_unicode_character_copy_to_utf32_stream"; + size_t safe_utf32_stream_index = 0; if( utf32_stream == NULL ) { @@ -5361,7 +5716,10 @@ return( -1 ); } - if( ( *utf32_stream_index + 3 ) >= utf32_stream_size ) + safe_utf32_stream_index = *utf32_stream_index; + + if( ( utf32_stream_size < 4 ) + || ( safe_utf32_stream_index > ( utf32_stream_size - 4 ) ) ) { libcerror_error_set( error, @@ -5387,32 +5745,39 @@ /* Determine if the Unicode character is valid */ if( ( ( unicode_character >= LIBUNA_UNICODE_SURROGATE_HIGH_RANGE_START ) - && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) - || ( unicode_character > LIBUNA_UTF32_CHARACTER_MAX ) ) + && ( unicode_character <= LIBUNA_UNICODE_SURROGATE_LOW_RANGE_END ) ) + || ( unicode_character > LIBUNA_UNICODE_CHARACTER_MAX ) ) { - unicode_character = LIBUNA_UNICODE_REPLACEMENT_CHARACTER; + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported Unicode character.", + function ); + + return( -1 ); } if( byte_order == LIBUNA_ENDIAN_BIG ) { - utf32_stream[ *utf32_stream_index + 3 ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf32_stream[ *utf32_stream_index + 2 ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf32_stream[ *utf32_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf32_stream[ *utf32_stream_index ] = (uint8_t) ( unicode_character & 0xff ); + utf32_stream[ safe_utf32_stream_index + 3 ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf32_stream[ safe_utf32_stream_index + 2 ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf32_stream[ safe_utf32_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf32_stream[ safe_utf32_stream_index ] = (uint8_t) ( unicode_character & 0xff ); } else if( byte_order == LIBUNA_ENDIAN_LITTLE ) { - utf32_stream[ *utf32_stream_index ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf32_stream[ *utf32_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf32_stream[ *utf32_stream_index + 2 ] = (uint8_t) ( unicode_character & 0xff ); - unicode_character >>= 8; - utf32_stream[ *utf32_stream_index + 3 ] = (uint8_t) ( unicode_character & 0xff ); + utf32_stream[ safe_utf32_stream_index ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf32_stream[ safe_utf32_stream_index + 1 ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf32_stream[ safe_utf32_stream_index + 2 ] = (uint8_t) ( unicode_character & 0xff ); + unicode_character >>= 8; + utf32_stream[ safe_utf32_stream_index + 3 ] = (uint8_t) ( unicode_character & 0xff ); } - *utf32_stream_index += 4; + *utf32_stream_index = safe_utf32_stream_index + 4; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_unicode_character.h libbde-20240223/libuna/libuna_unicode_character.h --- libbde-20190102/libuna/libuna_unicode_character.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_unicode_character.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,26 +1,26 @@ /* * Unicode character functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBUNA_UNICDODE_CHARACTER_H ) -#define _LIBUNA_UNICDODE_CHARACTER_H +#if !defined( _LIBUNA_UNICODE_CHARACTER_H ) +#define _LIBUNA_UNICODE_CHARACTER_H #include #include @@ -60,6 +60,50 @@ libcerror_error_t **error ); LIBUNA_EXTERN \ +int libuna_unicode_character_size_to_ucs2( + libuna_unicode_character_t unicode_character, + size_t *ucs2_character_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_copy_from_ucs2( + libuna_unicode_character_t *unicode_character, + const libuna_utf16_character_t *ucs2_string, + size_t ucs2_string_size, + size_t *ucs2_string_index, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_copy_to_ucs2( + libuna_unicode_character_t unicode_character, + libuna_utf16_character_t *ucs2_string, + size_t ucs2_string_size, + size_t *ucs2_string_index, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_size_to_ucs4( + libuna_unicode_character_t unicode_character, + size_t *ucs4_character_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_copy_from_ucs4( + libuna_unicode_character_t *unicode_character, + const libuna_utf32_character_t *ucs4_string, + size_t ucs4_string_size, + size_t *ucs4_string_index, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_copy_to_ucs4( + libuna_unicode_character_t unicode_character, + libuna_utf32_character_t *ucs4_string, + size_t ucs4_string_size, + size_t *ucs4_string_index, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ int libuna_unicode_character_size_to_utf7_stream( libuna_unicode_character_t unicode_character, size_t *utf7_stream_character_size, @@ -107,6 +151,28 @@ libcerror_error_t **error ); LIBUNA_EXTERN \ +int libuna_unicode_character_size_to_utf8_rfc2279( + libuna_unicode_character_t unicode_character, + size_t *utf8_character_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_copy_from_utf8_rfc2279( + libuna_unicode_character_t *unicode_character, + const libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + size_t *utf8_string_index, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_unicode_character_copy_to_utf8_rfc2279( + libuna_unicode_character_t unicode_character, + libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + size_t *utf8_string_index, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ int libuna_unicode_character_size_to_utf16( libuna_unicode_character_t unicode_character, size_t *utf16_character_size, @@ -190,5 +256,5 @@ } #endif -#endif /* !defined( _LIBUNA_UNICDODE_CHARACTER_H ) */ +#endif /* !defined( _LIBUNA_UNICODE_CHARACTER_H ) */ diff -Nru libbde-20190102/libuna/libuna_unused.h libbde-20240223/libuna/libuna_unused.h --- libbde-20190102/libuna/libuna_unused.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_unused.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,26 +1,26 @@ /* - * The internal unused definition + * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ -#if !defined( _LIBUNA_INTERNAL_UNUSED_H ) -#define _LIBUNA_INTERNAL_UNUSED_H +#if !defined( _LIBUNA_UNUSED_H ) +#define _LIBUNA_UNUSED_H #include @@ -40,5 +40,5 @@ /* parameter */ #endif -#endif /* !defined( _LIBUNA_INTERNAL_UNUSED_H ) */ +#endif /* !defined( _LIBUNA_UNUSED_H ) */ diff -Nru libbde-20190102/libuna/libuna_url_stream.c libbde-20240223/libuna/libuna_url_stream.c --- libbde-20190102/libuna/libuna_url_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_url_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Percent or URL encoded stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_url_stream.h libbde-20240223/libuna/libuna_url_stream.h --- libbde-20190102/libuna/libuna_url_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_url_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * Percent or URL encoded stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_URL_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_utf16_stream.c libbde-20240223/libuna/libuna_utf16_stream.c --- libbde-20190102/libuna/libuna_utf16_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf16_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-16 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -122,6 +122,7 @@ { static char *function = "libuna_utf16_stream_size_from_utf8"; libuna_unicode_character_t unicode_character = 0; + size_t safe_utf16_stream_size = 0; size_t utf8_string_index = 0; if( utf8_string == NULL ) @@ -159,7 +160,7 @@ } /* Add the byte order mark */ - *utf16_stream_size = 1; + safe_utf16_stream_size = 1; while( utf8_string_index < utf8_string_size ) { @@ -185,7 +186,7 @@ */ if( libuna_unicode_character_size_to_utf16( unicode_character, - utf16_stream_size, + &safe_utf16_stream_size, error ) != 1 ) { libcerror_error_set( @@ -204,7 +205,7 @@ } /* Convert the number of characters into bytes */ - *utf16_stream_size *= 2; + *utf16_stream_size = safe_utf16_stream_size * 2; return( 1 ); } @@ -355,6 +356,7 @@ { static char *function = "libuna_utf16_stream_size_from_utf16"; libuna_unicode_character_t unicode_character = 0; + size_t safe_utf16_stream_size = 0; size_t utf16_string_index = 0; if( utf16_string == NULL ) @@ -392,7 +394,7 @@ } /* Add the byte order mark */ - *utf16_stream_size = 1; + safe_utf16_stream_size = 1; while( utf16_string_index < utf16_string_size ) { @@ -418,7 +420,7 @@ */ if( libuna_unicode_character_size_to_utf16( unicode_character, - utf16_stream_size, + &safe_utf16_stream_size, error ) != 1 ) { libcerror_error_set( @@ -437,7 +439,7 @@ } /* Convert the number of characters into bytes */ - *utf16_stream_size *= 2; + *utf16_stream_size = safe_utf16_stream_size * 2; return( 1 ); } @@ -588,6 +590,7 @@ { static char *function = "libuna_utf16_stream_size_from_utf32"; libuna_unicode_character_t unicode_character = 0; + size_t safe_utf16_stream_size = 0; size_t utf32_string_index = 0; if( utf32_string == NULL ) @@ -625,7 +628,7 @@ } /* Add the byte order mark */ - *utf16_stream_size += 1; + safe_utf16_stream_size += 1; while( utf32_string_index < utf32_string_size ) { @@ -651,7 +654,7 @@ */ if( libuna_unicode_character_size_to_utf16( unicode_character, - utf16_stream_size, + &safe_utf16_stream_size, error ) != 1 ) { libcerror_error_set( @@ -670,7 +673,7 @@ } /* Convert the number of characters into bytes */ - *utf16_stream_size *= 2; + *utf16_stream_size = safe_utf16_stream_size * 2; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_utf16_stream.h libbde-20240223/libuna/libuna_utf16_stream.h --- libbde-20190102/libuna/libuna_utf16_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf16_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-16 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF16_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_utf16_string.c libbde-20240223/libuna/libuna_utf16_string.c --- libbde-20190102/libuna/libuna_utf16_string.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf16_string.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-16 string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -24,6 +24,7 @@ #include "libuna_definitions.h" #include "libuna_libcerror.h" +#include "libuna_scsu.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf16_string.h" @@ -118,6 +119,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -284,6 +289,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -379,13 +388,15 @@ return( -1 ); } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } /* Check if the byte stream is terminated with zero bytes */ - if( byte_stream[ byte_stream_size - 1 ] == 0 ) + if( ( byte_stream_size >= 1 ) + && ( byte_stream[ byte_stream_size - 1 ] == 0 ) ) { byte_stream_size -= 1; } @@ -541,6 +552,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -705,6 +720,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -800,13 +819,15 @@ return( -1 ); } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } /* Check if the UTF-7 stream is terminated with zero bytes */ - if( utf7_stream[ utf7_stream_size - 1 ] == 0 ) + if( ( utf7_stream_size >= 1 ) + && ( utf7_stream[ utf7_stream_size - 1 ] == 0 ) ) { utf7_stream_size -= 1; } @@ -960,6 +981,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1122,6 +1147,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1244,6 +1273,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1417,6 +1450,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1522,13 +1559,15 @@ utf8_stream_index += 3; } } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } /* Check if the UTF-8 stream is terminated with zero bytes */ - if( utf8_stream[ utf8_stream_size - 1 ] == 0 ) + if( ( utf8_stream_size >= 1 ) + && ( utf8_stream[ utf8_stream_size - 1 ] == 0 ) ) { utf8_stream_size -= 1; } @@ -1604,9 +1643,10 @@ libcerror_error_t **error ) { static char *function = "libuna_utf16_string_size_from_utf16_stream"; - size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; + size_t utf16_stream_index = 0; int read_byte_order = 0; + int result = 0; if( utf16_stream == NULL ) { @@ -1679,18 +1719,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character @@ -1714,10 +1742,21 @@ } /* Determine how many UTF-16 character bytes are required */ - if( libuna_unicode_character_size_to_utf16( - unicode_character, - utf16_string_size, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_size_to_utf16( + unicode_character, + utf16_string_size, + error ); + } + else + { + result = libuna_unicode_character_size_to_ucs2( + unicode_character, + utf16_string_size, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -1728,6 +1767,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1786,9 +1829,10 @@ libcerror_error_t **error ) { static char *function = "libuna_utf16_string_with_index_copy_from_utf16_stream"; - size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; + size_t utf16_stream_index = 0; int read_byte_order = 0; + int result = 0; if( utf16_string == NULL ) { @@ -1878,18 +1922,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character @@ -1913,12 +1945,25 @@ } /* Convert the Unicode character into UTF-16 character bytes */ - if( libuna_unicode_character_copy_to_utf16( - unicode_character, - utf16_string, - utf16_string_size, - utf16_string_index, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_copy_to_utf16( + unicode_character, + utf16_string, + utf16_string_size, + utf16_string_index, + error ); + } + else + { + result = libuna_unicode_character_copy_to_ucs2( + unicode_character, + utf16_string, + utf16_string_size, + utf16_string_index, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -1929,6 +1974,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1964,11 +2013,12 @@ libcerror_error_t **error ) { static char *function = "libuna_utf16_string_compare_with_utf16_stream"; + libuna_unicode_character_t utf16_stream_unicode_character = 0; + libuna_unicode_character_t utf16_unicode_character = 0; size_t utf16_stream_index = 0; size_t utf16_string_index = 0; - libuna_unicode_character_t utf16_unicode_character = 0; - libuna_unicode_character_t utf16_stream_unicode_character = 0; int read_byte_order = 0; + int result = 0; if( utf16_string == NULL ) { @@ -2047,25 +2097,15 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } /* Check if the UTF-16 stream is terminated with zero bytes */ - if( ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) + if( ( utf16_stream_size >= 2 ) + && ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) && ( utf16_stream[ utf16_stream_size - 1 ] == 0 ) ) { utf16_stream_size -= 2; @@ -2075,12 +2115,25 @@ { /* Convert the UTF-16 character bytes into an Unicode character */ - if( libuna_unicode_character_copy_from_utf16( - &utf16_unicode_character, - utf16_string, - utf16_string_size, - &utf16_string_index, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_copy_from_utf16( + &utf16_unicode_character, + utf16_string, + utf16_string_size, + &utf16_string_index, + error ); + } + else + { + result = libuna_unicode_character_copy_from_ucs2( + &utf16_unicode_character, + utf16_string, + utf16_string_size, + &utf16_string_index, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -2220,6 +2273,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2382,6 +2439,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2476,13 +2537,15 @@ return( -1 ); } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } - if( utf32_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { - utf16_string_size -= 1; + utf32_string_size -= 1; } while( ( utf16_string_index < utf16_string_size ) && ( utf32_string_index < utf32_string_size ) ) @@ -2635,18 +2698,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character @@ -2684,6 +2735,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2838,18 +2893,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character @@ -2889,6 +2932,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -3011,25 +3058,15 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } /* Check if the UTF-32 stream is terminated with zero bytes */ - if( ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) + if( ( utf32_stream_size >= 4 ) + && ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 3 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 2 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 1 ] == 0 ) ) @@ -3098,3 +3135,816 @@ return( LIBUNA_COMPARE_EQUAL ); } +/* Determines the size of an UTF-16 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf16_string_size_from_scsu_stream( + const uint8_t *scsu_stream, + size_t scsu_stream_size, + size_t *utf16_string_size, + libcerror_error_t **error ) +{ + uint32_t scsu_dynamic_window_positions[ 8 ] = { + 0x0080, 0x00c0, 0x0400, 0x0600, 0x0900, 0x3040, 0x30a0, 0xff00 }; + + static char *function = "libuna_utf8_string_size_from_scsu_stream"; + libuna_unicode_character_t unicode_character = 0; + size_t scsu_stream_index = 0; + uint32_t scsu_window_position = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t dynamic_window_position_index = 0; + uint8_t in_unicode_mode = 0; + uint8_t unicode_character_set = 0; + + if( scsu_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid SCSU stream.", + function ); + + return( -1 ); + } + if( scsu_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid SCSU stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf16_string_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-16 string size.", + function ); + + return( -1 ); + } + *utf16_string_size = 0; + + if( scsu_stream_size == 0 ) + { + return( 1 ); + } + while( scsu_stream_index < scsu_stream_size ) + { + unicode_character_set = 0; + + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value1 = scsu_stream[ scsu_stream_index++ ]; + + if( in_unicode_mode != 0 ) + { + if( ( byte_value1 <= 0xdf ) + || ( byte_value1 >= 0xf3 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value1; + unicode_character <<= 8; + unicode_character |= byte_value2; + + unicode_character_set = 1; + } + /* UCn tags + */ + else if( ( byte_value1 >= 0xe0 ) + && ( byte_value1 <= 0xe7 ) ) + { + dynamic_window_position_index = byte_value1 - 0xe0; + + in_unicode_mode = 0; + } + /* UDn tags + */ + else if( ( byte_value1 >= 0xe8 ) + && ( byte_value1 <= 0xef ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0xe8; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + /* UQU tag + */ + else if( byte_value1 == 0xf0 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* UDX tag + */ + else if( byte_value1 == 0xf1 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + } + else + { + if( ( byte_value1 == 0x00 ) + || ( byte_value1 == 0x09 ) + || ( byte_value1 == 0x0a ) + || ( byte_value1 == 0x0c ) + || ( byte_value1 == 0x0d ) + || ( ( byte_value1 >= 0x20 ) + && ( byte_value1 <= 0x7f ) ) ) + { + unicode_character = byte_value1; + + unicode_character_set = 1; + } + /* SQn tags + */ + else if( ( byte_value1 >= 0x01 ) + && ( byte_value1 <= 0x08 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + + if( byte_value2 < 0x80 ) + { + unicode_character += libuna_scsu_static_window_positions[ byte_value1 - 0x01 ]; + } + else + { + unicode_character -= 0x80; + unicode_character += scsu_dynamic_window_positions[ byte_value1 - 0x01 ]; + } + unicode_character_set = 1; + } + /* SDX tag + */ + else if( byte_value1 == 0x0b ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + /* SQU tag + */ + else if( byte_value1 == 0x0e ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* SCU tag + */ + else if( byte_value1 == 0x0f ) + { + in_unicode_mode = 1; + } + /* SCn tags + */ + else if( ( byte_value1 >= 0x10 ) + && ( byte_value1 <= 0x17 ) ) + { + dynamic_window_position_index = byte_value1 - 0x10; + } + /* SDn tags + */ + else if( ( byte_value1 >= 0x18 ) + && ( byte_value1 <= 0x1f ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0x18; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + else if( byte_value1 >= 0x80 ) + { + unicode_character = byte_value1 - 0x80; + unicode_character += scsu_dynamic_window_positions[ dynamic_window_position_index ]; + + unicode_character_set = 1; + } + } + if( unicode_character_set != 0 ) + { + /* Determine how many UTF-16 character bytes are required + */ + if( libuna_unicode_character_size_to_utf16( + unicode_character, + utf16_string_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, + "%s: unable to unable to determine size of Unicode character in UTF-16.", + function ); + + return( -1 ); + } + if( unicode_character == 0 ) + { + break; + } + } + } + /* Check if the string is terminated with an end-of-string character + */ + if( unicode_character != 0 ) + { + *utf16_string_size += 1; + } + return( 1 ); +} + +/* Copies an UTF-16 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf16_string_copy_from_scsu_stream( + libuna_utf16_character_t *utf16_string, + size_t utf16_string_size, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_utf16_string_copy_from_scsu_stream"; + size_t utf16_string_index = 0; + + if( libuna_utf16_string_with_index_copy_from_scsu_stream( + utf16_string, + utf16_string_size, + &utf16_string_index, + scsu_stream, + scsu_stream_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to SCSU stream to UTF-16 string.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Copies an UTF-16 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf16_string_with_index_copy_from_scsu_stream( + libuna_utf16_character_t *utf16_string, + size_t utf16_string_size, + size_t *utf16_string_index, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ) +{ + uint32_t scsu_dynamic_window_positions[ 8 ] = { + 0x0080, 0x00c0, 0x0400, 0x0600, 0x0900, 0x3040, 0x30a0, 0xff00 }; + + static char *function = "libuna_utf16_string_with_index_copy_from_scsu_stream"; + libuna_unicode_character_t unicode_character = 0; + size_t scsu_stream_index = 0; + uint32_t scsu_window_position = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t dynamic_window_position_index = 0; + uint8_t in_unicode_mode = 0; + uint8_t unicode_character_set = 0; + + if( utf16_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-16 string.", + function ); + + return( -1 ); + } + if( utf16_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UTF-16 string size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf16_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-16 string index.", + function ); + + return( -1 ); + } + if( scsu_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid SCSU stream.", + function ); + + return( -1 ); + } + if( scsu_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid SCSU stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( scsu_stream_size == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, + "%s: missing SCSU stream value.", + function ); + + return( -1 ); + } + while( scsu_stream_index < scsu_stream_size ) + { + unicode_character_set = 0; + + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value1 = scsu_stream[ scsu_stream_index++ ]; + + if( in_unicode_mode != 0 ) + { + if( ( byte_value1 <= 0xdf ) + || ( byte_value1 >= 0xf3 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value1; + unicode_character <<= 8; + unicode_character |= byte_value2; + + unicode_character_set = 1; + } + /* UCn tags + */ + else if( ( byte_value1 >= 0xe0 ) + && ( byte_value1 <= 0xe7 ) ) + { + dynamic_window_position_index = byte_value1 - 0xe0; + + in_unicode_mode = 0; + } + /* UDn tags + */ + else if( ( byte_value1 >= 0xe8 ) + && ( byte_value1 <= 0xef ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0xe8; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + /* UQU tag + */ + else if( byte_value1 == 0xf0 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* UDX tag + */ + else if( byte_value1 == 0xf1 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + } + else + { + if( ( byte_value1 == 0x00 ) + || ( byte_value1 == 0x09 ) + || ( byte_value1 == 0x0a ) + || ( byte_value1 == 0x0c ) + || ( byte_value1 == 0x0d ) + || ( ( byte_value1 >= 0x20 ) + && ( byte_value1 <= 0x7f ) ) ) + { + unicode_character = byte_value1; + + unicode_character_set = 1; + } + /* SQn tags + */ + else if( ( byte_value1 >= 0x01 ) + && ( byte_value1 <= 0x08 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + + if( byte_value2 < 0x80 ) + { + unicode_character += libuna_scsu_static_window_positions[ byte_value1 - 0x01 ]; + } + else + { + unicode_character -= 0x80; + unicode_character += scsu_dynamic_window_positions[ byte_value1 - 0x01 ]; + } + unicode_character_set = 1; + } + /* SDX tag + */ + else if( byte_value1 == 0x0b ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + /* SQU tag + */ + else if( byte_value1 == 0x0e ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* SCU tag + */ + else if( byte_value1 == 0x0f ) + { + in_unicode_mode = 1; + } + /* SCn tags + */ + else if( ( byte_value1 >= 0x10 ) + && ( byte_value1 <= 0x17 ) ) + { + dynamic_window_position_index = byte_value1 - 0x10; + } + /* SDn tags + */ + else if( ( byte_value1 >= 0x18 ) + && ( byte_value1 <= 0x1f ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0x18; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + else if( byte_value1 >= 0x80 ) + { + unicode_character = byte_value1 - 0x80; + unicode_character += scsu_dynamic_window_positions[ dynamic_window_position_index ]; + + unicode_character_set = 1; + } + } + if( unicode_character_set != 0 ) + { + /* Convert the Unicode character into UTF-16 character bytes + */ + if( libuna_unicode_character_copy_to_utf16( + unicode_character, + utf16_string, + utf16_string_size, + utf16_string_index, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, + "%s: unable to copy Unicode character to UTF-16.", + function ); + + return( -1 ); + } + if( unicode_character == 0 ) + { + break; + } + } + } + /* Check if the string is terminated with an end-of-string character + */ + if( unicode_character != 0 ) + { + if( *utf16_string_index >= utf16_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-16 string too small.", + function ); + + return( -1 ); + } + utf16_string[ *utf16_string_index ] = 0; + + *utf16_string_index += 1; + } + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_utf16_string.h libbde-20240223/libuna/libuna_utf16_string.h --- libbde-20190102/libuna/libuna_utf16_string.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf16_string.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-16 string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF16_STRING_H ) @@ -293,6 +293,30 @@ int byte_order, libcerror_error_t **error ); +LIBUNA_EXTERN \ +int libuna_utf16_string_size_from_scsu_stream( + const uint8_t *scsu_stream, + size_t scsu_stream_size, + size_t *utf16_string_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_utf16_string_copy_from_scsu_stream( + libuna_utf16_character_t *utf16_string, + size_t utf16_string_size, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_utf16_string_with_index_copy_from_scsu_stream( + libuna_utf16_character_t *utf16_string, + size_t utf16_string_size, + size_t *utf16_string_index, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ); + #if defined( __cplusplus ) } #endif diff -Nru libbde-20190102/libuna/libuna_utf32_stream.c libbde-20240223/libuna/libuna_utf32_stream.c --- libbde-20190102/libuna/libuna_utf32_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf32_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-32 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -126,6 +126,7 @@ { static char *function = "libuna_utf32_stream_size_from_utf8"; libuna_unicode_character_t unicode_character = 0; + size_t safe_utf32_stream_size = 0; size_t utf8_string_index = 0; if( utf8_string == NULL ) @@ -163,7 +164,7 @@ } /* Add the byte order mark */ - *utf32_stream_size = 1; + safe_utf32_stream_size = 1; while( utf8_string_index < utf8_string_size ) { @@ -189,7 +190,7 @@ */ if( libuna_unicode_character_size_to_utf32( unicode_character, - utf32_stream_size, + &safe_utf32_stream_size, error ) != 1 ) { libcerror_error_set( @@ -208,7 +209,7 @@ } /* Convert the number of characters into bytes */ - *utf32_stream_size *= 4; + *utf32_stream_size = safe_utf32_stream_size * 4; return( 1 ); } @@ -359,6 +360,7 @@ { static char *function = "libuna_utf32_stream_size_from_utf16"; libuna_unicode_character_t unicode_character = 0; + size_t safe_utf32_stream_size = 0; size_t utf16_string_index = 0; if( utf16_string == NULL ) @@ -396,7 +398,7 @@ } /* Add the byte order mark */ - *utf32_stream_size = 1; + safe_utf32_stream_size = 1; while( utf16_string_index < utf16_string_size ) { @@ -422,7 +424,7 @@ */ if( libuna_unicode_character_size_to_utf32( unicode_character, - utf32_stream_size, + &safe_utf32_stream_size, error ) != 1 ) { libcerror_error_set( @@ -441,7 +443,7 @@ } /* Convert the number of characters into bytes */ - *utf32_stream_size *= 4; + *utf32_stream_size = safe_utf32_stream_size * 4; return( 1 ); } @@ -592,6 +594,7 @@ { static char *function = "libuna_utf32_stream_size_from_utf32"; libuna_unicode_character_t unicode_character = 0; + size_t safe_utf32_stream_size = 0; size_t utf32_string_index = 0; if( utf32_string == NULL ) @@ -629,7 +632,7 @@ } /* Add the byte order mark */ - *utf32_stream_size = 1; + safe_utf32_stream_size = 1; while( utf32_string_index < utf32_string_size ) { @@ -655,7 +658,7 @@ */ if( libuna_unicode_character_size_to_utf32( unicode_character, - utf32_stream_size, + &safe_utf32_stream_size, error ) != 1 ) { libcerror_error_set( @@ -674,7 +677,7 @@ } /* Convert the number of characters into bytes */ - *utf32_stream_size *= 4; + *utf32_stream_size = safe_utf32_stream_size * 4; return( 1 ); } diff -Nru libbde-20190102/libuna/libuna_utf32_stream.h libbde-20240223/libuna/libuna_utf32_stream.h --- libbde-20190102/libuna/libuna_utf32_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf32_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-32 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF32_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_utf32_string.c libbde-20240223/libuna/libuna_utf32_string.c --- libbde-20190102/libuna/libuna_utf32_string.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf32_string.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-32 string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -24,6 +24,7 @@ #include "libuna_definitions.h" #include "libuna_libcerror.h" +#include "libuna_scsu.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf32_string.h" @@ -118,6 +119,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -284,6 +289,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -379,13 +388,15 @@ return( -1 ); } - if( utf32_string[ utf32_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { utf32_string_size -= 1; } /* Check if the byte stream is terminated with zero bytes */ - if( byte_stream[ byte_stream_size - 1 ] == 0 ) + if( ( byte_stream_size >= 1 ) + && ( byte_stream[ byte_stream_size - 1 ] == 0 ) ) { byte_stream_size -= 1; } @@ -541,6 +552,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -705,6 +720,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -800,13 +819,15 @@ return( -1 ); } - if( utf32_string[ utf32_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { utf32_string_size -= 1; } /* Check if the UTF-7 stream is terminated with zero bytes */ - if( utf7_stream[ utf7_stream_size - 1 ] == 0 ) + if( ( utf7_stream_size >= 1 ) + && ( utf7_stream[ utf7_stream_size - 1 ] == 0 ) ) { utf7_stream_size -= 1; } @@ -960,6 +981,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1122,6 +1147,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1244,6 +1273,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1417,6 +1450,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1522,13 +1559,15 @@ utf8_stream_index += 3; } } - if( utf32_string[ utf32_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { utf32_string_size -= 1; } /* Check if the UTF-8 stream is terminated with zero bytes */ - if( utf8_stream[ utf8_stream_size - 1 ] == 0 ) + if( ( utf8_stream_size >= 1 ) + && ( utf8_stream[ utf8_stream_size - 1 ] == 0 ) ) { utf8_stream_size -= 1; } @@ -1681,6 +1720,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1843,6 +1886,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1877,9 +1924,10 @@ libcerror_error_t **error ) { static char *function = "libuna_utf32_string_size_from_utf16_stream"; - size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; + size_t utf16_stream_index = 0; int read_byte_order = 0; + int result = 0; if( utf16_stream == NULL ) { @@ -1952,18 +2000,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character @@ -1987,10 +2023,21 @@ } /* Determine how many UTF-8 character bytes are required */ - if( libuna_unicode_character_size_to_utf32( - unicode_character, - utf32_string_size, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_size_to_utf32( + unicode_character, + utf32_string_size, + error ); + } + else + { + result = libuna_unicode_character_size_to_ucs4( + unicode_character, + utf32_string_size, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -2001,6 +2048,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2059,9 +2110,10 @@ libcerror_error_t **error ) { static char *function = "libuna_utf32_string_with_index_copy_from_utf16_stream"; - size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; + size_t utf16_stream_index = 0; int read_byte_order = 0; + int result = 0; if( utf32_string == NULL ) { @@ -2151,18 +2203,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character @@ -2186,12 +2226,25 @@ } /* Convert the Unicode character into UTF-32 character bytes */ - if( libuna_unicode_character_copy_to_utf32( - unicode_character, - utf32_string, - utf32_string_size, - utf32_string_index, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_copy_to_utf32( + unicode_character, + utf32_string, + utf32_string_size, + utf32_string_index, + error ); + } + else + { + result = libuna_unicode_character_copy_to_ucs4( + unicode_character, + utf32_string, + utf32_string_size, + utf32_string_index, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -2202,6 +2255,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2237,11 +2294,12 @@ libcerror_error_t **error ) { static char *function = "libuna_utf32_string_compare_with_utf16_stream"; + libuna_unicode_character_t utf16_stream_unicode_character = 0; + libuna_unicode_character_t utf32_unicode_character = 0; size_t utf16_stream_index = 0; size_t utf32_string_index = 0; - libuna_unicode_character_t utf32_unicode_character = 0; - libuna_unicode_character_t utf16_stream_unicode_character = 0; int read_byte_order = 0; + int result = 0; if( utf32_string == NULL ) { @@ -2320,25 +2378,15 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } - if( utf32_string[ utf32_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { utf32_string_size -= 1; } /* Check if the UTF-16 stream is terminated with zero bytes */ - if( ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) + if( ( utf16_stream_size >= 2 ) + && ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) && ( utf16_stream[ utf16_stream_size - 1 ] == 0 ) ) { utf16_stream_size -= 2; @@ -2348,12 +2396,25 @@ { /* Convert the UTF-32 character bytes into an Unicode character */ - if( libuna_unicode_character_copy_from_utf32( - &utf32_unicode_character, - utf32_string, - utf32_string_size, - &utf32_string_index, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_copy_from_utf32( + &utf32_unicode_character, + utf32_string, + utf32_string_size, + &utf32_string_index, + error ); + } + else + { + result = libuna_unicode_character_copy_from_ucs4( + &utf32_unicode_character, + utf32_string, + utf32_string_size, + &utf32_string_index, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -2495,18 +2556,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf32_stream_index + 1 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character @@ -2544,6 +2593,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2698,18 +2751,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf32_stream_index + 1 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character @@ -2749,6 +2790,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2871,25 +2916,15 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } - if( utf32_string[ utf32_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { utf32_string_size -= 1; } /* Check if the UTF-32 stream is terminated with zero bytes */ - if( ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) + if( ( utf32_stream_size >= 4 ) + && ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 3 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 2 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 1 ] == 0 ) ) @@ -2958,3 +2993,816 @@ return( LIBUNA_COMPARE_EQUAL ); } +/* Determines the size of an UTF-32 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf32_string_size_from_scsu_stream( + const uint8_t *scsu_stream, + size_t scsu_stream_size, + size_t *utf32_string_size, + libcerror_error_t **error ) +{ + uint32_t scsu_dynamic_window_positions[ 8 ] = { + 0x0080, 0x00c0, 0x0400, 0x0600, 0x0900, 0x3040, 0x30a0, 0xff00 }; + + static char *function = "libuna_utf8_string_size_from_scsu_stream"; + libuna_unicode_character_t unicode_character = 0; + size_t scsu_stream_index = 0; + uint32_t scsu_window_position = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t dynamic_window_position_index = 0; + uint8_t in_unicode_mode = 0; + uint8_t unicode_character_set = 0; + + if( scsu_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid SCSU stream.", + function ); + + return( -1 ); + } + if( scsu_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid SCSU stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf32_string_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-32 string size.", + function ); + + return( -1 ); + } + *utf32_string_size = 0; + + if( scsu_stream_size == 0 ) + { + return( 1 ); + } + while( scsu_stream_index < scsu_stream_size ) + { + unicode_character_set = 0; + + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value1 = scsu_stream[ scsu_stream_index++ ]; + + if( in_unicode_mode != 0 ) + { + if( ( byte_value1 <= 0xdf ) + || ( byte_value1 >= 0xf3 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value1; + unicode_character <<= 8; + unicode_character |= byte_value2; + + unicode_character_set = 1; + } + /* UCn tags + */ + else if( ( byte_value1 >= 0xe0 ) + && ( byte_value1 <= 0xe7 ) ) + { + dynamic_window_position_index = byte_value1 - 0xe0; + + in_unicode_mode = 0; + } + /* UDn tags + */ + else if( ( byte_value1 >= 0xe8 ) + && ( byte_value1 <= 0xef ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0xe8; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + /* UQU tag + */ + else if( byte_value1 == 0xf0 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* UDX tag + */ + else if( byte_value1 == 0xf1 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + } + else + { + if( ( byte_value1 == 0x00 ) + || ( byte_value1 == 0x09 ) + || ( byte_value1 == 0x0a ) + || ( byte_value1 == 0x0c ) + || ( byte_value1 == 0x0d ) + || ( ( byte_value1 >= 0x20 ) + && ( byte_value1 <= 0x7f ) ) ) + { + unicode_character = byte_value1; + + unicode_character_set = 1; + } + /* SQn tags + */ + else if( ( byte_value1 >= 0x01 ) + && ( byte_value1 <= 0x08 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + + if( byte_value2 < 0x80 ) + { + unicode_character += libuna_scsu_static_window_positions[ byte_value1 - 0x01 ]; + } + else + { + unicode_character -= 0x80; + unicode_character += scsu_dynamic_window_positions[ byte_value1 - 0x01 ]; + } + unicode_character_set = 1; + } + /* SDX tag + */ + else if( byte_value1 == 0x0b ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + /* SQU tag + */ + else if( byte_value1 == 0x0e ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* SCU tag + */ + else if( byte_value1 == 0x0f ) + { + in_unicode_mode = 1; + } + /* SCn tags + */ + else if( ( byte_value1 >= 0x10 ) + && ( byte_value1 <= 0x17 ) ) + { + dynamic_window_position_index = byte_value1 - 0x10; + } + /* SDn tags + */ + else if( ( byte_value1 >= 0x18 ) + && ( byte_value1 <= 0x1f ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0x18; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + else if( byte_value1 >= 0x80 ) + { + unicode_character = byte_value1 - 0x80; + unicode_character += scsu_dynamic_window_positions[ dynamic_window_position_index ]; + + unicode_character_set = 1; + } + } + if( unicode_character_set != 0 ) + { + /* Determine how many UTF-32 character bytes are required + */ + if( libuna_unicode_character_size_to_utf32( + unicode_character, + utf32_string_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, + "%s: unable to unable to determine size of Unicode character in UTF-32.", + function ); + + return( -1 ); + } + if( unicode_character == 0 ) + { + break; + } + } + } + /* Check if the string is terminated with an end-of-string character + */ + if( unicode_character != 0 ) + { + *utf32_string_size += 1; + } + return( 1 ); +} + +/* Copies an UTF-32 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf32_string_copy_from_scsu_stream( + libuna_utf32_character_t *utf32_string, + size_t utf32_string_size, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_utf32_string_copy_from_scsu_stream"; + size_t utf32_string_index = 0; + + if( libuna_utf32_string_with_index_copy_from_scsu_stream( + utf32_string, + utf32_string_size, + &utf32_string_index, + scsu_stream, + scsu_stream_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to SCSU stream to UTF-32 string.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Copies an UTF-32 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf32_string_with_index_copy_from_scsu_stream( + libuna_utf32_character_t *utf32_string, + size_t utf32_string_size, + size_t *utf32_string_index, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ) +{ + uint32_t scsu_dynamic_window_positions[ 8 ] = { + 0x0080, 0x00c0, 0x0400, 0x0600, 0x0900, 0x3040, 0x30a0, 0xff00 }; + + static char *function = "libuna_utf32_string_with_index_copy_from_scsu_stream"; + libuna_unicode_character_t unicode_character = 0; + size_t scsu_stream_index = 0; + uint32_t scsu_window_position = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t dynamic_window_position_index = 0; + uint8_t in_unicode_mode = 0; + uint8_t unicode_character_set = 0; + + if( utf32_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-32 string.", + function ); + + return( -1 ); + } + if( utf32_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UTF-32 string size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf32_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-32 string index.", + function ); + + return( -1 ); + } + if( scsu_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid SCSU stream.", + function ); + + return( -1 ); + } + if( scsu_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid SCSU stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( scsu_stream_size == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, + "%s: missing SCSU stream value.", + function ); + + return( -1 ); + } + while( scsu_stream_index < scsu_stream_size ) + { + unicode_character_set = 0; + + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value1 = scsu_stream[ scsu_stream_index++ ]; + + if( in_unicode_mode != 0 ) + { + if( ( byte_value1 <= 0xdf ) + || ( byte_value1 >= 0xf3 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value1; + unicode_character <<= 8; + unicode_character |= byte_value2; + + unicode_character_set = 1; + } + /* UCn tags + */ + else if( ( byte_value1 >= 0xe0 ) + && ( byte_value1 <= 0xe7 ) ) + { + dynamic_window_position_index = byte_value1 - 0xe0; + + in_unicode_mode = 0; + } + /* UDn tags + */ + else if( ( byte_value1 >= 0xe8 ) + && ( byte_value1 <= 0xef ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0xe8; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + /* UQU tag + */ + else if( byte_value1 == 0xf0 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* UDX tag + */ + else if( byte_value1 == 0xf1 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + } + else + { + if( ( byte_value1 == 0x00 ) + || ( byte_value1 == 0x09 ) + || ( byte_value1 == 0x0a ) + || ( byte_value1 == 0x0c ) + || ( byte_value1 == 0x0d ) + || ( ( byte_value1 >= 0x20 ) + && ( byte_value1 <= 0x7f ) ) ) + { + unicode_character = byte_value1; + + unicode_character_set = 1; + } + /* SQn tags + */ + else if( ( byte_value1 >= 0x01 ) + && ( byte_value1 <= 0x08 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + + if( byte_value2 < 0x80 ) + { + unicode_character += libuna_scsu_static_window_positions[ byte_value1 - 0x01 ]; + } + else + { + unicode_character -= 0x80; + unicode_character += scsu_dynamic_window_positions[ byte_value1 - 0x01 ]; + } + unicode_character_set = 1; + } + /* SDX tag + */ + else if( byte_value1 == 0x0b ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + /* SQU tag + */ + else if( byte_value1 == 0x0e ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* SCU tag + */ + else if( byte_value1 == 0x0f ) + { + in_unicode_mode = 1; + } + /* SCn tags + */ + else if( ( byte_value1 >= 0x10 ) + && ( byte_value1 <= 0x17 ) ) + { + dynamic_window_position_index = byte_value1 - 0x10; + } + /* SDn tags + */ + else if( ( byte_value1 >= 0x18 ) + && ( byte_value1 <= 0x1f ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0x18; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + else if( byte_value1 >= 0x80 ) + { + unicode_character = byte_value1 - 0x80; + unicode_character += scsu_dynamic_window_positions[ dynamic_window_position_index ]; + + unicode_character_set = 1; + } + } + if( unicode_character_set != 0 ) + { + /* Convert the Unicode character into UTF-32 character bytes + */ + if( libuna_unicode_character_copy_to_utf32( + unicode_character, + utf32_string, + utf32_string_size, + utf32_string_index, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, + "%s: unable to copy Unicode character to UTF-32.", + function ); + + return( -1 ); + } + if( unicode_character == 0 ) + { + break; + } + } + } + /* Check if the string is terminated with an end-of-string character + */ + if( unicode_character != 0 ) + { + if( *utf32_string_index >= utf32_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-32 string too small.", + function ); + + return( -1 ); + } + utf32_string[ *utf32_string_index ] = 0; + + *utf32_string_index += 1; + } + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_utf32_string.h libbde-20240223/libuna/libuna_utf32_string.h --- libbde-20190102/libuna/libuna_utf32_string.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf32_string.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-32 string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF32_STRING_H ) @@ -289,6 +289,30 @@ int byte_order, libcerror_error_t **error ); +LIBUNA_EXTERN \ +int libuna_utf32_string_size_from_scsu_stream( + const uint8_t *scsu_stream, + size_t scsu_stream_size, + size_t *utf32_string_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_utf32_string_copy_from_scsu_stream( + libuna_utf32_character_t *utf32_string, + size_t utf32_string_size, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_utf32_string_with_index_copy_from_scsu_stream( + libuna_utf32_character_t *utf32_string, + size_t utf32_string_size, + size_t *utf32_string_index, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ); + #if defined( __cplusplus ) } #endif diff -Nru libbde-20190102/libuna/libuna_utf7_stream.c libbde-20240223/libuna/libuna_utf7_stream.c --- libbde-20190102/libuna/libuna_utf7_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf7_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-7 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_utf7_stream.h libbde-20240223/libuna/libuna_utf7_stream.h --- libbde-20190102/libuna/libuna_utf7_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf7_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-7 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF7_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_utf8_stream.c libbde-20240223/libuna/libuna_utf8_stream.c --- libbde-20190102/libuna/libuna_utf8_stream.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf8_stream.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-8 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/libuna/libuna_utf8_stream.h libbde-20240223/libuna/libuna_utf8_stream.h --- libbde-20190102/libuna/libuna_utf8_stream.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf8_stream.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-8 stream functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF8_STREAM_H ) diff -Nru libbde-20190102/libuna/libuna_utf8_string.c libbde-20240223/libuna/libuna_utf8_string.c --- libbde-20190102/libuna/libuna_utf8_string.c 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf8_string.c 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-8 string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -24,6 +24,7 @@ #include "libuna_definitions.h" #include "libuna_libcerror.h" +#include "libuna_scsu.h" #include "libuna_types.h" #include "libuna_unicode_character.h" #include "libuna_utf8_string.h" @@ -387,13 +388,15 @@ return( -1 ); } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } /* Check if the byte stream is terminated with zero bytes */ - if( byte_stream[ byte_stream_size - 1 ] == 0 ) + if( ( byte_stream_size >= 1 ) + && ( byte_stream[ byte_stream_size - 1 ] == 0 ) ) { byte_stream_size -= 1; } @@ -816,13 +819,15 @@ return( -1 ); } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } /* Check if the UTF-7 stream is terminated with zero bytes */ - if( utf7_stream[ utf7_stream_size - 1 ] == 0 ) + if( ( utf7_stream_size >= 1 ) + && ( utf7_stream[ utf7_stream_size - 1 ] == 0 ) ) { utf7_stream_size -= 1; } @@ -1273,13 +1278,15 @@ utf8_stream_index += 3; } } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } /* Check if the UTF-8 stream is terminated with zero bytes */ - if( utf8_stream[ utf8_stream_size - 1 ] == 0 ) + if( ( utf8_stream_size >= 1 ) + && ( utf8_stream[ utf8_stream_size - 1 ] == 0 ) ) { utf8_stream_size -= 1; } @@ -1432,6 +1439,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1594,6 +1605,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -1688,11 +1703,13 @@ return( -1 ); } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } - if( utf16_string[ utf16_string_size - 1 ] == 0 ) + if( ( utf16_string_size >= 1 ) + && ( utf16_string[ utf16_string_size - 1 ] == 0 ) ) { utf16_string_size -= 1; } @@ -1768,9 +1785,10 @@ libcerror_error_t **error ) { static char *function = "libuna_utf8_string_size_from_utf16_stream"; - size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; + size_t utf16_stream_index = 0; int read_byte_order = 0; + int result = 0; if( utf16_stream == NULL ) { @@ -1843,18 +1861,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character @@ -1878,10 +1884,21 @@ } /* Determine how many UTF-8 character bytes are required */ - if( libuna_unicode_character_size_to_utf8( - unicode_character, - utf8_string_size, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_size_to_utf8( + unicode_character, + utf8_string_size, + error ); + } + else + { + result = libuna_unicode_character_size_to_utf8_rfc2279( + unicode_character, + utf8_string_size, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -1954,9 +1971,10 @@ libcerror_error_t **error ) { static char *function = "libuna_utf8_string_with_index_copy_from_utf16_stream"; - size_t utf16_stream_index = 0; libuna_unicode_character_t unicode_character = 0; + size_t utf16_stream_index = 0; int read_byte_order = 0; + int result = 0; if( utf8_string == NULL ) { @@ -2046,18 +2064,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf16_stream_index + 1 ) < utf16_stream_size ) { /* Convert the UTF-16 stream bytes into an Unicode character @@ -2081,12 +2087,25 @@ } /* Convert the Unicode character into UTF-8 character bytes */ - if( libuna_unicode_character_copy_to_utf8( - unicode_character, - utf8_string, - utf8_string_size, - utf8_string_index, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_copy_to_utf8( + unicode_character, + utf8_string, + utf8_string_size, + utf8_string_index, + error ); + } + else + { + result = libuna_unicode_character_copy_to_utf8_rfc2279( + unicode_character, + utf8_string, + utf8_string_size, + utf8_string_index, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -2136,11 +2155,12 @@ libcerror_error_t **error ) { static char *function = "libuna_utf8_string_compare_with_utf16_stream"; + libuna_unicode_character_t utf16_stream_unicode_character = 0; + libuna_unicode_character_t utf8_unicode_character = 0; size_t utf16_stream_index = 0; size_t utf8_string_index = 0; - libuna_unicode_character_t utf8_unicode_character = 0; - libuna_unicode_character_t utf16_stream_unicode_character = 0; int read_byte_order = 0; + int result = 0; if( utf8_string == NULL ) { @@ -2219,25 +2239,15 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } /* Check if the UTF-16 stream is terminated with zero bytes */ - if( ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) + if( ( utf16_stream_size >= 2 ) + && ( utf16_stream[ utf16_stream_size - 2 ] == 0 ) && ( utf16_stream[ utf16_stream_size - 1 ] == 0 ) ) { utf16_stream_size -= 2; @@ -2247,12 +2257,25 @@ { /* Convert the UTF-8 character bytes into an Unicode character */ - if( libuna_unicode_character_copy_from_utf8( - &utf8_unicode_character, - utf8_string, - utf8_string_size, - &utf8_string_index, - error ) != 1 ) + if( ( byte_order & LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE ) == 0 ) + { + result = libuna_unicode_character_copy_from_utf8( + &utf8_unicode_character, + utf8_string, + utf8_string_size, + &utf8_string_index, + error ); + } + else + { + result = libuna_unicode_character_copy_from_utf8_rfc2279( + &utf8_unicode_character, + utf8_string, + utf8_string_size, + &utf8_string_index, + error ); + } + if( result != 1 ) { libcerror_error_set( error, @@ -2392,6 +2415,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2554,6 +2581,10 @@ return( -1 ); } + if( unicode_character == 0 ) + { + break; + } } /* Check if the string is terminated with an end-of-string character */ @@ -2648,11 +2679,13 @@ return( -1 ); } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } - if( utf32_string[ utf32_string_size - 1 ] == 0 ) + if( ( utf32_string_size >= 1 ) + && ( utf32_string[ utf32_string_size - 1 ] == 0 ) ) { utf32_string_size -= 1; } @@ -2807,18 +2840,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character @@ -3014,18 +3035,6 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } while( ( utf32_stream_index + 3 ) < utf32_stream_size ) { /* Convert the UTF-32 stream bytes into an Unicode character @@ -3191,25 +3200,15 @@ byte_order = read_byte_order; } } - if( ( byte_order != LIBUNA_ENDIAN_BIG ) - && ( byte_order != LIBUNA_ENDIAN_LITTLE ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE, - "%s: unsupported byte order.", - function ); - - return( -1 ); - } - if( utf8_string[ utf8_string_size - 1 ] == 0 ) + if( ( utf8_string_size >= 1 ) + && ( utf8_string[ utf8_string_size - 1 ] == 0 ) ) { utf8_string_size -= 1; } /* Check if the UTF-32 stream is terminated with zero bytes */ - if( ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) + if( ( utf32_stream_size >= 4 ) + && ( utf32_stream[ utf32_stream_size - 4 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 3 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 2 ] == 0 ) && ( utf32_stream[ utf32_stream_size - 1 ] == 0 ) ) @@ -3278,3 +3277,816 @@ return( LIBUNA_COMPARE_EQUAL ); } +/* Determines the size of an UTF-8 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf8_string_size_from_scsu_stream( + const uint8_t *scsu_stream, + size_t scsu_stream_size, + size_t *utf8_string_size, + libcerror_error_t **error ) +{ + uint32_t scsu_dynamic_window_positions[ 8 ] = { + 0x0080, 0x00c0, 0x0400, 0x0600, 0x0900, 0x3040, 0x30a0, 0xff00 }; + + static char *function = "libuna_utf8_string_size_from_scsu_stream"; + libuna_unicode_character_t unicode_character = 0; + size_t scsu_stream_index = 0; + uint32_t scsu_window_position = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t dynamic_window_position_index = 0; + uint8_t in_unicode_mode = 0; + uint8_t unicode_character_set = 0; + + if( scsu_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid SCSU stream.", + function ); + + return( -1 ); + } + if( scsu_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid SCSU stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf8_string_size == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string size.", + function ); + + return( -1 ); + } + *utf8_string_size = 0; + + if( scsu_stream_size == 0 ) + { + return( 1 ); + } + while( scsu_stream_index < scsu_stream_size ) + { + unicode_character_set = 0; + + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value1 = scsu_stream[ scsu_stream_index++ ]; + + if( in_unicode_mode != 0 ) + { + if( ( byte_value1 <= 0xdf ) + || ( byte_value1 >= 0xf3 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value1; + unicode_character <<= 8; + unicode_character |= byte_value2; + + unicode_character_set = 1; + } + /* UCn tags + */ + else if( ( byte_value1 >= 0xe0 ) + && ( byte_value1 <= 0xe7 ) ) + { + dynamic_window_position_index = byte_value1 - 0xe0; + + in_unicode_mode = 0; + } + /* UDn tags + */ + else if( ( byte_value1 >= 0xe8 ) + && ( byte_value1 <= 0xef ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0xe8; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + /* UQU tag + */ + else if( byte_value1 == 0xf0 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* UDX tag + */ + else if( byte_value1 == 0xf1 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + } + else + { + if( ( byte_value1 == 0x00 ) + || ( byte_value1 == 0x09 ) + || ( byte_value1 == 0x0a ) + || ( byte_value1 == 0x0c ) + || ( byte_value1 == 0x0d ) + || ( ( byte_value1 >= 0x20 ) + && ( byte_value1 <= 0x7f ) ) ) + { + unicode_character = byte_value1; + + unicode_character_set = 1; + } + /* SQn tags + */ + else if( ( byte_value1 >= 0x01 ) + && ( byte_value1 <= 0x08 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + + if( byte_value2 < 0x80 ) + { + unicode_character += libuna_scsu_static_window_positions[ byte_value1 - 0x01 ]; + } + else + { + unicode_character -= 0x80; + unicode_character += scsu_dynamic_window_positions[ byte_value1 - 0x01 ]; + } + unicode_character_set = 1; + } + /* SDX tag + */ + else if( byte_value1 == 0x0b ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + /* SQU tag + */ + else if( byte_value1 == 0x0e ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* SCU tag + */ + else if( byte_value1 == 0x0f ) + { + in_unicode_mode = 1; + } + /* SCn tags + */ + else if( ( byte_value1 >= 0x10 ) + && ( byte_value1 <= 0x17 ) ) + { + dynamic_window_position_index = byte_value1 - 0x10; + } + /* SDn tags + */ + else if( ( byte_value1 >= 0x18 ) + && ( byte_value1 <= 0x1f ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0x18; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + else if( byte_value1 >= 0x80 ) + { + unicode_character = byte_value1 - 0x80; + unicode_character += scsu_dynamic_window_positions[ dynamic_window_position_index ]; + + unicode_character_set = 1; + } + } + if( unicode_character_set != 0 ) + { + /* Determine how many UTF-8 character bytes are required + */ + if( libuna_unicode_character_size_to_utf8( + unicode_character, + utf8_string_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_INPUT_FAILED, + "%s: unable to unable to determine size of Unicode character in UTF-8.", + function ); + + return( -1 ); + } + if( unicode_character == 0 ) + { + break; + } + } + } + /* Check if the string is terminated with an end-of-string character + */ + if( unicode_character != 0 ) + { + *utf8_string_size += 1; + } + return( 1 ); +} + +/* Copies an UTF-8 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf8_string_copy_from_scsu_stream( + libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ) +{ + static char *function = "libuna_utf8_string_copy_from_scsu_stream"; + size_t utf8_string_index = 0; + + if( libuna_utf8_string_with_index_copy_from_scsu_stream( + utf8_string, + utf8_string_size, + &utf8_string_index, + scsu_stream, + scsu_stream_size, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_COPY_FAILED, + "%s: unable to SCSU stream to UTF-8 string.", + function ); + + return( -1 ); + } + return( 1 ); +} + +/* Copies an UTF-8 string from a Standard Compression Scheme for Unicode (SCSU) stream + * Returns 1 if successful or -1 on error + */ +int libuna_utf8_string_with_index_copy_from_scsu_stream( + libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + size_t *utf8_string_index, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ) +{ + uint32_t scsu_dynamic_window_positions[ 8 ] = { + 0x0080, 0x00c0, 0x0400, 0x0600, 0x0900, 0x3040, 0x30a0, 0xff00 }; + + static char *function = "libuna_utf8_string_with_index_copy_from_scsu_stream"; + libuna_unicode_character_t unicode_character = 0; + size_t scsu_stream_index = 0; + uint32_t scsu_window_position = 0; + uint8_t byte_value1 = 0; + uint8_t byte_value2 = 0; + uint8_t byte_value3 = 0; + uint8_t dynamic_window_position_index = 0; + uint8_t in_unicode_mode = 0; + uint8_t unicode_character_set = 0; + + if( utf8_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string.", + function ); + + return( -1 ); + } + if( utf8_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid UTF-8 string size value exceeds maximum.", + function ); + + return( -1 ); + } + if( utf8_string_index == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid UTF-8 string index.", + function ); + + return( -1 ); + } + if( scsu_stream == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid SCSU stream.", + function ); + + return( -1 ); + } + if( scsu_stream_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid SCSU stream size value exceeds maximum.", + function ); + + return( -1 ); + } + if( scsu_stream_size == 0 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS, + "%s: missing SCSU stream value.", + function ); + + return( -1 ); + } + while( scsu_stream_index < scsu_stream_size ) + { + unicode_character_set = 0; + + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value1 = scsu_stream[ scsu_stream_index++ ]; + + if( in_unicode_mode != 0 ) + { + if( ( byte_value1 <= 0xdf ) + || ( byte_value1 >= 0xf3 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value1; + unicode_character <<= 8; + unicode_character |= byte_value2; + + unicode_character_set = 1; + } + /* UCn tags + */ + else if( ( byte_value1 >= 0xe0 ) + && ( byte_value1 <= 0xe7 ) ) + { + dynamic_window_position_index = byte_value1 - 0xe0; + + in_unicode_mode = 0; + } + /* UDn tags + */ + else if( ( byte_value1 >= 0xe8 ) + && ( byte_value1 <= 0xef ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0xe8; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + /* UQU tag + */ + else if( byte_value1 == 0xf0 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* UDX tag + */ + else if( byte_value1 == 0xf1 ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + + in_unicode_mode = 0; + } + } + else + { + if( ( byte_value1 == 0x00 ) + || ( byte_value1 == 0x09 ) + || ( byte_value1 == 0x0a ) + || ( byte_value1 == 0x0c ) + || ( byte_value1 == 0x0d ) + || ( ( byte_value1 >= 0x20 ) + && ( byte_value1 <= 0x7f ) ) ) + { + unicode_character = byte_value1; + + unicode_character_set = 1; + } + /* SQn tags + */ + else if( ( byte_value1 >= 0x01 ) + && ( byte_value1 <= 0x08 ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + + if( byte_value2 < 0x80 ) + { + unicode_character += libuna_scsu_static_window_positions[ byte_value1 - 0x01 ]; + } + else + { + unicode_character -= 0x80; + unicode_character += scsu_dynamic_window_positions[ byte_value1 - 0x01 ]; + } + unicode_character_set = 1; + } + /* SDX tag + */ + else if( byte_value1 == 0x0b ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value2 >> 5; + scsu_window_position = byte_value2 & 0x1f; + scsu_window_position <<= 8; + scsu_window_position |= byte_value3; + scsu_window_position <<= 7; + scsu_window_position += 0x00010000UL; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + /* SQU tag + */ + else if( byte_value1 == 0x0e ) + { + if( ( scsu_stream_size < 2 ) + || ( scsu_stream_index > ( scsu_stream_size - 2 ) ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + byte_value3 = scsu_stream[ scsu_stream_index++ ]; + + unicode_character = byte_value2; + unicode_character <<= 8; + unicode_character |= byte_value3; + + unicode_character_set = 1; + } + /* SCU tag + */ + else if( byte_value1 == 0x0f ) + { + in_unicode_mode = 1; + } + /* SCn tags + */ + else if( ( byte_value1 >= 0x10 ) + && ( byte_value1 <= 0x17 ) ) + { + dynamic_window_position_index = byte_value1 - 0x10; + } + /* SDn tags + */ + else if( ( byte_value1 >= 0x18 ) + && ( byte_value1 <= 0x1f ) ) + { + if( scsu_stream_index >= scsu_stream_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: SCSU stream too small.", + function ); + + return( -1 ); + } + byte_value2 = scsu_stream[ scsu_stream_index++ ]; + + dynamic_window_position_index = byte_value1 - 0x18; + scsu_window_position = libuna_scsu_window_offset_table[ byte_value2 ]; + + scsu_dynamic_window_positions[ dynamic_window_position_index ] = scsu_window_position; + } + else if( byte_value1 >= 0x80 ) + { + unicode_character = byte_value1 - 0x80; + unicode_character += scsu_dynamic_window_positions[ dynamic_window_position_index ]; + + unicode_character_set = 1; + } + } + if( unicode_character_set != 0 ) + { + /* Convert the Unicode character into UTF-8 character bytes + */ + if( libuna_unicode_character_copy_to_utf8( + unicode_character, + utf8_string, + utf8_string_size, + utf8_string_index, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED, + "%s: unable to copy Unicode character to UTF-8.", + function ); + + return( -1 ); + } + if( unicode_character == 0 ) + { + break; + } + } + } + /* Check if the string is terminated with an end-of-string character + */ + if( unicode_character != 0 ) + { + if( *utf8_string_index >= utf8_string_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: UTF-8 string too small.", + function ); + + return( -1 ); + } + utf8_string[ *utf8_string_index ] = 0; + + *utf8_string_index += 1; + } + return( 1 ); +} + diff -Nru libbde-20190102/libuna/libuna_utf8_string.h libbde-20240223/libuna/libuna_utf8_string.h --- libbde-20190102/libuna/libuna_utf8_string.h 2019-01-02 15:57:34.000000000 +0000 +++ libbde-20240223/libuna/libuna_utf8_string.h 2024-02-23 03:03:41.000000000 +0000 @@ -1,22 +1,22 @@ /* * UTF-8 string functions * - * Copyright (C) 2008-2018, Joachim Metz + * Copyright (C) 2008-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _LIBUNA_UTF8_STRING_H ) @@ -297,6 +297,30 @@ int byte_order, libcerror_error_t **error ); +LIBUNA_EXTERN \ +int libuna_utf8_string_size_from_scsu_stream( + const uint8_t *scsu_stream, + size_t scsu_stream_size, + size_t *utf8_string_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_utf8_string_copy_from_scsu_stream( + libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ); + +LIBUNA_EXTERN \ +int libuna_utf8_string_with_index_copy_from_scsu_stream( + libuna_utf8_character_t *utf8_string, + size_t utf8_string_size, + size_t *utf8_string_index, + const uint8_t *scsu_stream, + size_t scsu_stream_size, + libcerror_error_t **error ); + #if defined( __cplusplus ) } #endif diff -Nru libbde-20190102/ltmain.sh libbde-20240223/ltmain.sh --- libbde-20190102/ltmain.sh 2019-01-02 15:57:42.000000000 +0000 +++ libbde-20240223/ltmain.sh 2024-02-23 03:03:45.000000000 +0000 @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1376,8 @@ _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1402,8 @@ _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1530,26 @@ # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program 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 General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Please report bugs or propose patches to: +# -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1572,7 @@ # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1584,7 @@ # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1633,8 @@ ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1667,8 @@ # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1677,28 @@ } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1532,22 +1708,19 @@ case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1730,18 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1751,8 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1761,36 @@ # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1801,26 @@ # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1830,27 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1859,8 @@ # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1871,7 @@ opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1883,32 @@ { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1918,10 @@ ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1974,24 @@ shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +2008,10 @@ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2067,8 @@ # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2083,9 @@ func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1870,7 +2095,7 @@ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1896,7 +2121,7 @@ { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1938,31 +2163,44 @@ # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2210,12 @@ # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2068,7 +2306,7 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2270,6 +2508,8 @@ nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2533,16 @@ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2554,12 @@ { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2634,20 @@ func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2415,17 +2668,10 @@ # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in - # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 - # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac + # Keeping compiler generated duplicates in $postdeps and $predeps is not + # harmful, and is necessary in a majority of systems that use it to satisfy + # symbol dependencies. + opt_duplicate_compiler_generated_deps=: $opt_help || { # Sanity checks first: @@ -2451,8 +2697,8 @@ } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3664,8 @@ esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3738,8 @@ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3648,7 +3894,8 @@ -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3754,6 +4001,8 @@ -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4096,8 +4345,8 @@ case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4356,8 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4165,12 +4414,12 @@ esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4430,8 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4727,8 @@ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5507,8 @@ if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5518,7 @@ \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6861,9 @@ while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6849,6 +7099,13 @@ prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7019,7 +7276,7 @@ # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7039,7 +7296,7 @@ esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7069,8 +7326,20 @@ prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7211,9 +7480,9 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,16 +7496,21 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7254,8 +7528,8 @@ # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7274,12 +7548,15 @@ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7300,15 +7577,15 @@ continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7428,8 +7705,8 @@ *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8634,7 +8911,7 @@ test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8807,7 +9084,7 @@ # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -8898,7 +9175,7 @@ versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9124,7 +9401,7 @@ *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9935,8 +10212,8 @@ for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10029,8 +10306,8 @@ eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10504,12 +10781,13 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10749,13 +11027,15 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff -Nru libbde-20190102/m4/gettext.m4 libbde-20240223/m4/gettext.m4 --- libbde-20190102/m4/gettext.m4 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/m4/gettext.m4 2023-12-03 08:57:24.000000000 +0000 @@ -1,16 +1,16 @@ -# gettext.m4 serial 63 (gettext-0.18) -dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +# gettext.m4 serial 71 (gettext-0.20.2) +dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: @@ -20,22 +20,20 @@ dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). -dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The -dnl default (if it is not specified or empty) is 'no-libtool'. -dnl INTLSYMBOL should be 'external' for packages with no intl directory, -dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. +dnl INTLSYMBOL must be one of 'external', 'use-libtool'. +dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and +dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of -dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library -dnl $(top_builddir)/intl/libintl.a will be created. +dnl AM-DISABLE-SHARED). dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, -dnl the value `$(top_builddir)/intl/' is used. +dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled @@ -57,19 +55,17 @@ AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. - ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT -])])])])]) +])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], - [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) + [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. +])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], - ifelse([$1], [external], - ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), - [yes])) - define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) + ifelse([$1], [external], [no], [yes])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) @@ -91,13 +87,12 @@ dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. - dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not - dnl documented, we avoid it. + dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) - dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. @@ -157,12 +152,23 @@ fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], - [AC_TRY_LINK([#include -$gt_revision_test_code + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings;], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], +extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -183,35 +189,57 @@ gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. - AC_TRY_LINK([#include -$gt_revision_test_code + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], +const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -$gt_revision_test_code + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], - [LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - ]) +const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ]])], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + eval "$gt_func_gnugettext_libintl=yes" + ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) @@ -245,8 +273,8 @@ dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes - LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" - LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi @@ -314,43 +342,14 @@ fi ifelse(gt_included_intl, yes, [ - dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL - dnl to 'yes' because some of the testsuite requires it. - if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then - BUILD_INCLUDED_LIBINTL=yes - fi + dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes' + dnl because some of the testsuite requires it. + BUILD_INCLUDED_LIBINTL=yes dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) - - dnl For backward compatibility. Some configure.ins may be using this. - nls_cv_header_intl= - nls_cv_header_libgt= - - dnl For backward compatibility. Some Makefiles may be using this. - DATADIRNAME=share - AC_SUBST([DATADIRNAME]) - - dnl For backward compatibility. Some Makefiles may be using this. - INSTOBJEXT=.mo - AC_SUBST([INSTOBJEXT]) - - dnl For backward compatibility. Some Makefiles may be using this. - GENCAT=gencat - AC_SUBST([GENCAT]) - - dnl For backward compatibility. Some Makefiles may be using this. - INTLOBJS= - if test "$USE_INCLUDED_LIBINTL" = yes; then - INTLOBJS="\$(GETTOBJS)" - fi - AC_SUBST([INTLOBJS]) - - dnl Enable libtool support if the surrounding package wishes it. - INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix - AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. @@ -381,3 +380,7 @@ dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + + +dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) diff -Nru libbde-20190102/m4/host-cpu-c-abi.m4 libbde-20240223/m4/host-cpu-c-abi.m4 --- libbde-20190102/m4/host-cpu-c-abi.m4 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/m4/host-cpu-c-abi.m4 2023-12-03 08:57:24.000000000 +0000 @@ -0,0 +1,675 @@ +# host-cpu-c-abi.m4 serial 13 +dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible and Sam Steingold. + +dnl Sets the HOST_CPU variable to the canonical name of the CPU. +dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its +dnl C language ABI (application binary interface). +dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in +dnl config.h. +dnl +dnl This canonical name can be used to select a particular assembly language +dnl source file that will interoperate with C code on the given host. +dnl +dnl For example: +dnl * 'i386' and 'sparc' are different canonical names, because code for i386 +dnl will not run on SPARC CPUs and vice versa. They have different +dnl instruction sets. +dnl * 'sparc' and 'sparc64' are different canonical names, because code for +dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code +dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit +dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit +dnl mode, but not both. +dnl * 'mips' and 'mipsn32' are different canonical names, because they use +dnl different argument passing and return conventions for C functions, and +dnl although the instruction set of 'mips' is a large subset of the +dnl instruction set of 'mipsn32'. +dnl * 'mipsn32' and 'mips64' are different canonical names, because they use +dnl different sizes for the C types like 'int' and 'void *', and although +dnl the instruction sets of 'mipsn32' and 'mips64' are the same. +dnl * The same canonical name is used for different endiannesses. You can +dnl determine the endianness through preprocessor symbols: +dnl - 'arm': test __ARMEL__. +dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. +dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN. +dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 +dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because +dnl - Instructions that do not exist on all of these CPUs (cmpxchg, +dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your +dnl assembly language source files use such instructions, you will +dnl need to make the distinction. +dnl - Speed of execution of the common instruction set is reasonable across +dnl the entire family of CPUs. If you have assembly language source files +dnl that are optimized for particular CPU types (like GNU gmp has), you +dnl will need to make the distinction. +dnl See . +AC_DEFUN([gl_HOST_CPU_C_ABI], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_C_ASM]) + AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], + [case "$host_cpu" in + +changequote(,)dnl + i[34567]86 ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=i386 + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) + int ok; + #else + error fail + #endif + ]])], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=x86_64-x32], + [gl_cv_host_cpu_c_abi=x86_64])], + [gl_cv_host_cpu_c_abi=i386]) + ;; + +changequote(,)dnl + alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=alpha + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef __aarch64__ + int ok; + #else + error fail + #endif + ]])], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=arm64-ilp32], + [gl_cv_host_cpu_c_abi=arm64])], + [# Don't distinguish little-endian and big-endian arm, since they + # don't require different machine code for simple operations and + # since the user can distinguish them through the preprocessor + # defines __ARMEL__ vs. __ARMEB__. + # But distinguish arm which passes floating-point arguments and + # return values in integer registers (r0, r1, ...) - this is + # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which + # passes them in float registers (s0, s1, ...) and double registers + # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer + # sets the preprocessor defines __ARM_PCS (for the first case) and + # __ARM_PCS_VFP (for the second case), but older GCC does not. + echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c + # Look for a reference to the register d0 in the .s file. + AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 + if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then + gl_cv_host_cpu_c_abi=armhf + else + gl_cv_host_cpu_c_abi=arm + fi + rm -f conftest* + ]) + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef __LP64__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=hppa64], + [gl_cv_host_cpu_c_abi=hppa]) + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=ia64-ilp32], + [gl_cv_host_cpu_c_abi=ia64]) + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=mips64], + [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIN32. + # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIO32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if (_MIPS_SIM == _ABIN32) + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=mipsn32], + [gl_cv_host_cpu_c_abi=mips])]) + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + ]])], + [# On powerpc64, there are two ABIs on Linux: The AIX compatible + # one and the ELFv2 one. The latter defines _CALL_ELF=2. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined _CALL_ELF && _CALL_ELF == 2 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=powerpc64-elfv2], + [gl_cv_host_cpu_c_abi=powerpc64]) + ], + [gl_cv_host_cpu_c_abi=powerpc]) + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi=powerpc + ;; + + riscv32 | riscv64 ) + # There are 2 architectures (with variants): rv32* and rv64*. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if __riscv_xlen == 64 + int ok; + #else + error fail + #endif + ]])], + [cpu=riscv64], + [cpu=riscv32]) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ + int ok; + #else + error fail + #endif + ]])], + [main_abi=lp64], + [main_abi=ilp32]) + # Float ABIs: + # __riscv_float_abi_double: + # 'float' and 'double' are passed in floating-point registers. + # __riscv_float_abi_single: + # 'float' are passed in floating-point registers. + # __riscv_float_abi_soft: + # No values are passed in floating-point registers. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __riscv_float_abi_double + int ok; + #else + error fail + #endif + ]])], + [float_abi=d], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __riscv_float_abi_single + int ok; + #else + error fail + #endif + ]])], + [float_abi=f], + [float_abi='']) + ]) + gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=s390x], + [gl_cv_host_cpu_c_abi=s390]) + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=sparc64], + [gl_cv_host_cpu_c_abi=sparc]) + ;; + + *) + gl_cv_host_cpu_c_abi="$host_cpu" + ;; + esac + ]) + + dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. + HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` + HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" + AC_SUBST([HOST_CPU]) + AC_SUBST([HOST_CPU_C_ABI]) + + # This was + # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) + # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) + # earlier, but KAI C++ 3.2d doesn't like this. + sed -e 's/-/_/g' >> confdefs.h < -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" @@ -58,33 +67,43 @@ ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ - dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi - AC_TRY_RUN([ + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include -int main () -{ + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\342\202\254"; /* EURO SIGN */ + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 1; + iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from @@ -93,17 +112,37 @@ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { - static const char input[] = "\263"; + static ICONV_CONST char input[] = "\263"; char buf[10]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) - return 1; + result |= 2; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 4; + iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ @@ -112,37 +151,53 @@ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; - const char *inptr = input; + ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, + &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) - return 1; + result |= 8; + iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], - [case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac]) + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in @@ -183,32 +238,51 @@ m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])) + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(__cplusplus) +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif -], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) + ]], + [[]])], + [am_cv_proto_iconv_arg1=""], + [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) - AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], - [Define as const if the declaration of iconv() needs const.]) + else + dnl When compiling GNU libiconv on a system that does not have iconv yet, + dnl pick the POSIX compliant declaration without 'const'. + am_cv_proto_iconv_arg1="" fi + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) ]) diff -Nru libbde-20190102/m4/intlmacosx.m4 libbde-20240223/m4/intlmacosx.m4 --- libbde-20190102/m4/intlmacosx.m4 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/m4/intlmacosx.m4 2023-12-03 08:57:24.000000000 +0000 @@ -1,50 +1,64 @@ -# intlmacosx.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. +# intlmacosx.m4 serial 8 (gettext-0.20.2) +dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. -dnl Checks for special options needed on MacOS X. +dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ - dnl Check for API introduced in MacOS X 10.2. + dnl Check for API introduced in Mac OS X 10.4. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - AC_TRY_LINK([#include ], - [CFPreferencesCopyAppValue(NULL, NULL)], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], - [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi - dnl Check for API introduced in MacOS X 10.3. - AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], + dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, + dnl because in macOS 10.13.4 it has the following behaviour: + dnl When two or more languages are specified in the + dnl "System Preferences > Language & Region > Preferred Languages" panel, + dnl it returns en_CC where CC is the territory (even when English is not among + dnl the preferred languages!). What we want instead is what + dnl CFLocaleCopyCurrent returned in earlier macOS releases and what + dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the + dnl first among the preferred languages and CC is the territory. + AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], - [gt_cv_func_CFLocaleCopyCurrent=yes], - [gt_cv_func_CFLocaleCopyCurrent=no]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFLocaleCopyPreferredLanguages();]])], + [gt_cv_func_CFLocaleCopyPreferredLanguages=yes], + [gt_cv_func_CFLocaleCopyPreferredLanguages=no]) LIBS="$gt_save_LIBS"]) - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], - [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1], + [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) diff -Nru libbde-20190102/m4/lib-ld.m4 libbde-20240223/m4/lib-ld.m4 --- libbde-20190102/m4/lib-ld.m4 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/m4/lib-ld.m4 2023-12-03 08:57:24.000000000 +0000 @@ -1,110 +1,168 @@ -# lib-ld.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. +# lib-ld.m4 serial 9 +dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac + +if test -n "$LD"; then + AC_MSG_CHECKING([for ld]) +elif test "$GCC" = yes; then + AC_MSG_CHECKING([for ld used by $CC]) elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL([acl_cv_path_LD], -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + AC_CACHE_VAL([acl_cv_path_LD], + [ + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; esac fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) + dnl Complain if config.rpath is missing. + AC_REQUIRE_AUX_FILE([config.rpath]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host @@ -157,15 +160,15 @@ dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, - m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) @@ -178,23 +181,23 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) - pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) - pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) - dnl Autoconf >= 2.61 supports dots in --with options. - pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) - AC_ARG_WITH(P_A_C_K[-prefix], -[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib - --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], + AC_ARG_WITH(PACK[-prefix], +[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib + --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no @@ -203,17 +206,23 @@ AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" fi fi ]) + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= @@ -242,7 +251,7 @@ names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then @@ -269,48 +278,54 @@ shrext= fi if test $use_additional = yes; then - dir="$additional_libdir" - dnl The same code as in the loop below: - dnl First look for a shared library. - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" - found_so="$dir/$f" - break + found_a="$dir/$libname.$acl_libext" fi - done + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi fi fi - fi - dnl Then look for a static library. - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi + done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do @@ -320,7 +335,7 @@ dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else @@ -330,14 +345,14 @@ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do - if test -f "$dir/$f"; then + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break @@ -348,7 +363,7 @@ fi dnl Then look for a static library. if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi @@ -374,7 +389,8 @@ dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else @@ -474,6 +490,13 @@ fi additional_includedir="$basedir/include" ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. @@ -524,19 +547,21 @@ for dep in $dependency_libs; do case "$dep" in -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -547,29 +572,29 @@ haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + dnl Really add $dependency_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + dnl Really add $dependency_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir" fi fi fi @@ -667,7 +692,6 @@ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi - popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) @@ -718,7 +742,8 @@ dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ - && test "X$dir" != "X/usr/$acl_libdirstem2"; then + && test "X$dir" != "X/usr/$acl_libdirstem2" \ + && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= @@ -728,7 +753,8 @@ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ - && test "X$dir" != "X/usr/$acl_libdirstem2"; then + && test "X$dir" != "X/usr/$acl_libdirstem2" \ + && test "X$dir" != "X/usr/$acl_libdirstem3"; then rpathdirs="$rpathdirs $dir" fi next= ;; diff -Nru libbde-20190102/m4/lib-prefix.m4 libbde-20240223/m4/lib-prefix.m4 --- libbde-20190102/m4/lib-prefix.m4 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/m4/lib-prefix.m4 2023-12-03 08:57:24.000000000 +0000 @@ -1,18 +1,11 @@ -# lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. +# lib-prefix.m4 serial 17 +dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed @@ -32,9 +25,9 @@ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], + AC_ARG_WITH([lib-prefix], +[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no @@ -154,71 +147,174 @@ ]) dnl AC_LIB_PREPARE_MULTILIB creates -dnl - a variable acl_libdirstem, containing the basename of the libdir, either -dnl "lib" or "lib64" or "lib/64", -dnl - a variable acl_libdirstem2, as a secondary possible value for -dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or -dnl "lib/amd64". +dnl - a function acl_is_expected_elfclass, that tests whether standard input +dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, +dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing +dnl the basename of the libdir to try in turn, either "lib" or "lib64" or +dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ - dnl There is no formal standard regarding lib and lib64. - dnl On glibc systems, the current practice is that on a system supporting + dnl There is no formal standard regarding lib, lib32, and lib64. + dnl On most glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under - dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine - dnl the compiler's default mode by looking at the compiler's library search - dnl path. If at least one of its elements ends in /lib64 or points to a - dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. - dnl Otherwise we use the default, namely "lib". + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on + dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go + dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. + dnl We determine the compiler's default mode by looking at the compiler's + dnl library search path. If at least one of its elements ends in /lib64 or + dnl points to a directory whose absolute pathname ends in /lib64, we use that + dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, + dnl namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment - dnl . - dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." - dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the - dnl symlink is missing, so we set acl_libdirstem2 too. - AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], - [AC_EGREP_CPP([sixtyfour bits], [ -#ifdef _LP64 -sixtyfour bits -#endif - ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) - ]) - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) + + AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], + [AC_EGREP_CPP([Extensible Linking Format], + [#ifdef __ELF__ + Extensible Linking Format + #endif + ], + [gl_cv_elf=yes], + [gl_cv_elf=no]) + ]) + if test $gl_cv_elf; then + # Extract the ELF class of a file (5th byte) in decimal. + # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header + if od -A x < /dev/null >/dev/null 2>/dev/null; then + # Use POSIX od. + func_elfclass () + { + od -A n -t d1 -j 4 -N 1 + } + else + # Use BSD hexdump. + func_elfclass () + { + dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' + echo + } + fi +changequote(,)dnl + case $HOST_CPU_C_ABI_32BIT in + yes) + # 32-bit ABI. + acl_is_expected_elfclass () + { + test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 + } + ;; + no) + # 64-bit ABI. + acl_is_expected_elfclass () + { + test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 + } + ;; + *) + # Unknown. + acl_is_expected_elfclass () + { + : + } + ;; + esac +changequote([,])dnl + else + acl_is_expected_elfclass () + { + : + } + fi + + dnl Allow the user to override the result by setting acl_cv_libdirstems. + AC_CACHE_CHECK([for the common suffixes of directories in the library search path], + [acl_cv_libdirstems], + [dnl Try 'lib' first, because that's the default for libdir in GNU, see + dnl . + acl_libdirstem=lib + acl_libdirstem2= + acl_libdirstem3= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + if test $HOST_CPU_C_ABI_32BIT = no; then + acl_libdirstem2=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem3=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; + esac + fi + ;; + *) + dnl If $CC generates code for a 32-bit ABI, the libraries are + dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. + dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries + dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. + dnl Find the compiler's search path. However, non-system compilers + dnl sometimes have odd library search paths. But we can't simply invoke + dnl '/usr/bin/gcc -print-search-dirs' because that would not take into + dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. + searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test $HOST_CPU_C_ABI_32BIT != no; then + # 32-bit or unknown ABI. + if test -d /usr/lib32; then + acl_libdirstem2=lib32 + fi + fi + if test $HOST_CPU_C_ABI_32BIT != yes; then + # 64-bit or unknown ABI. + if test -d /usr/lib64; then + acl_libdirstem3=lib64 + fi + fi + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; + */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib32 ) acl_libdirstem2=lib32 ;; + */lib64 ) acl_libdirstem3=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + if test $HOST_CPU_C_ABI_32BIT = yes; then + # 32-bit ABI. + acl_libdirstem3= + fi + if test $HOST_CPU_C_ABI_32BIT = no; then + # 64-bit ABI. + acl_libdirstem2= + fi + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" + ]) + dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and + dnl acl_libdirstem3. +changequote(,)dnl + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` + acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` +changequote([,])dnl ]) diff -Nru libbde-20190102/m4/libbfio.m4 libbde-20240223/m4/libbfio.m4 --- libbde-20190102/m4/libbfio.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libbfio.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libbfio required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20201125 dnl Function to detect if libbfio is available dnl ac_libbfio_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libbfio" = xno], [ac_cv_libbfio=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libbfio=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libbfio" != x && test "x$ac_cv_with_libbfio" != xauto-detect], [AS_IF( @@ -19,13 +20,13 @@ [no such directory: $ac_cv_with_libbfio], [1]) ]) - ac_cv_libbfio=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libbfio], - [libbfio >= 20160108], + [libbfio >= 20201125], [ac_cv_libbfio=yes], [ac_cv_libbfio=check]) ]) @@ -101,11 +102,21 @@ [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, + libbfio_handle_read_buffer_at_offset, + [ac_cv_libbfio_dummy=yes], + [ac_cv_libbfio=no]) + AC_CHECK_LIB( + bfio, libbfio_handle_write_buffer, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, + libbfio_handle_write_buffer_at_offset, + [ac_cv_libbfio_dummy=yes], + [ac_cv_libbfio=no]) + AC_CHECK_LIB( + bfio, libbfio_handle_seek_offset, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) @@ -262,11 +273,21 @@ [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, + libbfio_pool_read_buffer_at_offset, + [ac_cv_libbfio_dummy=yes], + [ac_cv_libbfio=no]) + AC_CHECK_LIB( + bfio, libbfio_pool_write_buffer, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) AC_CHECK_LIB( bfio, + libbfio_pool_write_buffer_at_offset, + [ac_cv_libbfio_dummy=yes], + [ac_cv_libbfio=no]) + AC_CHECK_LIB( + bfio, libbfio_pool_seek_offset, [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) @@ -281,6 +302,22 @@ [ac_cv_libbfio_dummy=yes], [ac_cv_libbfio=no]) + dnl File pool functions + AC_CHECK_LIB( + bfio, + libbfio_file_pool_open, + [ac_cv_libbfio_dummy=yes], + [ac_cv_libbfio=no]) + + AS_IF( + [test "x$ac_cv_enable_wide_character_type" != xno], + [AC_CHECK_LIB( + bfio, + libbfio_file_pool_open_wide, + [ac_cv_libbfio_dummy=yes], + [ac_cv_libbfio=no]) + ]) + ac_cv_libbfio_LIBADD="-lbfio"]) ]) AS_IF( diff -Nru libbde-20190102/m4/libcaes.m4 libbde-20240223/m4/libcaes.m4 --- libbde-20190102/m4/libcaes.m4 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/m4/libcaes.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcaes required headers and functions dnl -dnl Version: 20190102 +dnl Version: 20220529 dnl Function to detect if libcaes is available dnl ac_libcaes_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcaes" = xno], [ac_cv_libcaes=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcaes=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcaes" != x && test "x$ac_cv_with_libcaes" != xauto-detect], [AS_IF( @@ -19,13 +20,13 @@ [no such directory: $ac_cv_with_libcaes], [1]) ]) - ac_cv_libcaes=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcaes], - [libcaes >= 20161025], + [libcaes >= 20220529], [ac_cv_libcaes=yes], [ac_cv_libcaes=check]) ]) diff -Nru libbde-20190102/m4/libcdata.m4 libbde-20240223/m4/libcdata.m4 --- libbde-20190102/m4/libcdata.m4 2018-12-24 14:55:21.000000000 +0000 +++ libbde-20240223/m4/libcdata.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcdata required headers and functions dnl -dnl Version: 20181216 +dnl Version: 20230108 dnl Function to detect if libcdata is available dnl ac_libcdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcdata" = xno], [ac_cv_libcdata=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcdata=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcdata" != x && test "x$ac_cv_with_libcdata" != xauto-detect], [AS_IF( @@ -19,13 +20,13 @@ [no such directory: $ac_cv_with_libcdata], [1]) ]) - ac_cv_libcdata=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libcdata], - [libcdata >= 20181216], + [libcdata >= 20230108], [ac_cv_libcdata=yes], [ac_cv_libcdata=check]) ]) @@ -127,7 +128,7 @@ dnl Balanced tree functions AC_CHECK_LIB( cdata, - libfdata_btree_initialize, + libcdata_btree_initialize, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( @@ -239,11 +240,21 @@ [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, + libcdata_list_insert_element_with_existing, + [ac_cv_libcdata_dummy=yes], + [ac_cv_libcdata=no]) + AC_CHECK_LIB( + cdata, libcdata_list_insert_value, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( cdata, + libcdata_list_insert_value_with_existing, + [ac_cv_libcdata_dummy=yes], + [ac_cv_libcdata=no]) + AC_CHECK_LIB( + cdata, libcdata_list_remove_element, [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) @@ -357,6 +368,11 @@ [ac_cv_libcdata_dummy=yes], [ac_cv_libcdata=no]) AC_CHECK_LIB( + cdata, + libcdata_range_list_range_has_overlapping_range, + [ac_cv_libcdata_dummy=yes], + [ac_cv_libcdata=no]) + AC_CHECK_LIB( cdata, libcdata_range_list_get_spanning_range, [ac_cv_libcdata_dummy=yes], diff -Nru libbde-20190102/m4/libcerror.m4 libbde-20240223/m4/libcerror.m4 --- libbde-20190102/m4/libcerror.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libcerror.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcerror required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libcerror is available dnl ac_libcerror_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcerror" = xno], [ac_cv_libcerror=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcerror=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcerror" != x && test "x$ac_cv_with_libcerror" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libcerror], [1]) ]) - ac_cv_libcerror=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libcfile.m4 libbde-20240223/m4/libcfile.m4 --- libbde-20190102/m4/libcfile.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libcfile.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcfile required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libcfile is available dnl ac_libcfile_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcfile" = xno], [ac_cv_libcfile=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcfile=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcfile" != x && test "x$ac_cv_with_libcfile" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libcfile], [1]) ]) - ac_cv_libcfile=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libclocale.m4 libbde-20240223/m4/libclocale.m4 --- libbde-20190102/m4/libclocale.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libclocale.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libclocale required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libclocale is available dnl ac_libclocale_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libclocale" = xno], [ac_cv_libclocale=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libclocale=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libclocale" != x && test "x$ac_cv_with_libclocale" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libclocale], [1]) ]) - ac_cv_libclocale=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libcnotify.m4 libbde-20240223/m4/libcnotify.m4 --- libbde-20190102/m4/libcnotify.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libcnotify.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcnotify required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libcnotify is available dnl ac_libcnotify_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcnotify" = xno], [ac_cv_libcnotify=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcnotify=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcnotify" != x && test "x$ac_cv_with_libcnotify" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libcnotify], [1]) ]) - ac_cv_libcnotify=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libcpath.m4 libbde-20240223/m4/libcpath.m4 --- libbde-20190102/m4/libcpath.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libcpath.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcpath required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libcpath is available dnl ac_libcpath_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcpath" = xno], [ac_cv_libcpath=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcpath=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcpath" != x && test "x$ac_cv_with_libcpath" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libcpath], [1]) ]) - ac_cv_libcpath=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libcrypto.m4 libbde-20240223/m4/libcrypto.m4 --- libbde-20190102/m4/libcrypto.m4 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/m4/libcrypto.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcrypto required headers and functions dnl -dnl Version: 20190102 +dnl Version: 20231007 dnl Function to detect whether openssl/evp.h can be used in combination with zlib.h AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP_ZLIB_COMPATIBILE], @@ -18,6 +18,47 @@ AC_LANG_POP(C)]) ]) +dnl Function to detect whether EVP_CipherInit_ex can be used with duplicate keys. +AC_DEFUN([AX_LIBCRYPTO_CHECK_XTS_DUPLICATE_KEYS_SUPPORT], + [AC_CACHE_CHECK( + [if `EVP_CipherInit_ex' can be used with duplicate keys], + [ac_cv_openssl_xts_duplicate_keys], + [AC_LANG_PUSH(C) + ac_cv_libcrypto_backup_LIBS="$LIBS" + LIBS="$LIBS $ac_cv_libcrypto_LIBADD" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +#include +#include ]], + [[unsigned char key[ 16 ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; +int result = 0; + +#if defined( HAVE_EVP_CIPHER_CTX_INIT ) +EVP_CIPHER_CTX ctx; + +EVP_CIPHER_CTX_init( &ctx ); +#else +EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); +#endif + +result = EVP_CipherInit_ex(ctx, EVP_aes_128_xts(), NULL, key, key, 0); + +#if defined( HAVE_EVP_CIPHER_CTX_INIT ) +EVP_CIPHER_CTX_cleanup( &ctx ); +#else +EVP_CIPHER_CTX_free( ctx ); +#endif + +if( result != 1 ) return( EXIT_FAILURE ); + +return( EXIT_SUCCESS ); ]] )], + [ac_cv_openssl_xts_duplicate_keys=yes], + [ac_cv_openssl_xts_duplicate_keys=no]) + LIBS="$ac_cv_libcrypto_backup_LIBS" + AC_LANG_POP(C)]) + ]) + dnl Function to detect if libcrypto (openssl) EVP functions are available AC_DEFUN([AX_LIBCRYPTO_CHECK_OPENSSL_EVP], [AC_CHECK_HEADERS([openssl/evp.h]) @@ -77,9 +118,36 @@ AC_CHECK_LIB( crypto, - EVP_DigestInit_ex, + EVP_DigestInit_ex2, [ac_cv_libcrypto_dummy=yes], - [ac_cv_libcrypto_evp_md=no]) + [ac_cv_libcrypto_dummy=no]) + + AS_IF( + [test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes], + [dnl Check for OpenSSL 3 API functions + AC_CHECK_LIB( + crypto, + EVP_MD_CTX_reset, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_md=no]) + AC_CHECK_LIB( + crypto, + EVP_MD_fetch, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_md=no]) + AC_CHECK_LIB( + crypto, + EVP_MD_free, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_md=no]) + ], + [AC_CHECK_LIB( + crypto, + EVP_DigestInit_ex, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_md=no]) + ]) + AC_CHECK_LIB( crypto, EVP_DigestUpdate, @@ -92,7 +160,7 @@ [ac_cv_libcrypto_evp_md=no]) AS_IF( - [test "x$ac_cv_enable_openssl_evp_md" = xyes && "x$ac_cv_libcrypto_evp_md" = xno], + [test "x$ac_cv_enable_openssl_evp_md" = xyes && test "x$ac_cv_libcrypto_evp_md" = xno], [AC_MSG_FAILURE( [Missing OpenSSL EVP MD support], [1]) @@ -113,6 +181,14 @@ [1], [Define to 1 if you have the `EVP_MD_CTX_cleanup' function".]) ]) + + AS_IF( + [test "x$ac_cv_lib_crypto_EVP_DigestInit_ex2" = xyes], + [AC_DEFINE( + [HAVE_EVP_DIGESTINIT_EX2], + [1], + [Define to 1 if you have the `EVP_DigestInit_ex2' function".]) + ]) ]) dnl Function to detect if openssl EVP MD5 functions are available @@ -396,15 +472,41 @@ AC_CHECK_LIB( crypto, - EVP_CIPHER_CTX_set_padding, + EVP_CipherInit_ex2, [ac_cv_libcrypto_dummy=yes], - [ac_cv_libcrypto_evp_cipher=no]) + [ac_cv_libcrypto_dummy=no]) + + AS_IF( + [test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes], + [dnl Check for OpenSSL 3 API functions + AC_CHECK_LIB( + crypto, + EVP_CIPHER_CTX_reset, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + AC_CHECK_LIB( + crypto, + EVP_CIPHER_fetch, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + AC_CHECK_LIB( + crypto, + EVP_CIPHER_free, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + ], + [AC_CHECK_LIB( + crypto, + EVP_CipherInit_ex, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + AC_CHECK_LIB( + crypto, + EVP_CIPHER_CTX_set_padding, + [ac_cv_libcrypto_dummy=yes], + [ac_cv_libcrypto_evp_cipher=no]) + ]) - AC_CHECK_LIB( - crypto, - EVP_CipherInit_ex, - [ac_cv_libcrypto_dummy=yes], - [ac_cv_libcrypto_evp_cipher=no]) AC_CHECK_LIB( crypto, EVP_CipherUpdate, @@ -417,7 +519,7 @@ [ac_cv_libcrypto_evp_cipher=no]) AS_IF( - [test "x$ac_cv_enable_openssl_evp_cipher" = xyes && "x$ac_cv_libcrypto_evp_cipher" = xno], + [test "x$ac_cv_enable_openssl_evp_cipher" = xyes && test "x$ac_cv_libcrypto_evp_cipher" = xno], [AC_MSG_FAILURE( [Missing OpenSSL EVP CIPHER support], [1]) @@ -438,6 +540,14 @@ [1], [Define to 1 if you have the `EVP_CIPHER_CTX_cleanup' function".]) ]) + + AS_IF( + [test "x$ac_cv_lib_crypto_EVP_CipherInit_ex2" = xyes], + [AC_DEFINE( + [HAVE_EVP_CIPHERINIT_EX2], + [1], + [Define to 1 if you have the `EVP_CipherInit_ex2' function".]) + ]) ]) dnl Function to detect if openssl AES-CBC and AES-ECB functions are available @@ -574,7 +684,18 @@ [1], [Define to 1 if you have the 'crypto' library (-lcrypto).]) - ac_cv_libcrypto_LIBADD="-lcrypto" + ac_cv_libcrypto_CPPFLAGS="$openssl_CFLAGS" + ac_cv_libcrypto_LIBADD="$openssl_LIBS" + + AS_IF( + [test "x$ac_cv_libcrypto_LIBADD" = x], + [ac_cv_libcrypto_LIBADD="-lcrypto"]) + + dnl On Cygwin also link zlib since libcrypto relies on it + AS_CASE( + [$host], + [*cygwin*], + [ac_cv_libcrypto_LIBADD="$ac_cv_libcrypto_LIBADD -lz"]) dnl Enforce the dynamic loader library to be included if available AC_CHECK_LIB( @@ -802,12 +923,18 @@ [ac_cv_libcrypto_dummy=yes], [ac_cv_libcrypto_aes_xts=no]) + dnl OpenSSL 1.1.1c will error with "xts duplicated keys". + AX_LIBCRYPTO_CHECK_XTS_DUPLICATE_KEYS_SUPPORT AS_IF( - [test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes], - [AC_DEFINE( - [HAVE_EVP_CRYPTO_AES_XTS], - [1], - [Define to 1 if you have the `EVP_aes_128_xts' and `EVP_aes_256_xts' functions".]) + [test "x$ac_cv_openssl_xts_duplicate_keys" = xno], + [ac_cv_libcrypto_aes_xts=no], + [AS_IF( + [test "x$ac_cv_lib_crypto_EVP_aes_128_xts" = xyes && test "x$ac_cv_lib_crypto_EVP_aes_256_xts" = xyes], + [AC_DEFINE( + [HAVE_EVP_CRYPTO_AES_XTS], + [1], + [Define to 1 if you have the `EVP_aes_128_xts' and `EVP_aes_256_xts' functions".]) + ]) ]) ]) ]) @@ -833,8 +960,10 @@ [enable OpenSSL EVP MD support, or no to disable], [auto-detect]) - dnl Check for a shared library version - AX_LIBCRYPTO_CHECK_LIB + AS_IF( + [test "x$ac_cv_enable_static_executables" != xyes], + [dnl Check for a shared library version + AX_LIBCRYPTO_CHECK_LIB]) AS_IF( [test "x$ac_cv_libcrypto_CPPFLAGS" != "x"], diff -Nru libbde-20190102/m4/libcsplit.m4 libbde-20240223/m4/libcsplit.m4 --- libbde-20190102/m4/libcsplit.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libcsplit.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcsplit required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libcsplit is available dnl ac_libcsplit_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcsplit" = xno], [ac_cv_libcsplit=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcsplit=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcsplit" != x && test "x$ac_cv_with_libcsplit" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libcsplit], [1]) ]) - ac_cv_libcsplit=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libcthreads.m4 libbde-20240223/m4/libcthreads.m4 --- libbde-20190102/m4/libcthreads.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libcthreads.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libcthreads required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libcthreads is available dnl ac_libcthreads_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libcthreads" = xno], [ac_cv_libcthreads=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libcthreads=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libcthreads" != x && test "x$ac_cv_with_libcthreads" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libcthreads], [1]) ]) - ac_cv_libcthreads=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libfcache.m4 libbde-20240223/m4/libfcache.m4 --- libbde-20190102/m4/libfcache.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libfcache.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libfcache required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20230115 dnl Function to detect if libfcache is available dnl ac_libfcache_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfcache" = xno], [ac_cv_libfcache=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libfcache=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfcache" != x && test "x$ac_cv_with_libfcache" != xauto-detect], [AS_IF( @@ -19,13 +20,13 @@ [no such directory: $ac_cv_with_libfcache], [1]) ]) - ac_cv_libfcache=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libfcache], - [libfcache >= 20181010], + [libfcache >= 20191109], [ac_cv_libfcache=yes], [ac_cv_libfcache=check]) ]) @@ -85,6 +86,11 @@ [ac_cv_libfcache=no]) AC_CHECK_LIB( fcache, + libfcache_cache_clear_value_by_index, + [ac_cv_libfcache_dummy=yes], + [ac_cv_libfcache=no]) + AC_CHECK_LIB( + fcache, libfcache_cache_get_value_by_identifier, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) @@ -107,6 +113,11 @@ dnl Cache value functions AC_CHECK_LIB( fcache, + libfcache_cache_value_free, + [ac_cv_libfcache_dummy=yes], + [ac_cv_libfcache=no]) + AC_CHECK_LIB( + fcache, libfcache_cache_value_clear, [ac_cv_libfcache_dummy=yes], [ac_cv_libfcache=no]) @@ -173,7 +184,7 @@ AC_STRUCT_TM dnl Headers included in libfcache/libfcache_date_time.h - AC_HEADER_TIME + AC_CHECK_HEADERS([sys/time.h]) dnl Date and time functions used in libfcache/libfcache_date_time.h AC_CHECK_FUNCS([clock_gettime time]) diff -Nru libbde-20190102/m4/libfdata.m4 libbde-20240223/m4/libfdata.m4 --- libbde-20190102/m4/libfdata.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libfdata.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,549 +0,0 @@ -dnl Functions for libfdata -dnl -dnl Version: 20181117 - -dnl Function to detect if libfdata is available -dnl ac_libfdata_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments -AC_DEFUN([AX_LIBFDATA_CHECK_LIB], - [AS_IF( - [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdata" = xno], - [ac_cv_libfdata=no], - [dnl Check if the directory provided as parameter exists - AS_IF( - [test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect], - [AS_IF( - [test -d "$ac_cv_with_libfdata"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfdata}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfdata}/lib"], - [AC_MSG_FAILURE( - [no such directory: $ac_cv_with_libfdata], - [1]) - ]) - ac_cv_libfdata=check], - [dnl Check for a pkg-config file - AS_IF( - [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], - [PKG_CHECK_MODULES( - [libfdata], - [libfdata >= 20181009], - [ac_cv_libfdata=yes], - [ac_cv_libfdata=check]) - ]) - AS_IF( - [test "x$ac_cv_libfdata" = xyes], - [ac_cv_libfdata_CPPFLAGS="$pkg_cv_libfdata_CFLAGS" - ac_cv_libfdata_LIBADD="$pkg_cv_libfdata_LIBS"]) - ]) - - AS_IF( - [test "x$ac_cv_libfdata" = xcheck], - [dnl Check for headers - AC_CHECK_HEADERS([libfdata.h]) - - AS_IF( - [test "x$ac_cv_header_libfdata_h" = xno], - [ac_cv_libfdata=no], - [dnl Check for the individual functions - ac_cv_libfdata=yes - - AC_CHECK_LIB( - fdata, - libfdata_get_version, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Area functions - AC_CHECK_LIB( - fdata, - libfdata_area_initialize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_free, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_clone, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_empty, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_resize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_number_of_segments, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_set_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_prepend_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_append_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_element_data_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_set_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_area_get_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Balanced tree functions - dnl TODO: add functions - - dnl List functions - AC_CHECK_LIB( - fdata, - libfdata_list_initialize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_free, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_clone, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_empty, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_resize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_reverse, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_number_of_elements, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_list_element_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_prepend_element, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_append_element, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_append_list, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_is_element_set, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_mapped_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_mapped_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_mapped_size_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_mapped_size_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_by_index_with_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_by_index_with_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_append_element_with_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_index_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_list_element_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_cache_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_value_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_value_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_set_element_value_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_get_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl List element functions - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_get_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_list_element_set_element_value, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Range list functions - dnl TODO: add functions - - dnl Stream functions - AC_CHECK_LIB( - fdata, - libfdata_stream_initialize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_free, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_clone, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_empty, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_resize, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_reverse, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_get_number_of_segments, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_set_segment_by_index, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_prepend_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_append_segment, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_set_mapped_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_mapped_range, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_index_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_segment_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - AC_CHECK_LIB( - fdata, - libfdata_stream_read_buffer, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_read_buffer_at_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_write_buffer, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_seek_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_offset, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - AC_CHECK_LIB( - fdata, - libfdata_stream_get_size, - [ac_cv_libfdata_dummy=yes], - [ac_cv_libfdata=no]) - - dnl Tree list functions - dnl TODO: add functions - - dnl Vector list functions - dnl TODO: add functions - - ac_cv_libfdata_LIBADD="-lfdata"]) - ]) - AS_IF( - [test "x$ac_cv_with_libfdata" != x && test "x$ac_cv_with_libfdata" != xauto-detect && test "x$ac_cv_libfdata" != xyes], - [AC_MSG_FAILURE( - [unable to find supported libfdata in directory: $ac_cv_with_libfdata], - [1]) - ]) - ]) - - AS_IF( - [test "x$ac_cv_libfdata" = xyes], - [AC_DEFINE( - [HAVE_LIBFDATA], - [1], - [Define to 1 if you have the `fdata' library (-lfdata).]) - ]) - - AS_IF( - [test "x$ac_cv_libfdata" = xyes], - [AC_SUBST( - [HAVE_LIBFDATA], - [1]) ], - [AC_SUBST( - [HAVE_LIBFDATA], - [0]) - ]) - ]) - -dnl Function to detect if libfdata dependencies are available -AC_DEFUN([AX_LIBFDATA_CHECK_LOCAL], - [dnl No additional checks. - - ac_cv_libfdata_CPPFLAGS="-I../libfdata"; - ac_cv_libfdata_LIBADD="../libfdata/libfdata.la"; - - ac_cv_libfdata=local - ]) - -dnl Function to detect how to enable libfdata -AC_DEFUN([AX_LIBFDATA_CHECK_ENABLE], - [AX_COMMON_ARG_WITH( - [libfdata], - [libfdata], - [search for libfdata in includedir and libdir or in the specified DIR, or no if to use local version], - [auto-detect], - [DIR]) - - dnl Check for a shared library version - AX_LIBFDATA_CHECK_LIB - - dnl Check if the dependencies for the local library version - AS_IF( - [test "x$ac_cv_libfdata" != xyes], - [AX_LIBFDATA_CHECK_LOCAL - - AC_DEFINE( - [HAVE_LOCAL_LIBFDATA], - [1], - [Define to 1 if the local version of libfdata is used.]) - AC_SUBST( - [HAVE_LOCAL_LIBFDATA], - [1]) - ]) - - AM_CONDITIONAL( - [HAVE_LOCAL_LIBFDATA], - [test "x$ac_cv_libfdata" = xlocal]) - AS_IF( - [test "x$ac_cv_libfdata_CPPFLAGS" != "x"], - [AC_SUBST( - [LIBFDATA_CPPFLAGS], - [$ac_cv_libfdata_CPPFLAGS]) - ]) - AS_IF( - [test "x$ac_cv_libfdata_LIBADD" != "x"], - [AC_SUBST( - [LIBFDATA_LIBADD], - [$ac_cv_libfdata_LIBADD]) - ]) - - AS_IF( - [test "x$ac_cv_libfdata" = xyes], - [AC_SUBST( - [ax_libfdata_pc_libs_private], - [-lfdata]) - ]) - - AS_IF( - [test "x$ac_cv_libfdata" = xyes], - [AC_SUBST( - [ax_libfdata_spec_requires], - [libfdata]) - AC_SUBST( - [ax_libfdata_spec_build_requires], - [libfdata-devel]) - ]) - ]) diff -Nru libbde-20190102/m4/libfdatetime.m4 libbde-20240223/m4/libfdatetime.m4 --- libbde-20190102/m4/libfdatetime.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libfdatetime.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libfdatetime required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libfdatetime is available dnl ac_libfdatetime_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfdatetime" = xno], [ac_cv_libfdatetime=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libfdatetime=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfdatetime" != x && test "x$ac_cv_with_libfdatetime" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libfdatetime], [1]) ]) - ac_cv_libfdatetime=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libfguid.m4 libbde-20240223/m4/libfguid.m4 --- libbde-20190102/m4/libfguid.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libfguid.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libfguid required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20190308 dnl Function to detect if libfguid is available dnl ac_libfguid_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfguid" = xno], [ac_cv_libfguid=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libfguid=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfguid" != x && test "x$ac_cv_with_libfguid" != xauto-detect], [AS_IF( @@ -19,7 +20,7 @@ [no such directory: $ac_cv_with_libfguid], [1]) ]) - ac_cv_libfguid=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], diff -Nru libbde-20190102/m4/libfuse.m4 libbde-20240223/m4/libfuse.m4 --- libbde-20190102/m4/libfuse.m4 2018-05-04 03:59:04.000000000 +0000 +++ libbde-20240223/m4/libfuse.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ -dnl Functions for libfuse +dnl Checks for libfuse required headers and functions dnl -dnl Version: 20180403 +dnl Version: 20220118 dnl Function to detect if libfuse is available dnl ac_libfuse_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -40,10 +40,11 @@ [ac_cv_header_fuse_h=no]) dnl libfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set + dnl macFuse requires -DFUSE_USE_VERSION=26 to be set AS_IF( [test "x$ac_cv_header_fuse_h" = xno], [AS_UNSET([ac_cv_header_fuse_h]) - CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26" AC_CHECK_HEADERS([fuse.h]) ]) diff -Nru libbde-20190102/m4/libfvalue.m4 libbde-20240223/m4/libfvalue.m4 --- libbde-20190102/m4/libfvalue.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libfvalue.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libfvalue required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20200711 dnl Function to detect if libfvalue is available dnl ac_libfvalue_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libfvalue" = xno], [ac_cv_libfvalue=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libfvalue=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libfvalue" != x && test "x$ac_cv_with_libfvalue" != xauto-detect], [AS_IF( @@ -19,13 +20,13 @@ [no such directory: $ac_cv_with_libfvalue], [1]) ]) - ac_cv_libfvalue=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libfvalue], - [libfvalue >= 20160131], + [libfvalue >= 20200711], [ac_cv_libfvalue=yes], [ac_cv_libfvalue=check]) ]) diff -Nru libbde-20190102/m4/libhmac.m4 libbde-20240223/m4/libhmac.m4 --- libbde-20190102/m4/libhmac.m4 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/m4/libhmac.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Checks for libhmac required headers and functions dnl -dnl Version: 20190102 +dnl Version: 20200104 dnl Function to detect if libhmac is available dnl ac_libhmac_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +8,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libhmac" = xno], [ac_cv_libhmac=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libhmac=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libhmac" != x && test "x$ac_cv_with_libhmac" != xauto-detect], [AS_IF( @@ -19,13 +20,13 @@ [no such directory: $ac_cv_with_libhmac], [1]) ]) - ac_cv_libhmac=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libhmac], - [libhmac >= 20160802], + [libhmac >= 20200104], [ac_cv_libhmac=yes], [ac_cv_libhmac=check]) ]) diff -Nru libbde-20190102/m4/libtool.m4 libbde-20240223/m4/libtool.m4 --- libbde-20190102/m4/libtool.m4 2019-01-02 15:57:42.000000000 +0000 +++ libbde-20240223/m4/libtool.m4 2024-02-23 03:03:45.000000000 +0000 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ # along with this program. If not, see . ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1067,17 +1069,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1126,12 +1123,12 @@ output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1245,7 +1242,8 @@ # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1262,7 +1260,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1292,7 +1290,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1309,7 +1307,7 @@ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1321,7 +1319,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1343,7 +1341,7 @@ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1351,7 +1349,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1359,7 +1357,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1379,14 +1377,14 @@ # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1454,7 +1452,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1493,9 +1491,22 @@ m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1714,7 +1725,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1757,7 +1768,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2207,26 +2218,35 @@ striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2549,7 +2569,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2559,14 +2579,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2585,7 +2605,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2622,7 +2642,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2655,7 +2675,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3457,7 +3477,7 @@ bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3491,14 +3511,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3512,7 +3532,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3559,7 +3579,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3686,13 +3706,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3718,7 +3738,7 @@ # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3958,7 +3978,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3976,20 +3996,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4013,7 +4033,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4031,9 +4051,9 @@ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4320,7 +4340,7 @@ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4403,7 +4423,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4739,7 +4759,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4922,7 +4942,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4930,7 +4950,7 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4987,15 +5007,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5047,7 +5067,7 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5159,6 +5179,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5173,7 +5194,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5216,7 +5237,7 @@ _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5228,7 +5249,7 @@ if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5244,7 +5265,7 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5376,7 +5397,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5559,12 +5580,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5605,7 +5626,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5653,7 +5674,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5864,6 +5885,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6634,8 +6656,8 @@ cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6733,6 +6755,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6763,7 +6786,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6900,7 +6923,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7040,13 +7063,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8192,6 +8215,14 @@ AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates diff -Nru libbde-20190102/m4/libuna.m4 libbde-20240223/m4/libuna.m4 --- libbde-20190102/m4/libuna.m4 2018-11-17 14:33:40.000000000 +0000 +++ libbde-20240223/m4/libuna.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,23 @@ dnl Checks for libuna or required headers and functions dnl -dnl Version: 20181117 +dnl Version: 20230702 + +dnl Function to detect if a specific libuna definition is available. +AC_DEFUN([AX_LIBUNA_CHECK_DEFINITION], + [AC_CACHE_CHECK( + [if `$1' is defined], + [$2], + [AC_LANG_PUSH(C) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[int test = $1; + +return( 0 ); ]] )], + [$2=yes], + [$2=no]) + AC_LANG_POP(C)]) + ]) dnl Function to detect if libuna is available dnl ac_libuna_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments @@ -8,7 +25,8 @@ [AS_IF( [test "x$ac_cv_enable_shared_libs" = xno || test "x$ac_cv_with_libuna" = xno], [ac_cv_libuna=no], - [dnl Check if the directory provided as parameter exists + [ac_cv_libuna=check + dnl Check if the directory provided as parameter exists AS_IF( [test "x$ac_cv_with_libuna" != x && test "x$ac_cv_with_libuna" != xauto-detect], [AS_IF( @@ -19,13 +37,13 @@ [no such directory: $ac_cv_with_libuna], [1]) ]) - ac_cv_libuna=check], + ], [dnl Check for a pkg-config file AS_IF( [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], [PKG_CHECK_MODULES( [libuna], - [libuna >= 20181006], + [libuna >= 20230702], [ac_cv_libuna=yes], [ac_cv_libuna=check]) ]) @@ -207,6 +225,138 @@ [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) + dnl Unicode character functions + AC_CHECK_LIB( + una, + libuna_unicode_character_size_to_byte_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_byte_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_byte_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_size_to_ucs2, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_ucs2, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_ucs2, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_size_to_ucs4, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_ucs4, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_ucs4, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf7_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf7_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_size_to_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_size_to_utf8_rfc2279, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf8_rfc2279, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf8_rfc2279, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_size_to_utf16, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf16, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf16, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf16_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf16_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf32, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf32, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_from_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_unicode_character_copy_to_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + dnl UTF-8 stream functions AC_CHECK_LIB( una, @@ -321,6 +471,11 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf8_string_compare_with_byte_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, libuna_utf8_string_size_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -336,6 +491,11 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf8_string_compare_with_utf7_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, libuna_utf8_string_size_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -351,47 +511,47 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_size_from_utf16_stream, + libuna_utf8_string_compare_with_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_copy_from_utf16_stream, + libuna_utf8_string_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_with_index_copy_from_utf16_stream, + libuna_utf8_string_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_size_from_utf32_stream, + libuna_utf8_string_with_index_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_copy_from_utf32_stream, + libuna_utf8_string_compare_with_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_with_index_copy_from_utf32_stream, + libuna_utf8_string_size_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_size_from_utf16, + libuna_utf8_string_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_copy_from_utf16, + libuna_utf8_string_with_index_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf8_string_with_index_copy_from_utf16, + libuna_utf8_string_compare_with_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( @@ -409,6 +569,46 @@ libuna_utf8_string_with_index_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_compare_with_utf32, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_size_from_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_copy_from_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_with_index_copy_from_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_compare_with_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_size_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_copy_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf8_string_with_index_copy_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) dnl UTF-16 string functions AC_CHECK_LIB( @@ -428,6 +628,11 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf16_string_compare_with_byte_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, libuna_utf16_string_size_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -443,6 +648,27 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf16_string_compare_with_utf7_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf16_string_size_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf16_string_copy_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf16_string_with_index_copy_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + dnl libuna_utf16_string_compare_with_utf8 is implemented by libuna_utf8_string_compare_with_utf16 + AC_CHECK_LIB( + una, libuna_utf16_string_size_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -458,6 +684,11 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf16_string_compare_with_utf8_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, libuna_utf16_string_size_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -473,47 +704,62 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_size_from_utf32_stream, + libuna_utf16_string_compare_with_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_copy_from_utf32_stream, + libuna_utf16_string_size_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_with_index_copy_from_utf32_stream, + libuna_utf16_string_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_size_from_utf8, + libuna_utf16_string_with_index_copy_from_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_copy_from_utf8, + libuna_utf16_string_compare_with_utf32, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_with_index_copy_from_utf8, + libuna_utf16_string_size_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_size_from_utf32, + libuna_utf16_string_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_copy_from_utf32, + libuna_utf16_string_with_index_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf16_string_with_index_copy_from_utf32, + libuna_utf16_string_compare_with_utf32_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf16_string_size_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf16_string_copy_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf16_string_with_index_copy_from_scsu_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -535,6 +781,11 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf32_string_compare_with_byte_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, libuna_utf32_string_size_from_utf7_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -550,11 +801,31 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf32_string_compare_with_utf7_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, libuna_utf32_string_size_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, + libuna_utf32_string_size_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf32_string_copy_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + libuna_utf32_string_with_index_copy_from_utf8, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + dnl libuna_utf32_string_compare_with_utf8 is implemented by libuna_utf8_string_compare_with_utf32 + AC_CHECK_LIB( + una, libuna_utf32_string_copy_from_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) @@ -565,63 +836,109 @@ [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_size_from_utf16_stream, + libuna_utf32_string_compare_with_utf8_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_copy_from_utf16_stream, + libuna_utf32_string_size_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_with_index_copy_from_utf16_stream, + libuna_utf32_string_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_size_from_utf32_stream, + libuna_utf32_string_with_index_copy_from_utf16, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) + dnl libuna_utf32_string_compare_with_utf16 is implemented by libuna_utf16_string_compare_with_utf32 AC_CHECK_LIB( una, - libuna_utf32_string_copy_from_utf32_stream, + libuna_utf32_string_size_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_with_index_copy_from_utf32_stream, + libuna_utf32_string_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_size_from_utf8, + libuna_utf32_string_with_index_copy_from_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_copy_from_utf8, + libuna_utf32_string_compare_with_utf16_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( - libuna_utf32_string_with_index_copy_from_utf8, + una, + libuna_utf32_string_size_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_size_from_utf16, + libuna_utf32_string_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_copy_from_utf16, + libuna_utf32_string_with_index_copy_from_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) AC_CHECK_LIB( una, - libuna_utf32_string_with_index_copy_from_utf16, + libuna_utf32_string_compare_with_utf32_stream, [ac_cv_libuna_dummy=yes], [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf32_string_size_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf32_string_copy_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + AC_CHECK_LIB( + una, + libuna_utf32_string_with_index_copy_from_scsu_stream, + [ac_cv_libuna_dummy=yes], + [ac_cv_libuna=no]) + + dnl Check for definitions + AX_LIBUNA_CHECK_DEFINITION( + LIBUNA_COMPARE_LESS, + [ac_cv_libuna_defines_compare_less]) + AS_IF( + [test "x$ac_cv_libuna_defines_compare_less" != xyes], + [ac_cv_libuna=no]) + + AX_LIBUNA_CHECK_DEFINITION( + LIBUNA_COMPARE_EQUAL, + [ac_cv_libuna_defines_compare_equal]) + AS_IF( + [test "x$ac_cv_libuna_defines_compare_less" != xyes], + [ac_cv_libuna=no]) + + AX_LIBUNA_CHECK_DEFINITION( + LIBUNA_COMPARE_GREATER, + [ac_cv_libuna_defines_compare_greater]) + AS_IF( + [test "x$ac_cv_libuna_defines_compare_less" != xyes], + [ac_cv_libuna=no]) + + AX_LIBUNA_CHECK_DEFINITION( + LIBUNA_UTF16_STREAM_ALLOW_UNPAIRED_SURROGATE, + [ac_cv_libuna_defines_compare_greater]) + AS_IF( + [test "x$ac_cv_libuna_defines_utf16_stream_allow_unpaired_surrogate" != xyes], + [ac_cv_libuna=no]) ac_cv_libuna_LIBADD="-luna"]) ]) diff -Nru libbde-20190102/m4/ltoptions.m4 libbde-20240223/m4/ltoptions.m4 --- libbde-20190102/m4/ltoptions.m4 2019-01-02 15:57:43.000000000 +0000 +++ libbde-20240223/m4/ltoptions.m4 2024-02-23 03:03:45.000000000 +0000 @@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives diff -Nru libbde-20190102/m4/ltsugar.m4 libbde-20240223/m4/ltsugar.m4 --- libbde-20190102/m4/ltsugar.m4 2019-01-02 15:57:43.000000000 +0000 +++ libbde-20240223/m4/ltsugar.m4 2024-02-23 03:03:45.000000000 +0000 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff -Nru libbde-20190102/m4/ltversion.m4 libbde-20240223/m4/ltversion.m4 --- libbde-20190102/m4/ltversion.m4 2019-01-02 15:57:43.000000000 +0000 +++ libbde-20240223/m4/ltversion.m4 2024-02-23 03:03:45.000000000 +0000 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff -Nru libbde-20190102/m4/lt~obsolete.m4 libbde-20240223/m4/lt~obsolete.m4 --- libbde-20190102/m4/lt~obsolete.m4 2019-01-02 15:57:43.000000000 +0000 +++ libbde-20240223/m4/lt~obsolete.m4 2024-02-23 03:03:45.000000000 +0000 @@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives diff -Nru libbde-20190102/m4/nls.m4 libbde-20240223/m4/nls.m4 --- libbde-20190102/m4/nls.m4 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/m4/nls.m4 2023-12-03 08:57:24.000000000 +0000 @@ -1,17 +1,17 @@ -# nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, -dnl Inc. +# nls.m4 serial 6 (gettext-0.20.2) +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free +dnl Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru libbde-20190102/m4/po.m4 libbde-20240223/m4/po.m4 --- libbde-20190102/m4/po.m4 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/m4/po.m4 2023-12-03 08:57:24.000000000 +0000 @@ -1,35 +1,36 @@ -# po.m4 serial 17 (gettext-0.18) -dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. +# po.m4 serial 31 (gettext-0.20.2) +dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered -dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ([2.50]) +AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.20]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -45,13 +46,6 @@ dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; - esac -changequote([,])dnl - AC_SUBST([MSGFMT_015]) -changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; @@ -82,11 +76,21 @@ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) - dnl Installation directories. - dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we - dnl have to define it here, so that it can be used in po/Makefile. - test -n "$localedir" || localedir='${datadir}/locale' - AC_SUBST([localedir]) + dnl Test whether it is GNU msgmerge >= 0.20. + if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' + else + dnl Test whether it is GNU msgmerge >= 0.12. + if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' + else + dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is + dnl slow. But this is not a big problem, as such old gettext versions are + dnl hardly in use any more. + MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' + fi + fi + AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= @@ -102,7 +106,7 @@ case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -118,7 +122,8 @@ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration @@ -128,14 +133,11 @@ if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -206,9 +208,8 @@ esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. + OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) @@ -226,7 +227,7 @@ changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -254,6 +255,7 @@ fi # A sed script that extracts the value of VARIABLE from a Makefile. + tab=`printf '\t'` sed_x_variable=' # Test if the hold space is empty. x @@ -261,9 +263,9 @@ x ta # Yes it was empty. Look if we have the expected variable definition. -/^[ ]*VARIABLE[ ]*=/{ +/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{ # Seen the first line of the variable definition. - s/^[ ]*VARIABLE[ ]*=// + s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=// ba } bd @@ -308,15 +310,13 @@ fi if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` - ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` + ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES @@ -326,9 +326,9 @@ # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) # Compute PROPERTIESFILES - # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) # Compute CLASSFILES - # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) + # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) # Compute QMFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) # Compute MSGFILES @@ -353,8 +353,8 @@ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" - CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" + PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties" + CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class" QMFILES="$QMFILES $srcdirpre$lang.qm" frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" @@ -405,14 +405,15 @@ fi sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi # Find out how to test for executable files. Don't use a zero-byte file, diff -Nru libbde-20190102/m4/python.m4 libbde-20240223/m4/python.m4 --- libbde-20190102/m4/python.m4 2018-08-06 18:11:52.000000000 +0000 +++ libbde-20240223/m4/python.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,6 +1,6 @@ dnl Functions for Python bindings dnl -dnl Version: 20170830 +dnl Version: 20231119 dnl Function to check if the python binary is available dnl "python${PYTHON_VERSION} python python# python#.#" @@ -8,17 +8,13 @@ [AS_IF( [test "x${PYTHON_VERSION}" != x], [ax_python_progs="python${PYTHON_VERSION}"], - [ax_python_progs="python python2 python2.7 python2.6 python2.5 python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0"]) + [ax_python_progs="python python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2 python2.7 python2.6 python2.5"]) AC_CHECK_PROGS( [PYTHON], [$ax_python_progs]) AS_IF( [test "x${PYTHON}" != x], - [ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; - AC_SUBST( - [PYTHON_VERSION], - [$ax_prog_python_version]) - + [ax_prog_python_version=`${PYTHON} -c "import sys; sys.stdout.write('%d.%d' % (sys.version_info[[0]], sys.version_info[[1]]))" 2>/dev/null`; ax_prog_python_platform=`${PYTHON} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; AC_SUBST( [PYTHON_PLATFORM], @@ -32,113 +28,29 @@ [$PYTHON]) ]) -dnl Function to check if the python2 binary is available -dnl "python2 python2.#" -AC_DEFUN([AX_PROG_PYTHON2], - [ax_python2_progs="python2 python2.7 python2.6 python2.5" - AC_CHECK_PROGS( - [PYTHON2], - [$ax_python2_progs]) - AS_IF( - [test "x${PYTHON2}" != x], - [ax_prog_python2_version=`${PYTHON2} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; - AC_SUBST( - [PYTHON2_VERSION], - [$ax_prog_python2_version]) - - ax_prog_python2_platform=`${PYTHON2} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; - AC_SUBST( - [PYTHON2_PLATFORM], - [$ax_prog_python2_platform]) - ], - [AC_MSG_ERROR( - [Unable to find python2]) - ]) - AC_SUBST( - [PYTHON2], - [$PYTHON2]) - ]) - -dnl Function to check if the python3 binary is available -dnl "python3 python3.#" -AC_DEFUN([AX_PROG_PYTHON3], - [ax_python3_progs="python3 python3.4 python3.3 python3.2 python3.1 python3.0" - AC_CHECK_PROGS( - [PYTHON3], - [$ax_python3_progs]) - AS_IF( - [test "x${PYTHON3}" != x], - [ax_prog_python3_version=`${PYTHON3} -c "import sys; sys.stdout.write(sys.version[[:3]])" 2>/dev/null`; - AC_SUBST( - [PYTHON3_VERSION], - [$ax_prog_python3_version]) - - ax_prog_python3_platform=`${PYTHON3} -c "import sys; sys.stdout.write(sys.platform)" 2>/dev/null`; - AC_SUBST( - [PYTHON3_PLATFORM], - [$ax_prog_python3_platform]) - ], - [AC_MSG_ERROR( - [Unable to find python3]) - ]) - AC_SUBST( - [PYTHON3], - [$PYTHON3]) - ]) - dnl Function to check if the python-config binary is available dnl "python${PYTHON_VERSION}-config python-config" AC_DEFUN([AX_PROG_PYTHON_CONFIG], [AS_IF( - [test "x${PYTHON}" != x], + [test "x${PYTHON_CONFIG}" = x && test "x${PYTHON_VERSION}" != x], [AC_CHECK_PROGS( [PYTHON_CONFIG], - [python${PYTHON_VERSION}-config python-config]) + [python${PYTHON_VERSION}-config]) ]) AS_IF( [test "x${PYTHON_CONFIG}" = x], - [AC_MSG_ERROR( - [Unable to find python-config]) - ]) - AC_SUBST( - [PYTHON_CONFIG], - [$PYTHON_CONFIG]) - ]) - -dnl Function to check if the python2-config binary is available -AC_DEFUN([AX_PROG_PYTHON2_CONFIG], - [AS_IF( - [test "x${PYTHON2}" != x], - [AC_CHECK_PROGS( - [PYTHON2_CONFIG], - [python2-config]) - ]) - AS_IF( - [test "x${PYTHON2_CONFIG}" = x], - [AC_MSG_ERROR( - [Unable to find python2-config]) - ]) - AC_SUBST( - [PYTHON2_CONFIG], - [$PYTHON2_CONFIG]) - ]) - -dnl Function to check if the python3-config binary is available -AC_DEFUN([AX_PROG_PYTHON3_CONFIG], - [AS_IF( - [test "x${PYTHON3}" != x], [AC_CHECK_PROGS( - [PYTHON3_CONFIG], - [python3-config]) + [PYTHON_CONFIG], + [python-config python3-config python3.12-config python3.11-config python3.10-config python3.9-config python3.8-config python3.7-config python3.6-config python3.5-config python3.4-config python3.3-config python3.2-config python3.1-config python3.0-config python2-config python2.7-config python2.6-config python2.5-config]) ]) AS_IF( - [test "x${PYTHON3_CONFIG}" = x], + [test "x${PYTHON_CONFIG}" = x], [AC_MSG_ERROR( - [Unable to find python3-config]) + [Unable to find python-config]) ]) AC_SUBST( - [PYTHON3_CONFIG], - [$PYTHON3_CONFIG]) + [PYTHON_CONFIG], + [$PYTHON_CONFIG]) ]) dnl Function to detect if a Python build environment is available @@ -185,7 +97,7 @@ AS_IF( [test "x${ac_cv_header_python_h}" != xyes], [ac_cv_enable_python=no], - [ac_cv_enable_python=$PYTHON_VERSION + [ac_cv_enable_python=${ax_prog_python_version} AC_SUBST( [PYTHON_CPPFLAGS], [$PYTHON_INCLUDES]) @@ -222,7 +134,7 @@ [AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], [ax_python_pythondir="${ax_python_prefix}/${ax_python_pythondir_suffix}"], - [ax_python_pythondir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null`])], + [ax_python_pythondir=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib()) " 2>/dev/null`])], [ax_python_pythondir=$ac_cv_with_pythondir]) AC_SUBST( @@ -231,7 +143,7 @@ dnl Check for Python platform specific library directory ax_python_pyexecdir_suffix=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; - ax_python_library_dir=`${PYTHON} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; + ax_python_library_dir=`${PYTHON} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(True)) " 2>/dev/null`; AS_IF( [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], @@ -252,228 +164,6 @@ ]) ]) -dnl Function to detect if a Python 2 build environment is available -AC_DEFUN([AX_PYTHON2_CHECK], - [AX_PROG_PYTHON2 - AX_PROG_PYTHON2_CONFIG - - AS_IF( - [test "x${PYTHON2_CONFIG}" != x], - [dnl Check for Python 2 includes - PYTHON2_INCLUDES=`${PYTHON2_CONFIG} --includes 2>/dev/null`; - - AC_MSG_CHECKING( - [for Python verison 2 includes]) - AC_MSG_RESULT( - [$PYTHON2_INCLUDES]) - - dnl Check for Python 2 libraries - PYTHON2_LDFLAGS=`${PYTHON2_CONFIG} --ldflags 2>/dev/null`; - - AC_MSG_CHECKING( - [for Python 2 libraries]) - AC_MSG_RESULT( - [$PYTHON2_LDFLAGS]) - - dnl For CygWin add the -no-undefined linker flag - AS_CASE( - [$host_os], - [cygwin*],[PYTHON2_LDFLAGS="${PYTHON2_LDFLAGS} -no-undefined"], - [*],[]) - - dnl Check for the existence of Python.h - BACKUP_CPPFLAGS="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} ${PYTHON2_INCLUDES}" - - AC_CHECK_HEADERS( - [Python.h], - [ac_cv_header_python2_h=yes], - [ac_cv_header_python2_h=no]) - - CPPFLAGS="${BACKUP_CPPFLAGS}" - ]) - - AS_IF( - [test "x${ac_cv_header_python2_h}" != xyes], - [ac_cv_enable_python2=no], - [ac_cv_enable_python2=$PYTHON2_VERSION - AC_SUBST( - [PYTHON2_CPPFLAGS], - [$PYTHON2_INCLUDES]) - - AC_SUBST( - [PYTHON2_LDFLAGS], - [$PYTHON2_LDFLAGS]) - - dnl Check for Python prefix - AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python2_prefix="\${prefix}"], - [ax_python2_prefix=`${PYTHON2_CONFIG} --prefix 2>/dev/null`]) - - AC_SUBST( - [PYTHON2_PREFIX], - [$ax_python2_prefix]) - - dnl Check for Python exec-prefix - AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python2_exec_prefix="\${exec_prefix}"], - [ax_python2_exec_prefix=`${PYTHON2_CONFIG} --exec-prefix 2>/dev/null`]) - - AC_SUBST( - [PYTHON2_EXEC_PREFIX], - [$ax_python2_exec_prefix]) - - dnl Check for Python 2 library directory - ax_python2_pythondir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; - - AS_IF( - [test "x${ac_cv_with_pythondir2}" = x || test "x${ac_cv_with_pythondir2}" = xno], - [AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python2_pythondir="${ax_python_prefix}/${ax_python2_pythondir_suffix}"], - [ax_python2_pythondir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null`])], - [ax_python2_pythondir=$ac_cv_with_pythondir2]) - - AC_SUBST( - [pythondir2], - [$ax_python2_pythondir]) - - dnl Check for Python 2 platform specific library directory - ax_python2_pyexecdir_suffix=`${PYTHON2} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; - ax_python2_library_dir=`${PYTHON2} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; - - AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python2_pyexecdir="${ax_python2_exec_prefix}/${ax_python2_pyexecdir_suffix}"], - [ax_python2_pyexecdir=$ax_python2_library_dir]) - - AC_SUBST( - [pyexecdir2], - [$ax_python2_pyexecdir]) - - AC_SUBST( - [PYTHON2_LIBRARY_DIR], - [$ax_python2_pyexecdir_suffix]) - - AC_SUBST( - [PYTHON2_PACKAGE_DIR], - [$ax_python2_library_dir]) - ]) - ]) - -dnl Function to detect if a Python 3 build environment is available -AC_DEFUN([AX_PYTHON3_CHECK], - [AX_PROG_PYTHON3 - AX_PROG_PYTHON3_CONFIG - - AS_IF( - [test "x${PYTHON3_CONFIG}" != x], - [dnl Check for Python 3 includes - PYTHON3_INCLUDES=`${PYTHON3_CONFIG} --includes 2>/dev/null`; - - AC_MSG_CHECKING( - [for Python verison 3 includes]) - AC_MSG_RESULT( - [$PYTHON3_INCLUDES]) - - dnl Check for Python 3 libraries - PYTHON3_LDFLAGS=`${PYTHON3_CONFIG} --ldflags 2>/dev/null`; - - AC_MSG_CHECKING( - [for Python 3 libraries]) - AC_MSG_RESULT( - [$PYTHON3_LDFLAGS]) - - dnl For CygWin add the -no-undefined linker flag - AS_CASE( - [$host_os], - [cygwin*],[PYTHON3_LDFLAGS="${PYTHON3_LDFLAGS} -no-undefined"], - [*],[]) - - dnl Check for the existence of Python.h - BACKUP_CPPFLAGS="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} ${PYTHON3_INCLUDES}" - - AC_CHECK_HEADERS( - [Python.h], - [ac_cv_header_python3_h=yes], - [ac_cv_header_python3_h=no]) - - CPPFLAGS="${BACKUP_CPPFLAGS}" - ]) - - AS_IF( - [test "x${ac_cv_header_python3_h}" != xyes], - [ac_cv_enable_python3=no], - [ac_cv_enable_python3=$PYTHON3_VERSION - AC_SUBST( - [PYTHON3_CPPFLAGS], - [$PYTHON3_INCLUDES]) - - AC_SUBST( - [PYTHON3_LDFLAGS], - [$PYTHON3_LDFLAGS]) - - dnl Check for Python prefix - AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python3_prefix="\${prefix}"], - [ax_python3_prefix=`${PYTHON3_CONFIG} --prefix 2>/dev/null`]) - - AC_SUBST( - [PYTHON3_PREFIX], - [$ax_python3_prefix]) - - dnl Check for Python exec-prefix - AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python3_exec_prefix="\${exec_prefix}"], - [ax_python3_exec_prefix=`${PYTHON3_CONFIG} --exec-prefix 2>/dev/null`]) - - AC_SUBST( - [PYTHON3_EXEC_PREFIX], - [$ax_python3_exec_prefix]) - - dnl Check for Python 3 library directory - ax_python3_pythondir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(0, 0, prefix=''))" 2>/dev/null`; - - AS_IF( - [test "x${ac_cv_with_pythondir3}" = x || test "x${ac_cv_with_pythondir3}" = xno], - [AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python3_pythondir="${ax_python_prefix}/${ax_python3_pythondir_suffix}"], - [ax_python3_pythondir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib() " 2>/dev/null`])], - [ax_python3_pythondir=$ac_cv_with_pythondir3]) - - AC_SUBST( - [pythondir3], - [$ax_python3_pythondir]) - - dnl Check for Python 3 platform specific library directory - ax_python3_pyexecdir_suffix=`${PYTHON3} -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_lib(1, 0, prefix=''))" 2>/dev/null`; - ax_python3_library_dir=`${PYTHON3} -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(True) " 2>/dev/null`; - - AS_IF( - [test "x${ac_cv_with_pyprefix}" = x || test "x${ac_cv_with_pyprefix}" = xno], - [ax_python3_pyexecdir="${ax_python3_exec_prefix}/${ax_python3_pyexecdir_suffix}"], - [ax_python3_pyexecdir=$ax_python3_library_dir]) - - AC_SUBST( - [pyexecdir3], - [$ax_python3_pyexecdir]) - - AC_SUBST( - [PYTHON3_LIBRARY_DIR], - [$ax_python3_pyexecdir_suffix]) - - AC_SUBST( - [PYTHON3_PACKAGE_DIR], - [$ax_python3_library_dir]) - ]) - ]) - dnl Function to determine the prefix of pythondir AC_DEFUN([AX_PYTHON_CHECK_PYPREFIX], [AX_COMMON_ARG_WITH( @@ -500,74 +190,17 @@ [no], [no]) - AX_COMMON_ARG_ENABLE( - [python2], - [python2], - [build Python 2 bindings], - [no]) - AX_COMMON_ARG_WITH( - [pythondir2], - [pythondir2], - [use to specify the Python 2 directory (pythondir2)], - [no], - [no]) - - AX_COMMON_ARG_ENABLE( - [python3], - [python3], - [build Python 3 bindings], - [no]) - AX_COMMON_ARG_WITH( - [pythondir3], - [pythondir3], - [use to specify the Python 3 directory (pythondir3)], - [no], - [no]) - AS_IF( [test "x${ac_cv_enable_python}" != xno], [AX_PYTHON_CHECK]) - AS_IF( - [test "x${ac_cv_enable_python2}" != xno], - [AX_PYTHON2_CHECK]) - - AS_IF( - [test "x${ac_cv_enable_python3}" != xno], - [AX_PYTHON3_CHECK]) - AM_CONDITIONAL( HAVE_PYTHON, [test "x${ac_cv_enable_python}" != xno]) AM_CONDITIONAL( - HAVE_PYTHON2, - [test "x${ac_cv_enable_python2}" != xno]) - - AM_CONDITIONAL( - HAVE_PYTHON3, - [test "x${ac_cv_enable_python3}" != xno]) - - AM_CONDITIONAL( HAVE_PYTHON_TESTS, - [test "x${ac_cv_enable_python}" != xno || test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno]) - - AS_IF( - [test "x${ac_cv_enable_python}" = xno], - [AS_IF( - [test "x${ac_cv_enable_python2}" != xno || test "x${ac_cv_enable_python3}" != xno], - [AS_IF( - [test "x${ac_cv_enable_python2}" != xno], - [ac_cv_enable_python=${ac_cv_enable_python2}], - [ac_cv_enable_python=""]) - AS_IF( - [test "x${ac_cv_enable_python3}" != xno], - [AS_IF( - [test "x${ac_cv_enable_python}" != x], - [ac_cv_enable_python="${ac_cv_enable_python}, "]) - ac_cv_enable_python="${ac_cv_enable_python}${ac_cv_enable_python3}"]) - ]) - ]) + [test "x${ac_cv_enable_python}" != xno]) ]) ]) diff -Nru libbde-20190102/m4/tests.m4 libbde-20240223/m4/tests.m4 --- libbde-20190102/m4/tests.m4 2018-09-29 08:28:55.000000000 +0000 +++ libbde-20240223/m4/tests.m4 2023-12-03 08:57:23.000000000 +0000 @@ -1,12 +1,12 @@ dnl Functions for testing dnl -dnl Version: 20180905 +dnl Version: 20200712 dnl Function to detect if tests dependencies are available AC_DEFUN([AX_TESTS_CHECK_LOCAL], [AC_CHECK_HEADERS([dlfcn.h]) - AC_CHECK_FUNCS([fmemopen getopt mkstemp unlink]) + AC_CHECK_FUNCS([fmemopen getopt mkstemp setenv tzset unlink]) AC_CHECK_LIB( dl, @@ -17,7 +17,17 @@ [AC_DEFINE( [HAVE_GNU_DL_DLSYM], [1], - [Define to 1 if dlsym funtion is available in GNU dl.]) + [Define to 1 if dlsym function is available in GNU dl.]) ]) ]) +dnl Function to detect if OSS-Fuzz build environment is available +AC_DEFUN([AX_TESTS_CHECK_OSSFUZZ], + [AM_CONDITIONAL( + HAVE_LIB_FUZZING_ENGINE, + [test "x${LIB_FUZZING_ENGINE}" != x]) + AC_SUBST( + [LIB_FUZZING_ENGINE], + ["${LIB_FUZZING_ENGINE}"]) +]) + diff -Nru libbde-20190102/manuals/Makefile.am libbde-20240223/manuals/Makefile.am --- libbde-20190102/manuals/Makefile.am 2016-12-14 01:55:29.000000000 +0000 +++ libbde-20240223/manuals/Makefile.am 2023-12-03 08:57:23.000000000 +0000 @@ -12,5 +12,5 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile diff -Nru libbde-20190102/manuals/Makefile.in libbde-20240223/manuals/Makefile.in --- libbde-20190102/manuals/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/manuals/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -90,16 +90,16 @@ subdir = manuals ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -168,6 +168,7 @@ man3dir = $(mandir)/man3 NROFF = nroff MANS = $(man_MANS) +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -185,6 +186,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -196,8 +203,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -215,7 +224,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -233,7 +241,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -287,8 +294,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -307,6 +312,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -317,8 +323,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -341,26 +347,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -369,7 +355,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -388,6 +373,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -430,9 +416,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -501,8 +484,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -525,11 +506,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -675,13 +653,14 @@ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +sources-local: +splint-local: tags TAGS: ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -815,6 +794,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man3 @@ -831,14 +818,15 @@ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + mostlyclean-libtool pdf pdf-am ps ps-am sources-am \ + sources-local splint-am splint-local tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man3 .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libbde-20190102/manuals/bdeinfo.1 libbde-20240223/manuals/bdeinfo.1 --- libbde-20190102/manuals/bdeinfo.1 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/manuals/bdeinfo.1 2024-02-23 02:47:19.000000000 +0000 @@ -1,4 +1,4 @@ -.Dd August 31, 2014 +.Dd January 21, 2022 .Dt bdeinfo .Os libbde .Sh NAME @@ -11,8 +11,8 @@ .Op Fl p Ar password .Op Fl r Ar password .Op Fl s Ar filename -.Op Fl hvV -.Va Ar source +.Op Fl huvV +.Ar source .Sh DESCRIPTION .Nm bdeinfo is a utility to determine information about a BitLocker Drive Encrypted (BDE) volume @@ -42,6 +42,8 @@ .It Fl s Ar filename specify the file containing the startup key. typically this file has the extension .BEK +.It Fl u +unattended mode (disables user interaction) .It Fl v verbose output to stderr .It Fl V @@ -55,22 +57,22 @@ .Bd -literal # bdeinfo -p Password /dev/sda1 bdeinfo 20140403 - +.sp BitLocker Drive Encryption information: Encryption method: AES 128-bit Volume identifier: a31a8153-5dc1-4bc3-a5b8-e6d77a17c4c0 Creation time: Aug 05, 2011 11:04:38.739926900 UTC Description :MYPC BDE TEST 8/5/2011 Number of key protectors: 2 - +.sp Key protector 0: Identifier: 240c5287-d4a5-4f2d-8d38-06a2e563257f Type: Password - +.sp Key protector 1: Identifier: e70fad99-e63f-45c1-92e0-1cadabe08ae9 Type: Recovery password - +.sp .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. @@ -81,7 +83,7 @@ .Sh AUTHOR These man pages were written by Joachim Metz. .Sh COPYRIGHT -Copyright (C) 2011-2019, Joachim Metz . +Copyright (C) 2011-2024, Joachim Metz . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr bdemount 1 diff -Nru libbde-20190102/manuals/bdemount.1 libbde-20240223/manuals/bdemount.1 --- libbde-20190102/manuals/bdemount.1 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/manuals/bdemount.1 2024-02-23 02:47:19.000000000 +0000 @@ -1,4 +1,4 @@ -.Dd August 31, 2014 +.Dd January 21, 2022 .Dt bdemount .Os libbde .Sh NAME @@ -12,8 +12,8 @@ .Op Fl r Ar password .Op Fl s Ar filename .Op Fl X Ar extended_options -.Op Fl hvV -.Va Ar source +.Op Fl huvV +.Ar source .Sh DESCRIPTION .Nm bdemount is a utility to mount a BitLocker Drive Encryption (BDE) encrypted volume @@ -43,6 +43,8 @@ .It Fl s Ar filename specify the file containing the startup key. typically this file has the extension .BEK +.It Fl u +unattended mode (disables user interaction) .It Fl v verbose output to stderr .It Fl V @@ -58,7 +60,7 @@ .Bd -literal # bdemount -p Password /dev/sda1 bdemount 20110821 - +.sp .Ed .Sh DIAGNOSTICS Errors, verbose and debug output are printed to stderr when verbose output \-v is enabled. @@ -69,7 +71,7 @@ .Sh AUTHOR These man pages were written by Joachim Metz. .Sh COPYRIGHT -Copyright (C) 2011-2019, Joachim Metz . +Copyright (C) 2011-2024, Joachim Metz . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr bdeinfo 1 diff -Nru libbde-20190102/manuals/libbde.3 libbde-20240223/manuals/libbde.3 --- libbde-20190102/manuals/libbde.3 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/manuals/libbde.3 2024-02-23 02:48:55.000000000 +0000 @@ -1,11 +1,9 @@ -.Dd February 4, 2017 +.Dd June 18, 2022 .Dt libbde 3 .Os libbde .Sh NAME .Nm libbde.h .Nd Library to access the BitLocker Drive Encryption (BDE) format -.Sh LIBRARY -.Lb libbde .Sh SYNOPSIS .In libbde.h .Pp @@ -15,27 +13,27 @@ .Ft int .Fn libbde_get_access_flags_read "void" .Ft int -.Fn libbde_get_codepage "int *codepage, libbde_error_t **error" +.Fn libbde_get_codepage "int *codepage" "libbde_error_t **error" .Ft int -.Fn libbde_set_codepage "int codepage, libbde_error_t **error" +.Fn libbde_set_codepage "int codepage" "libbde_error_t **error" .Ft int -.Fn libbde_check_volume_signature "const char *filename, libbde_error_t **error" +.Fn libbde_check_volume_signature "const char *filename" "libbde_error_t **error" .Pp Available when compiled with wide character string support: .Ft int -.Fn libbde_check_volume_signature_wide "const wchar_t *filename, libbde_error_t **error" +.Fn libbde_check_volume_signature_wide "const wchar_t *filename" "libbde_error_t **error" .Pp Available when compiled with libbfio support: .Ft int -.Fn libbde_check_volume_signature_file_io_handle "libbfio_handle_t *file_io_handle, libbde_error_t **error" +.Fn libbde_check_volume_signature_file_io_handle "libbfio_handle_t *file_io_handle" "libbde_error_t **error" .Pp Notify functions .Ft void .Fn libbde_notify_set_verbose "int verbose" .Ft int -.Fn libbde_notify_set_stream "FILE *stream, libbde_error_t **error" +.Fn libbde_notify_set_stream "FILE *stream" "libbde_error_t **error" .Ft int -.Fn libbde_notify_stream_open "const char *filename, libbde_error_t **error" +.Fn libbde_notify_stream_open "const char *filename" "libbde_error_t **error" .Ft int .Fn libbde_notify_stream_close "libbde_error_t **error" .Pp @@ -43,91 +41,89 @@ .Ft void .Fn libbde_error_free "libbde_error_t **error" .Ft int -.Fn libbde_error_fprint "libbde_error_t *error, FILE *stream" +.Fn libbde_error_fprint "libbde_error_t *error" "FILE *stream" .Ft int -.Fn libbde_error_sprint "libbde_error_t *error, char *string, size_t size" +.Fn libbde_error_sprint "libbde_error_t *error" "char *string" "size_t size" .Ft int -.Fn libbde_error_backtrace_fprint "libbde_error_t *error, FILE *stream" +.Fn libbde_error_backtrace_fprint "libbde_error_t *error" "FILE *stream" .Ft int -.Fn libbde_error_backtrace_sprint "libbde_error_t *error, char *string, size_t size" +.Fn libbde_error_backtrace_sprint "libbde_error_t *error" "char *string" "size_t size" .Pp Volume functions .Ft int -.Fn libbde_volume_initialize "libbde_volume_t **volume, libbde_error_t **error" +.Fn libbde_volume_initialize "libbde_volume_t **volume" "libbde_error_t **error" .Ft int -.Fn libbde_volume_free "libbde_volume_t **volume, libbde_error_t **error" +.Fn libbde_volume_free "libbde_volume_t **volume" "libbde_error_t **error" .Ft int -.Fn libbde_volume_signal_abort "libbde_volume_t *volume, libbde_error_t **error" +.Fn libbde_volume_signal_abort "libbde_volume_t *volume" "libbde_error_t **error" .Ft int -.Fn libbde_volume_open "libbde_volume_t *volume, const char *filename, int access_flags, libbde_error_t **error" +.Fn libbde_volume_open "libbde_volume_t *volume" "const char *filename" "int access_flags" "libbde_error_t **error" .Ft int -.Fn libbde_volume_close "libbde_volume_t *volume, libbde_error_t **error" +.Fn libbde_volume_close "libbde_volume_t *volume" "libbde_error_t **error" .Ft int -.Fn libbde_volume_is_locked "libbde_volume_t *volume, libbde_error_t **error" -.Ft ssize_t -.Fn libbde_volume_read_buffer "libbde_volume_t *volume, void *buffer, size_t buffer_size, libbde_error_t **error" -.Ft ssize_t -.Fn libbde_volume_read_buffer_at_offset "libbde_volume_t *volume, void *buffer, size_t buffer_size, off64_t offset, libbde_error_t **error" +.Fn libbde_volume_is_locked "libbde_volume_t *volume" "libbde_error_t **error" +.Ft int +.Fn libbde_volume_unlock "libbde_volume_t *volume" "libbde_error_t **error" .Ft ssize_t -.Fn libbde_volume_write_buffer "libbde_volume_t *volume, void *buffer, size_t buffer_size, libbde_error_t **error" +.Fn libbde_volume_read_buffer "libbde_volume_t *volume" "void *buffer" "size_t buffer_size" "libbde_error_t **error" .Ft ssize_t -.Fn libbde_volume_write_buffer_at_offset "libbde_volume_t *volume, const void *buffer, size_t buffer_size, off64_t offset, libbde_error_t **error" +.Fn libbde_volume_read_buffer_at_offset "libbde_volume_t *volume" "void *buffer" "size_t buffer_size" "off64_t offset" "libbde_error_t **error" .Ft off64_t -.Fn libbde_volume_seek_offset "libbde_volume_t *volume, off64_t offset, int whence, libbde_error_t **error" +.Fn libbde_volume_seek_offset "libbde_volume_t *volume" "off64_t offset" "int whence" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_offset "libbde_volume_t *volume, off64_t *offset, libbde_error_t **error" +.Fn libbde_volume_get_offset "libbde_volume_t *volume" "off64_t *offset" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_size "libbde_volume_t *volume, size64_t *size, libbde_error_t **error" +.Fn libbde_volume_get_size "libbde_volume_t *volume" "size64_t *size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_encryption_method "libbde_volume_t *volume, uint16_t *encryption_method, libbde_error_t **error" +.Fn libbde_volume_get_encryption_method "libbde_volume_t *volume" "uint16_t *encryption_method" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_volume_identifier "libbde_volume_t *volume, uint8_t *volume_identifier, size_t size, libbde_error_t **error" +.Fn libbde_volume_get_volume_identifier "libbde_volume_t *volume" "uint8_t *guid_data" "size_t guid_data_size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_creation_time "libbde_volume_t *volume, uint64_t *filetime, libbde_error_t **error" +.Fn libbde_volume_get_creation_time "libbde_volume_t *volume" "uint64_t *filetime" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_utf8_description_size "libbde_volume_t *volume, size_t *utf8_string_size, libbde_error_t **error" +.Fn libbde_volume_get_utf8_description_size "libbde_volume_t *volume" "size_t *utf8_string_size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_utf8_description "libbde_volume_t *volume, uint8_t *utf8_string, size_t utf8_string_size, libbde_error_t **error" +.Fn libbde_volume_get_utf8_description "libbde_volume_t *volume" "uint8_t *utf8_string" "size_t utf8_string_size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_utf16_description_size "libbde_volume_t *volume, size_t *utf16_string_size, libbde_error_t **error" +.Fn libbde_volume_get_utf16_description_size "libbde_volume_t *volume" "size_t *utf16_string_size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_utf16_description "libbde_volume_t *volume, uint16_t *utf16_string, size_t utf16_string_size, libbde_error_t **error" +.Fn libbde_volume_get_utf16_description "libbde_volume_t *volume" "uint16_t *utf16_string" "size_t utf16_string_size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_number_of_key_protectors "libbde_volume_t *volume, int *number_of_key_protectors, libbde_error_t **error" +.Fn libbde_volume_get_number_of_key_protectors "libbde_volume_t *volume" "int *number_of_key_protectors" "libbde_error_t **error" .Ft int -.Fn libbde_volume_get_key_protector "libbde_volume_t *volume, int key_protector_index, libbde_key_protector_t **key_protector, libbde_error_t **error" +.Fn libbde_volume_get_key_protector_by_index "libbde_volume_t *volume" "int key_protector_index" "libbde_key_protector_t **key_protector" "libbde_error_t **error" .Ft int -.Fn libbde_volume_set_keys "libbde_volume_t *volume, const uint8_t *full_volume_encryption_key, size_t full_volume_encryption_key_size, const uint8_t *tweak_key, size_t tweak_key_size, libbde_error_t **error" +.Fn libbde_volume_set_keys "libbde_volume_t *volume" "const uint8_t *full_volume_encryption_key" "size_t full_volume_encryption_key_size" "const uint8_t *tweak_key" "size_t tweak_key_size" "libbde_error_t **error" .Ft int -.Fn libbde_volume_set_utf8_password "libbde_volume_t *volume, const uint8_t *utf8_string, size_t utf8_string_length, libbde_error_t **error" +.Fn libbde_volume_set_utf8_password "libbde_volume_t *volume" "const uint8_t *utf8_string" "size_t utf8_string_length" "libbde_error_t **error" .Ft int -.Fn libbde_volume_set_utf16_password "libbde_volume_t *volume, const uint16_t *utf16_string, size_t utf16_string_length, libbde_error_t **error" +.Fn libbde_volume_set_utf16_password "libbde_volume_t *volume" "const uint16_t *utf16_string" "size_t utf16_string_length" "libbde_error_t **error" .Ft int -.Fn libbde_volume_set_utf8_recovery_password "libbde_volume_t *volume, const uint8_t *utf8_string, size_t utf8_string_length, libbde_error_t **error" +.Fn libbde_volume_set_utf8_recovery_password "libbde_volume_t *volume" "const uint8_t *utf8_string" "size_t utf8_string_length" "libbde_error_t **error" .Ft int -.Fn libbde_volume_set_utf16_recovery_password "libbde_volume_t *volume, const uint16_t *utf16_string, size_t utf16_string_length, libbde_error_t **error" +.Fn libbde_volume_set_utf16_recovery_password "libbde_volume_t *volume" "const uint16_t *utf16_string" "size_t utf16_string_length" "libbde_error_t **error" .Ft int -.Fn libbde_volume_read_startup_key "libbde_volume_t *volume, const char *filename, libbde_error_t **error" +.Fn libbde_volume_read_startup_key "libbde_volume_t *volume" "const char *filename" "libbde_error_t **error" .Pp Available when compiled with wide character string support: .Ft int -.Fn libbde_volume_open_wide "libbde_volume_t *volume, const wchar_t *filename, int access_flags, libbde_error_t **error" +.Fn libbde_volume_open_wide "libbde_volume_t *volume" "const wchar_t *filename" "int access_flags" "libbde_error_t **error" .Ft int -.Fn libbde_volume_read_startup_key_wide "libbde_volume_t *volume, const wchar_t *filename, libbde_error_t **error" +.Fn libbde_volume_read_startup_key_wide "libbde_volume_t *volume" "const wchar_t *filename" "libbde_error_t **error" .Pp Available when compiled with libbfio support: .Ft int -.Fn libbde_volume_open_file_io_handle "libbde_volume_t *volume, libbfio_handle_t *file_io_handle, int access_flags, libbde_error_t **error" +.Fn libbde_volume_open_file_io_handle "libbde_volume_t *volume" "libbfio_handle_t *file_io_handle" "int access_flags" "libbde_error_t **error" .Ft int -.Fn libbde_volume_read_startup_key_file_io_handle "libbde_volume_t *volume, libbfio_handle_t *file_io_handle, libbde_error_t **error" +.Fn libbde_volume_read_startup_key_file_io_handle "libbde_volume_t *volume" "libbfio_handle_t *file_io_handle" "libbde_error_t **error" .Pp Key protector functions .Ft int -.Fn libbde_key_protector_free "libbde_key_protector_t **key_protector, libbde_error_t **error" +.Fn libbde_key_protector_free "libbde_key_protector_t **key_protector" "libbde_error_t **error" .Ft int -.Fn libbde_key_protector_get_identifier "libbde_key_protector_t *key_protector, uint8_t *guid_data, size_t guid_data_size, libbde_error_t **error" +.Fn libbde_key_protector_get_identifier "libbde_key_protector_t *key_protector" "uint8_t *guid_data" "size_t guid_data_size" "libbde_error_t **error" .Ft int -.Fn libbde_key_protector_get_type "libbde_key_protector_t *key_protector, uint16_t *type, libbde_error_t **error" +.Fn libbde_key_protector_get_type "libbde_key_protector_t *key_protector" "uint16_t *type" "libbde_error_t **error" .Sh DESCRIPTION The .Fn libbde_get_version @@ -140,8 +136,8 @@ .Sh FILES None .Sh NOTES -libbde allows to be compiled with wide character support (wchar_t). - +libbde can be compiled with wide character support (wchar_t). +.sp To compile libbde with wide character support use: .Ar ./configure --enable-wide-character-type=yes or define: @@ -149,7 +145,7 @@ or .Ar UNICODE during compilation. - +.sp .Ar LIBBDE_WIDE_CHARACTER_TYPE in libbde/features.h can be used to determine if libbde was compiled with wide character support. .Sh BUGS @@ -157,8 +153,8 @@ .Sh AUTHOR These man pages are generated from "libbde.h". .Sh COPYRIGHT -Copyright (C) 2011-2019, Joachim Metz . - +Copyright (C) 2011-2024, Joachim Metz . +.sp This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO diff -Nru libbde-20190102/missing libbde-20240223/missing --- libbde-20190102/missing 2019-01-02 15:57:50.000000000 +0000 +++ libbde-20240223/missing 2024-02-23 03:03:50.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff -Nru libbde-20190102/msvscpp/Makefile.am libbde-20240223/msvscpp/Makefile.am --- libbde-20190102/msvscpp/Makefile.am 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/msvscpp/Makefile.am 2024-02-23 02:48:06.000000000 +0000 @@ -1,18 +1,27 @@ MSVSCPP_FILES = \ bde_test_aes_ccm_encrypted_key/bde_test_aes_ccm_encrypted_key.vcproj \ + bde_test_encryption_context/bde_test_encryption_context.vcproj \ bde_test_error/bde_test_error.vcproj \ bde_test_external_key/bde_test_external_key.vcproj \ bde_test_io_handle/bde_test_io_handle.vcproj \ bde_test_key/bde_test_key.vcproj \ bde_test_key_protector/bde_test_key_protector.vcproj \ bde_test_metadata/bde_test_metadata.vcproj \ + bde_test_metadata_block_header/bde_test_metadata_block_header.vcproj \ bde_test_metadata_entry/bde_test_metadata_entry.vcproj \ + bde_test_metadata_header/bde_test_metadata_header.vcproj \ bde_test_notify/bde_test_notify.vcproj \ + bde_test_password/bde_test_password.vcproj \ bde_test_password_keep/bde_test_password_keep.vcproj \ bde_test_sector_data/bde_test_sector_data.vcproj \ + bde_test_sector_data_vector/bde_test_sector_data_vector.vcproj \ bde_test_stretch_key/bde_test_stretch_key.vcproj \ bde_test_support/bde_test_support.vcproj \ + bde_test_tools_info_handle/bde_test_tools_info_handle.vcproj \ + bde_test_tools_output/bde_test_tools_output.vcproj \ + bde_test_tools_signal/bde_test_tools_signal.vcproj \ bde_test_volume/bde_test_volume.vcproj \ + bde_test_volume_header/bde_test_volume_header.vcproj \ bde_test_volume_master_key/bde_test_volume_master_key.vcproj \ bdeinfo/bdeinfo.vcproj \ bdemount/bdemount.vcproj \ @@ -28,7 +37,6 @@ libcsplit/libcsplit.vcproj \ libcthreads/libcthreads.vcproj \ libfcache/libfcache.vcproj \ - libfdata/libfdata.vcproj \ libfdatetime/libfdatetime.vcproj \ libfguid/libfguid.vcproj \ libfvalue/libfvalue.vcproj \ @@ -44,5 +52,5 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile diff -Nru libbde-20190102/msvscpp/Makefile.in libbde-20240223/msvscpp/Makefile.in --- libbde-20190102/msvscpp/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/msvscpp/Makefile.in 2024-02-23 03:03:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -90,16 +90,16 @@ subdir = msvscpp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -136,6 +136,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -153,6 +154,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -164,8 +171,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -183,7 +192,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -201,7 +209,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -255,8 +262,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -275,6 +280,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -285,8 +291,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -309,26 +315,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -337,7 +323,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -356,6 +341,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -398,9 +384,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -469,8 +452,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -493,11 +474,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -508,19 +486,28 @@ top_srcdir = @top_srcdir@ MSVSCPP_FILES = \ bde_test_aes_ccm_encrypted_key/bde_test_aes_ccm_encrypted_key.vcproj \ + bde_test_encryption_context/bde_test_encryption_context.vcproj \ bde_test_error/bde_test_error.vcproj \ bde_test_external_key/bde_test_external_key.vcproj \ bde_test_io_handle/bde_test_io_handle.vcproj \ bde_test_key/bde_test_key.vcproj \ bde_test_key_protector/bde_test_key_protector.vcproj \ bde_test_metadata/bde_test_metadata.vcproj \ + bde_test_metadata_block_header/bde_test_metadata_block_header.vcproj \ bde_test_metadata_entry/bde_test_metadata_entry.vcproj \ + bde_test_metadata_header/bde_test_metadata_header.vcproj \ bde_test_notify/bde_test_notify.vcproj \ + bde_test_password/bde_test_password.vcproj \ bde_test_password_keep/bde_test_password_keep.vcproj \ bde_test_sector_data/bde_test_sector_data.vcproj \ + bde_test_sector_data_vector/bde_test_sector_data_vector.vcproj \ bde_test_stretch_key/bde_test_stretch_key.vcproj \ bde_test_support/bde_test_support.vcproj \ + bde_test_tools_info_handle/bde_test_tools_info_handle.vcproj \ + bde_test_tools_output/bde_test_tools_output.vcproj \ + bde_test_tools_signal/bde_test_tools_signal.vcproj \ bde_test_volume/bde_test_volume.vcproj \ + bde_test_volume_header/bde_test_volume_header.vcproj \ bde_test_volume_master_key/bde_test_volume_master_key.vcproj \ bdeinfo/bdeinfo.vcproj \ bdemount/bdemount.vcproj \ @@ -536,7 +523,6 @@ libcsplit/libcsplit.vcproj \ libcthreads/libcthreads.vcproj \ libfcache/libfcache.vcproj \ - libfdata/libfdata.vcproj \ libfdatetime/libfdatetime.vcproj \ libfguid/libfguid.vcproj \ libfvalue/libfvalue.vcproj \ @@ -589,13 +575,14 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: tags TAGS: ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -726,6 +713,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: install-am install-strip @@ -740,13 +735,14 @@ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am + sources-am sources-local splint-am splint-local tags-am \ + uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libbde-20190102/msvscpp/bde_test_aes_ccm_encrypted_key/bde_test_aes_ccm_encrypted_key.vcproj libbde-20240223/msvscpp/bde_test_aes_ccm_encrypted_key/bde_test_aes_ccm_encrypted_key.vcproj --- libbde-20190102/msvscpp/bde_test_aes_ccm_encrypted_key/bde_test_aes_ccm_encrypted_key.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_aes_ccm_encrypted_key/bde_test_aes_ccm_encrypted_key.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_error/bde_test_error.vcproj libbde-20240223/msvscpp/bde_test_error/bde_test_error.vcproj --- libbde-20190102/msvscpp/bde_test_error/bde_test_error.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_error/bde_test_error.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_metadata_entry/bde_test_metadata_entry.vcproj libbde-20240223/msvscpp/bde_test_metadata_entry/bde_test_metadata_entry.vcproj --- libbde-20190102/msvscpp/bde_test_metadata_entry/bde_test_metadata_entry.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_metadata_entry/bde_test_metadata_entry.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_notify/bde_test_notify.vcproj libbde-20240223/msvscpp/bde_test_notify/bde_test_notify.vcproj --- libbde-20190102/msvscpp/bde_test_notify/bde_test_notify.vcproj 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_notify/bde_test_notify.vcproj 2024-02-23 02:48:06.000000000 +0000 @@ -41,8 +41,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_password_keep/bde_test_password_keep.vcproj libbde-20240223/msvscpp/bde_test_password_keep/bde_test_password_keep.vcproj --- libbde-20190102/msvscpp/bde_test_password_keep/bde_test_password_keep.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_password_keep/bde_test_password_keep.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + @@ -190,10 +194,18 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > + + + + diff -Nru libbde-20190102/msvscpp/bde_test_sector_data_vector/bde_test_sector_data_vector.vcproj libbde-20240223/msvscpp/bde_test_sector_data_vector/bde_test_sector_data_vector.vcproj --- libbde-20190102/msvscpp/bde_test_sector_data_vector/bde_test_sector_data_vector.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_sector_data_vector/bde_test_sector_data_vector.vcproj 2024-02-23 02:48:06.000000000 +0000 @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_stretch_key/bde_test_stretch_key.vcproj libbde-20240223/msvscpp/bde_test_stretch_key/bde_test_stretch_key.vcproj --- libbde-20190102/msvscpp/bde_test_stretch_key/bde_test_stretch_key.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_stretch_key/bde_test_stretch_key.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_tools_output/bde_test_tools_output.vcproj libbde-20240223/msvscpp/bde_test_tools_output/bde_test_tools_output.vcproj --- libbde-20190102/msvscpp/bde_test_tools_output/bde_test_tools_output.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_tools_output/bde_test_tools_output.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_tools_signal/bde_test_tools_signal.vcproj libbde-20240223/msvscpp/bde_test_tools_signal/bde_test_tools_signal.vcproj --- libbde-20190102/msvscpp/bde_test_tools_signal/bde_test_tools_signal.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_tools_signal/bde_test_tools_signal.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_volume/bde_test_volume.vcproj libbde-20240223/msvscpp/bde_test_volume/bde_test_volume.vcproj --- libbde-20190102/msvscpp/bde_test_volume/bde_test_volume.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_volume/bde_test_volume.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/bde_test_volume_master_key/bde_test_volume_master_key.vcproj libbde-20240223/msvscpp/bde_test_volume_master_key/bde_test_volume_master_key.vcproj --- libbde-20190102/msvscpp/bde_test_volume_master_key/bde_test_volume_master_key.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bde_test_volume_master_key/bde_test_volume_master_key.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + @@ -192,6 +196,10 @@ > + + @@ -210,6 +218,10 @@ > + + @@ -254,6 +266,10 @@ > + + diff -Nru libbde-20190102/msvscpp/bdemount/bdemount.vcproj libbde-20240223/msvscpp/bdemount/bdemount.vcproj --- libbde-20190102/msvscpp/bdemount/bdemount.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/bdemount/bdemount.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -41,8 +41,8 @@ /> + + @@ -228,6 +232,10 @@ > + + diff -Nru libbde-20190102/msvscpp/libbde/libbde.vcproj libbde-20240223/msvscpp/libbde/libbde.vcproj --- libbde-20190102/msvscpp/libbde/libbde.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/libbde/libbde.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -39,8 +39,8 @@ /> + + + + + + @@ -238,6 +250,10 @@ > + + @@ -250,6 +266,10 @@ > + + @@ -288,7 +308,7 @@ > - - @@ -376,14 +392,26 @@ > + + + + + + @@ -400,6 +428,10 @@ > + + @@ -420,6 +452,10 @@ > + + diff -Nru libbde-20190102/msvscpp/libbde.sln libbde-20240223/msvscpp/libbde.sln --- libbde-20190102/msvscpp/libbde.sln 2019-01-02 14:16:13.000000000 +0000 +++ libbde-20240223/msvscpp/libbde.sln 2024-02-23 02:48:06.000000000 +0000 @@ -19,6 +19,12 @@ {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_encryption_context", "bde_test_encryption_context\bde_test_encryption_context.vcproj", "{CB6B16F2-26B4-4D12-A36F-881C1EB08876}" + ProjectSection(ProjectDependencies) = postProject + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_error", "bde_test_error\bde_test_error.vcproj", "{10A45585-35B3-4248-9911-BDCC22674D04}" ProjectSection(ProjectDependencies) = postProject {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} @@ -54,18 +60,52 @@ {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_metadata_block_header", "bde_test_metadata_block_header\bde_test_metadata_block_header.vcproj", "{5247D728-44D9-4999-B9CF-C839EF37292D}" + ProjectSection(ProjectDependencies) = postProject + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} + {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} + {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} + {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} + {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_metadata_entry", "bde_test_metadata_entry\bde_test_metadata_entry.vcproj", "{1F79469A-AE3A-466F-8210-6D04BBC1A52A}" ProjectSection(ProjectDependencies) = postProject {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_metadata_header", "bde_test_metadata_header\bde_test_metadata_header.vcproj", "{6180BF13-9C60-4CB0-8141-84D5496E6321}" + ProjectSection(ProjectDependencies) = postProject + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} + {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} + {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} + {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} + {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_notify", "bde_test_notify\bde_test_notify.vcproj", "{83E18862-8898-457B-AD59-F2F8CE6B279D}" ProjectSection(ProjectDependencies) = postProject {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_password", "bde_test_password\bde_test_password.vcproj", "{CB62B884-3B87-4D86-80DD-6D5DB7C1D64C}" + ProjectSection(ProjectDependencies) = postProject + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_password_keep", "bde_test_password_keep\bde_test_password_keep.vcproj", "{D5286D19-9B40-4C5E-BB60-94AC3A73723D}" ProjectSection(ProjectDependencies) = postProject {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} @@ -74,6 +114,28 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_sector_data", "bde_test_sector_data\bde_test_sector_data.vcproj", "{840A29C6-DEBD-4658-B18D-72A65CE00E23}" ProjectSection(ProjectDependencies) = postProject + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} + {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} + {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} + {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} + {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_sector_data_vector", "bde_test_sector_data_vector\bde_test_sector_data_vector.vcproj", "{F1CABC87-E8B7-4397-BB2E-E3DECACE5E9F}" + ProjectSection(ProjectDependencies) = postProject + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} + {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} + {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} + {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} + {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection @@ -98,6 +160,34 @@ {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_tools_info_handle", "bde_test_tools_info_handle\bde_test_tools_info_handle.vcproj", "{37E0C874-426E-44D6-A462-8427E9F5C79E}" + ProjectSection(ProjectDependencies) = postProject + {8C13E498-6369-4792-A0CF-B7134C54561B} = {8C13E498-6369-4792-A0CF-B7134C54561B} + {25C60507-39C6-4564-912D-DA2E7482A00F} = {25C60507-39C6-4564-912D-DA2E7482A00F} + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} + {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} + {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} + {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} + {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_tools_output", "bde_test_tools_output\bde_test_tools_output.vcproj", "{EDCC6DC2-BF50-4022-A200-4A1599C49362}" + ProjectSection(ProjectDependencies) = postProject + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_tools_signal", "bde_test_tools_signal\bde_test_tools_signal.vcproj", "{6658A6BC-14DB-41EE-8949-0D6B5A531012}" + ProjectSection(ProjectDependencies) = postProject + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_volume", "bde_test_volume\bde_test_volume.vcproj", "{0FA01FCF-7C9F-4FBF-BFE2-0E3D5B67C609}" ProjectSection(ProjectDependencies) = postProject {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} @@ -113,6 +203,20 @@ {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_volume_header", "bde_test_volume_header\bde_test_volume_header.vcproj", "{8AE16F4F-28B1-48F5-A8F0-0D9C866A1CCC}" + ProjectSection(ProjectDependencies) = postProject + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} + {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} + {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} + {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} + {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} + {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bde_test_volume_master_key", "bde_test_volume_master_key\bde_test_volume_master_key.vcproj", "{840F51EE-55FA-4421-9BA0-0D810A1A939A}" ProjectSection(ProjectDependencies) = postProject {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} = {2CC46A0F-2CD9-4BD1-9667-8DDDECC98C96} @@ -187,7 +291,6 @@ {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} {3D19EAAD-9195-468B-BC5B-D147A89CA4F5} = {3D19EAAD-9195-468B-BC5B-D147A89CA4F5} - {F94DCC2D-2B49-453E-89B3-FD81992677D0} = {F94DCC2D-2B49-453E-89B3-FD81992677D0} {25C60507-39C6-4564-912D-DA2E7482A00F} = {25C60507-39C6-4564-912D-DA2E7482A00F} {8C13E498-6369-4792-A0CF-B7134C54561B} = {8C13E498-6369-4792-A0CF-B7134C54561B} {85005D62-6AA7-4D8A-86CB-4061B23D7C6C} = {85005D62-6AA7-4D8A-86CB-4061B23D7C6C} @@ -261,15 +364,6 @@ {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfdata", "libfdata\libfdata.vcproj", "{F94DCC2D-2B49-453E-89B3-FD81992677D0}" - ProjectSection(ProjectDependencies) = postProject - {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} - {8AFAA2C6-E025-4B45-B96F-A27D04C6115A} = {8AFAA2C6-E025-4B45-B96F-A27D04C6115A} - {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} - {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} - {3D19EAAD-9195-468B-BC5B-D147A89CA4F5} = {3D19EAAD-9195-468B-BC5B-D147A89CA4F5} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcdata", "libcdata\libcdata.vcproj", "{B9332DC8-7594-47DF-80C1-38922E0F4DFB}" ProjectSection(ProjectDependencies) = postProject {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} @@ -299,6 +393,10 @@ {3BE4ADBE-7CA5-43D0-A80F-C6DAE51D19AD}.Release|Win32.Build.0 = Release|Win32 {3BE4ADBE-7CA5-43D0-A80F-C6DAE51D19AD}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {3BE4ADBE-7CA5-43D0-A80F-C6DAE51D19AD}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {CB6B16F2-26B4-4D12-A36F-881C1EB08876}.Release|Win32.ActiveCfg = Release|Win32 + {CB6B16F2-26B4-4D12-A36F-881C1EB08876}.Release|Win32.Build.0 = Release|Win32 + {CB6B16F2-26B4-4D12-A36F-881C1EB08876}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {CB6B16F2-26B4-4D12-A36F-881C1EB08876}.VSDebug|Win32.Build.0 = VSDebug|Win32 {10A45585-35B3-4248-9911-BDCC22674D04}.Release|Win32.ActiveCfg = Release|Win32 {10A45585-35B3-4248-9911-BDCC22674D04}.Release|Win32.Build.0 = Release|Win32 {10A45585-35B3-4248-9911-BDCC22674D04}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 @@ -323,14 +421,26 @@ {81982B69-5E7B-4515-8AE9-F96033FB6198}.Release|Win32.Build.0 = Release|Win32 {81982B69-5E7B-4515-8AE9-F96033FB6198}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {81982B69-5E7B-4515-8AE9-F96033FB6198}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {5247D728-44D9-4999-B9CF-C839EF37292D}.Release|Win32.ActiveCfg = Release|Win32 + {5247D728-44D9-4999-B9CF-C839EF37292D}.Release|Win32.Build.0 = Release|Win32 + {5247D728-44D9-4999-B9CF-C839EF37292D}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {5247D728-44D9-4999-B9CF-C839EF37292D}.VSDebug|Win32.Build.0 = VSDebug|Win32 {1F79469A-AE3A-466F-8210-6D04BBC1A52A}.Release|Win32.ActiveCfg = Release|Win32 {1F79469A-AE3A-466F-8210-6D04BBC1A52A}.Release|Win32.Build.0 = Release|Win32 {1F79469A-AE3A-466F-8210-6D04BBC1A52A}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {1F79469A-AE3A-466F-8210-6D04BBC1A52A}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {6180BF13-9C60-4CB0-8141-84D5496E6321}.Release|Win32.ActiveCfg = Release|Win32 + {6180BF13-9C60-4CB0-8141-84D5496E6321}.Release|Win32.Build.0 = Release|Win32 + {6180BF13-9C60-4CB0-8141-84D5496E6321}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {6180BF13-9C60-4CB0-8141-84D5496E6321}.VSDebug|Win32.Build.0 = VSDebug|Win32 {83E18862-8898-457B-AD59-F2F8CE6B279D}.Release|Win32.ActiveCfg = Release|Win32 {83E18862-8898-457B-AD59-F2F8CE6B279D}.Release|Win32.Build.0 = Release|Win32 {83E18862-8898-457B-AD59-F2F8CE6B279D}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {83E18862-8898-457B-AD59-F2F8CE6B279D}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {CB62B884-3B87-4D86-80DD-6D5DB7C1D64C}.Release|Win32.ActiveCfg = Release|Win32 + {CB62B884-3B87-4D86-80DD-6D5DB7C1D64C}.Release|Win32.Build.0 = Release|Win32 + {CB62B884-3B87-4D86-80DD-6D5DB7C1D64C}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {CB62B884-3B87-4D86-80DD-6D5DB7C1D64C}.VSDebug|Win32.Build.0 = VSDebug|Win32 {D5286D19-9B40-4C5E-BB60-94AC3A73723D}.Release|Win32.ActiveCfg = Release|Win32 {D5286D19-9B40-4C5E-BB60-94AC3A73723D}.Release|Win32.Build.0 = Release|Win32 {D5286D19-9B40-4C5E-BB60-94AC3A73723D}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 @@ -339,6 +449,10 @@ {840A29C6-DEBD-4658-B18D-72A65CE00E23}.Release|Win32.Build.0 = Release|Win32 {840A29C6-DEBD-4658-B18D-72A65CE00E23}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {840A29C6-DEBD-4658-B18D-72A65CE00E23}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {F1CABC87-E8B7-4397-BB2E-E3DECACE5E9F}.Release|Win32.ActiveCfg = Release|Win32 + {F1CABC87-E8B7-4397-BB2E-E3DECACE5E9F}.Release|Win32.Build.0 = Release|Win32 + {F1CABC87-E8B7-4397-BB2E-E3DECACE5E9F}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {F1CABC87-E8B7-4397-BB2E-E3DECACE5E9F}.VSDebug|Win32.Build.0 = VSDebug|Win32 {AF910E0C-C3D0-48F8-BEA4-DCC17985BEDA}.Release|Win32.ActiveCfg = Release|Win32 {AF910E0C-C3D0-48F8-BEA4-DCC17985BEDA}.Release|Win32.Build.0 = Release|Win32 {AF910E0C-C3D0-48F8-BEA4-DCC17985BEDA}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 @@ -347,10 +461,26 @@ {4E66309E-1E56-4976-9F88-A2E434266EC7}.Release|Win32.Build.0 = Release|Win32 {4E66309E-1E56-4976-9F88-A2E434266EC7}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {4E66309E-1E56-4976-9F88-A2E434266EC7}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {37E0C874-426E-44D6-A462-8427E9F5C79E}.Release|Win32.ActiveCfg = Release|Win32 + {37E0C874-426E-44D6-A462-8427E9F5C79E}.Release|Win32.Build.0 = Release|Win32 + {37E0C874-426E-44D6-A462-8427E9F5C79E}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {37E0C874-426E-44D6-A462-8427E9F5C79E}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {EDCC6DC2-BF50-4022-A200-4A1599C49362}.Release|Win32.ActiveCfg = Release|Win32 + {EDCC6DC2-BF50-4022-A200-4A1599C49362}.Release|Win32.Build.0 = Release|Win32 + {EDCC6DC2-BF50-4022-A200-4A1599C49362}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {EDCC6DC2-BF50-4022-A200-4A1599C49362}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {6658A6BC-14DB-41EE-8949-0D6B5A531012}.Release|Win32.ActiveCfg = Release|Win32 + {6658A6BC-14DB-41EE-8949-0D6B5A531012}.Release|Win32.Build.0 = Release|Win32 + {6658A6BC-14DB-41EE-8949-0D6B5A531012}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {6658A6BC-14DB-41EE-8949-0D6B5A531012}.VSDebug|Win32.Build.0 = VSDebug|Win32 {0FA01FCF-7C9F-4FBF-BFE2-0E3D5B67C609}.Release|Win32.ActiveCfg = Release|Win32 {0FA01FCF-7C9F-4FBF-BFE2-0E3D5B67C609}.Release|Win32.Build.0 = Release|Win32 {0FA01FCF-7C9F-4FBF-BFE2-0E3D5B67C609}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {0FA01FCF-7C9F-4FBF-BFE2-0E3D5B67C609}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {8AE16F4F-28B1-48F5-A8F0-0D9C866A1CCC}.Release|Win32.ActiveCfg = Release|Win32 + {8AE16F4F-28B1-48F5-A8F0-0D9C866A1CCC}.Release|Win32.Build.0 = Release|Win32 + {8AE16F4F-28B1-48F5-A8F0-0D9C866A1CCC}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {8AE16F4F-28B1-48F5-A8F0-0D9C866A1CCC}.VSDebug|Win32.Build.0 = VSDebug|Win32 {840F51EE-55FA-4421-9BA0-0D810A1A939A}.Release|Win32.ActiveCfg = Release|Win32 {840F51EE-55FA-4421-9BA0-0D810A1A939A}.Release|Win32.Build.0 = Release|Win32 {840F51EE-55FA-4421-9BA0-0D810A1A939A}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 @@ -419,10 +549,6 @@ {5304AD69-D449-4589-B2C9-E4607E56A51D}.Release|Win32.Build.0 = Release|Win32 {5304AD69-D449-4589-B2C9-E4607E56A51D}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {5304AD69-D449-4589-B2C9-E4607E56A51D}.VSDebug|Win32.Build.0 = VSDebug|Win32 - {F94DCC2D-2B49-453E-89B3-FD81992677D0}.Release|Win32.ActiveCfg = Release|Win32 - {F94DCC2D-2B49-453E-89B3-FD81992677D0}.Release|Win32.Build.0 = Release|Win32 - {F94DCC2D-2B49-453E-89B3-FD81992677D0}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 - {F94DCC2D-2B49-453E-89B3-FD81992677D0}.VSDebug|Win32.Build.0 = VSDebug|Win32 {B9332DC8-7594-47DF-80C1-38922E0F4DFB}.Release|Win32.ActiveCfg = Release|Win32 {B9332DC8-7594-47DF-80C1-38922E0F4DFB}.Release|Win32.Build.0 = Release|Win32 {B9332DC8-7594-47DF-80C1-38922E0F4DFB}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 diff -Nru libbde-20190102/msvscpp/libcdata/libcdata.vcproj libbde-20240223/msvscpp/libcdata/libcdata.vcproj --- libbde-20190102/msvscpp/libcdata/libcdata.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/libcdata/libcdata.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -159,6 +159,14 @@ > + + + + @@ -201,6 +209,14 @@ > + + + + diff -Nru libbde-20190102/msvscpp/libcfile/libcfile.vcproj libbde-20240223/msvscpp/libcfile/libcfile.vcproj --- libbde-20190102/msvscpp/libcfile/libcfile.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/libcfile/libcfile.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -170,6 +170,10 @@ RelativePath="..\..\libcfile\libcfile_system_string.c" > + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru libbde-20190102/msvscpp/libhmac/libhmac.vcproj libbde-20240223/msvscpp/libhmac/libhmac.vcproj --- libbde-20190102/msvscpp/libhmac/libhmac.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/libhmac/libhmac.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -159,22 +159,42 @@ > + + + + + + + + + + @@ -209,22 +229,42 @@ > + + + + + + + + + + diff -Nru libbde-20190102/msvscpp/libuna/libuna.vcproj libbde-20240223/msvscpp/libuna/libuna.vcproj --- libbde-20190102/msvscpp/libuna/libuna.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/libuna/libuna.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -227,6 +227,78 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -287,6 +359,10 @@ > + + @@ -409,6 +485,78 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -481,6 +629,10 @@ > + + diff -Nru libbde-20190102/msvscpp/pybde/pybde.vcproj libbde-20240223/msvscpp/pybde/pybde.vcproj --- libbde-20190102/msvscpp/pybde/pybde.vcproj 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/msvscpp/pybde/pybde.vcproj 2024-02-23 02:47:42.000000000 +0000 @@ -40,7 +40,7 @@ &2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@HAVE_LIB_FUZZING_ENGINE_TRUE@bin_PROGRAMS = volume_fuzzer$(EXEEXT) +subdir = ossfuzz +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ + $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/pthread.m4 \ + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/tests.m4 \ + $(top_srcdir)/m4/types.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/common/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__volume_fuzzer_SOURCES_DIST = ossfuzz_libbfio.h ossfuzz_libbde.h \ + volume_fuzzer.cc +@HAVE_LIB_FUZZING_ENGINE_TRUE@am_volume_fuzzer_OBJECTS = \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ volume_fuzzer.$(OBJEXT) +volume_fuzzer_OBJECTS = $(am_volume_fuzzer_OBJECTS) +@HAVE_LIB_FUZZING_ENGINE_TRUE@volume_fuzzer_DEPENDENCIES = \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ ../libbde/libbde.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/volume_fuzzer.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(volume_fuzzer_SOURCES) +DIST_SOURCES = $(am__volume_fuzzer_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = sources-recursive splint-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DPKG_DATE = @DPKG_DATE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GREP = @GREP@ +HAVE_DLLMAIN = @HAVE_DLLMAIN@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_LIBBFIO = @HAVE_LIBBFIO@ +HAVE_LIBCAES = @HAVE_LIBCAES@ +HAVE_LIBCDATA = @HAVE_LIBCDATA@ +HAVE_LIBCERROR = @HAVE_LIBCERROR@ +HAVE_LIBCFILE = @HAVE_LIBCFILE@ +HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ +HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ +HAVE_LIBCPATH = @HAVE_LIBCPATH@ +HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ +HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ +HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ +HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ +HAVE_LIBFGUID = @HAVE_LIBFGUID@ +HAVE_LIBFUSE = @HAVE_LIBFUSE@ +HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ +HAVE_LIBHMAC = @HAVE_LIBHMAC@ +HAVE_LIBUNA = @HAVE_LIBUNA@ +HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ +HAVE_LOCAL_LIBCAES = @HAVE_LOCAL_LIBCAES@ +HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ +HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ +HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ +HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ +HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ +HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ +HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ +HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ +HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ +HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ +HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ +HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ +HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ +HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ +HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ +HAVE_OFF64_T = @HAVE_OFF64_T@ +HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ +HAVE_PTHREAD = @HAVE_PTHREAD@ +HAVE_SIZE32_T = @HAVE_SIZE32_T@ +HAVE_SIZE64_T = @HAVE_SIZE64_T@ +HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ +HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBBDE_DLL_EXPORT = @LIBBDE_DLL_EXPORT@ +LIBBDE_DLL_IMPORT = @LIBBDE_DLL_IMPORT@ +LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ +LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ +LIBCAES_CPPFLAGS = @LIBCAES_CPPFLAGS@ +LIBCAES_LIBADD = @LIBCAES_LIBADD@ +LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ +LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ +LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ +LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ +LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ +LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ +LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ +LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ +LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ +LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ +LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ +LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ +LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ +LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ +LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ +LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ +LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ +LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ +LIBDL_LIBADD = @LIBDL_LIBADD@ +LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ +LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ +LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ +LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ +LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ +LIBFGUID_LIBADD = @LIBFGUID_LIBADD@ +LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ +LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ +LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ +LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ +LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ +LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ +LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGCONFIG = @PKGCONFIG@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ +PTHREAD_LIBADD = @PTHREAD_LIBADD@ +PYTHON = @PYTHON@ +PYTHON_CONFIG = @PYTHON_CONFIG@ +PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ +PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ +PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEC_DATE = @SPEC_DATE@ +STATIC_LDFLAGS = @STATIC_LDFLAGS@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ +ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ +ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ +ax_libcaes_pc_libs_private = @ax_libcaes_pc_libs_private@ +ax_libcaes_spec_build_requires = @ax_libcaes_spec_build_requires@ +ax_libcaes_spec_requires = @ax_libcaes_spec_requires@ +ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ +ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ +ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ +ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ +ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ +ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ +ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ +ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ +ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ +ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ +ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ +ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ +ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ +ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ +ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ +ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ +ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ +ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ +ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ +ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ +ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ +ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ +ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ +ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ +ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ +ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ +ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ +ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ +ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ +ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ +ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ +ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ +ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ +ax_libfguid_pc_libs_private = @ax_libfguid_pc_libs_private@ +ax_libfguid_spec_build_requires = @ax_libfguid_spec_build_requires@ +ax_libfguid_spec_requires = @ax_libfguid_spec_requires@ +ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ +ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ +ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ +ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ +ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ +ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ +ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ +ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ +ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ +ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ +ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ +ax_libuna_spec_requires = @ax_libuna_spec_requires@ +ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +fuse_CFLAGS = @fuse_CFLAGS@ +fuse_LIBS = @fuse_LIBS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libbde_spec_requires = @libbde_spec_requires@ +libbde_spec_tools_build_requires = @libbde_spec_tools_build_requires@ +libbfio_CFLAGS = @libbfio_CFLAGS@ +libbfio_LIBS = @libbfio_LIBS@ +libcaes_CFLAGS = @libcaes_CFLAGS@ +libcaes_LIBS = @libcaes_LIBS@ +libcdata_CFLAGS = @libcdata_CFLAGS@ +libcdata_LIBS = @libcdata_LIBS@ +libcerror_CFLAGS = @libcerror_CFLAGS@ +libcerror_LIBS = @libcerror_LIBS@ +libcfile_CFLAGS = @libcfile_CFLAGS@ +libcfile_LIBS = @libcfile_LIBS@ +libclocale_CFLAGS = @libclocale_CFLAGS@ +libclocale_LIBS = @libclocale_LIBS@ +libcnotify_CFLAGS = @libcnotify_CFLAGS@ +libcnotify_LIBS = @libcnotify_LIBS@ +libcpath_CFLAGS = @libcpath_CFLAGS@ +libcpath_LIBS = @libcpath_LIBS@ +libcsplit_CFLAGS = @libcsplit_CFLAGS@ +libcsplit_LIBS = @libcsplit_LIBS@ +libcthreads_CFLAGS = @libcthreads_CFLAGS@ +libcthreads_LIBS = @libcthreads_LIBS@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libfcache_CFLAGS = @libfcache_CFLAGS@ +libfcache_LIBS = @libfcache_LIBS@ +libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ +libfdatetime_LIBS = @libfdatetime_LIBS@ +libfguid_CFLAGS = @libfguid_CFLAGS@ +libfguid_LIBS = @libfguid_LIBS@ +libfvalue_CFLAGS = @libfvalue_CFLAGS@ +libfvalue_LIBS = @libfvalue_LIBS@ +libhmac_CFLAGS = @libhmac_CFLAGS@ +libhmac_LIBS = @libhmac_LIBS@ +libuna_CFLAGS = @libuna_CFLAGS@ +libuna_LIBS = @libuna_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +openssl_CFLAGS = @openssl_CFLAGS@ +openssl_LIBS = @openssl_LIBS@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +@HAVE_LIB_FUZZING_ENGINE_TRUE@AM_CPPFLAGS = \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ -I$(top_srcdir)/include \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ -I$(top_srcdir)/common \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCERROR_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCDATA_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCNOTIFY_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBUNA_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCFILE_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCPATH_CPPFLAGS@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBBFIO_CPPFLAGS@ + +@HAVE_LIB_FUZZING_ENGINE_TRUE@volume_fuzzer_SOURCES = \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ ossfuzz_libbfio.h \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ ossfuzz_libbde.h \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ volume_fuzzer.cc + +@HAVE_LIB_FUZZING_ENGINE_TRUE@volume_fuzzer_LDADD = \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIB_FUZZING_ENGINE@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBBFIO_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCPATH_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCFILE_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBUNA_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCDATA_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ ../libbde/libbde.la \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCNOTIFY_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCLOCALE_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBCERROR_LIBADD@ \ +@HAVE_LIB_FUZZING_ENGINE_TRUE@ @LIBINTL@ + +MAINTAINERCLEANFILES = \ + Makefile.in + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ossfuzz/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu ossfuzz/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +volume_fuzzer$(EXEEXT): $(volume_fuzzer_OBJECTS) $(volume_fuzzer_DEPENDENCIES) $(EXTRA_volume_fuzzer_DEPENDENCIES) + @rm -f volume_fuzzer$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(volume_fuzzer_OBJECTS) $(volume_fuzzer_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volume_fuzzer.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +sources-local: +splint-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/volume_fuzzer.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +distclean: clean + -rm -f Makefile + +splint-local: + @echo "Running splint on volume_fuzzer ..." + -splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(volume_fuzzer_SOURCES) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru libbde-20190102/ossfuzz/ossfuzz_libbde.h libbde-20240223/ossfuzz/ossfuzz_libbde.h --- libbde-20190102/ossfuzz/ossfuzz_libbde.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/ossfuzz/ossfuzz_libbde.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * The libbde header wrapper + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _OSSFUZZ_LIBBDE_H ) +#define _OSSFUZZ_LIBBDE_H + +#include + +#include + +#endif /* !defined( _OSSFUZZ_LIBBDE_H ) */ + diff -Nru libbde-20190102/ossfuzz/ossfuzz_libbfio.h libbde-20240223/ossfuzz/ossfuzz_libbfio.h --- libbde-20190102/ossfuzz/ossfuzz_libbfio.h 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/ossfuzz/ossfuzz_libbfio.h 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * The libbfio header wrapper + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#if !defined( _OSSFUZZ_LIBBFIO_H ) +#define _OSSFUZZ_LIBBFIO_H + +#include + +/* Define HAVE_LOCAL_LIBBFIO for local use of libbfio + */ +#if defined( HAVE_LOCAL_LIBBFIO ) + +#include +#include +#include +#include +#include +#include +#include +#include + +#else + +/* If libtool DLL support is enabled set LIBBFIO_DLL_IMPORT + * before including libbfio.h + */ +#if defined( _WIN32 ) && defined( DLL_IMPORT ) && !defined( HAVE_STATIC_EXECUTABLES ) +#define LIBBFIO_DLL_IMPORT +#endif + +#include + +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( LIBBFIO_HAVE_MULTI_THREAD_SUPPORT ) +#error Multi-threading support requires libbfio with multi-threading support +#endif + +#endif /* defined( HAVE_LOCAL_LIBBFIO ) */ + +#endif /* !defined( _OSSFUZZ_LIBBFIO_H ) */ + diff -Nru libbde-20190102/ossfuzz/volume_fuzzer.cc libbde-20240223/ossfuzz/volume_fuzzer.cc --- libbde-20190102/ossfuzz/volume_fuzzer.cc 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/ossfuzz/volume_fuzzer.cc 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,99 @@ +/* + * OSS-Fuzz target for libbde volume type + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include + +/* Note that some of the OSS-Fuzz engines use C++ + */ +extern "C" { + +#include "ossfuzz_libbfio.h" +#include "ossfuzz_libbde.h" + +#if !defined( LIBBDE_HAVE_BFIO ) + +/* Opens a volume using a Basic File IO (bfio) handle + * Returns 1 if successful or -1 on error + */ +LIBBDE_EXTERN \ +int libbde_volume_open_file_io_handle( + libbde_volume_t *volume, + libbfio_handle_t *file_io_handle, + int access_flags, + libbde_error_t **error ); + +#endif /* !defined( LIBBDE_HAVE_BFIO ) */ + +int LLVMFuzzerTestOneInput( + const uint8_t *data, + size_t size ) +{ + libbfio_handle_t *file_io_handle = NULL; + libbde_volume_t *volume = NULL; + + if( libbfio_memory_range_initialize( + &file_io_handle, + NULL ) != 1 ) + { + return( 0 ); + } + if( libbfio_memory_range_set( + file_io_handle, + (uint8_t *) data, + size, + NULL ) != 1 ) + { + goto on_error_libbfio; + } + if( libbde_volume_initialize( + &volume, + NULL ) != 1 ) + { + goto on_error_libbfio; + } + if( libbde_volume_open_file_io_handle( + volume, + file_io_handle, + LIBBDE_OPEN_READ, + NULL ) != 1 ) + { + goto on_error_libbde; + } + libbde_volume_close( + volume, + NULL ); + +on_error_libbde: + libbde_volume_free( + &volume, + NULL ); + +on_error_libbfio: + libbfio_handle_free( + &file_io_handle, + NULL ); + + return( 0 ); +} + +} /* extern "C" */ + diff -Nru libbde-20190102/po/Makefile.in.in libbde-20240223/po/Makefile.in.in --- libbde-20190102/po/Makefile.in.in 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/po/Makefile.in.in 2023-12-03 08:57:24.000000000 +0000 @@ -1,20 +1,20 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper +# Copyright (C) 1995-2000 Ulrich Drepper +# Copyright (C) 2000-2020 Free Software Foundation, Inc. # -# This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU General Public -# License but which still want to provide support for the GNU gettext -# functionality. -# Please note that the actual code of GNU gettext is covered by the GNU -# General Public License and is *not* in the public domain. +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. # -# Origin: gettext-0.18 -GETTEXT_MACRO_VERSION = 0.18 +# Origin: gettext-0.21 +GETTEXT_MACRO_VERSION = 0.20 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +SED = @SED@ SHELL = /bin/sh @SET_MAKE@ @@ -44,20 +44,22 @@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ +# When building gettext-tools, we prefer to use the built programs +# rather than installed programs. However, we can't do that when we +# are cross compiling. +CROSS_COMPILING = @CROSS_COMPILING@ + GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) -MSGFMT_ = @MSGFMT@ -MSGFMT_no = @MSGFMT@ -MSGFMT_yes = @MSGFMT_015@ -MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) -MSGMERGE = msgmerge +MSGMERGE = @MSGMERGE@ MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter @@ -76,34 +78,61 @@ CATALOGS = @CATALOGS@ +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) + # Makevars gets inserted here. (Don't remove this line!) -.SUFFIXES: -.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update +all: all-@USE_NLS@ -.po.mo: - @echo "$(MSGFMT) -c -o $@ $<"; \ - $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ +.SUFFIXES: +.SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update + +# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. +# The GNU Coding Standards say in +# : +# "GNU distributions usually contain some files which are not source files +# ... . Since these files normally appear in the source directory, they +# should always appear in the source directory, not in the build directory. +# So Makefile rules to update them should put the updated files in the +# source directory." +# Therefore we put these files in the source directory, not the build directory. + +# During .po -> .gmo conversion, take into account the most recent changes to +# the .pot file. This eliminates the need to update the .po files when the +# .pot file has changed, which would be troublesome if the .po files are put +# under version control. +$(GMOFILES): $(srcdir)/$(DOMAIN).pot .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ - cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ + cd $(srcdir) && \ + rm -f $${lang}.gmo && \ + $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ + $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ + mv t-$${lang}.gmo $${lang}.gmo && \ + rm -f $${lang}.1po .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ -all: check-macro-version all-@USE_NLS@ - -all-yes: stamp-po +all-yes: $(srcdir)/stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. -check-macro-version: - @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } @@ -112,23 +141,24 @@ # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. -# In this case, stamp-po is a nop (i.e. a phony target). +# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). -# stamp-po is a timestamp denoting the last time at which the CATALOGS have -# been loosely updated. Its purpose is that when a developer or translator -# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, -# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent -# invocations of "make" will do nothing. This timestamp would not be necessary -# if updating the $(CATALOGS) would always touch them; however, the rule for -# $(POFILES) has been designed to not touch files that don't need to be -# changed. -stamp-po: $(srcdir)/$(DOMAIN).pot +# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS +# have been loosely updated. Its purpose is that when a developer or translator +# checks out the package from a version control system, and the $(DOMAIN).pot +# file is not under version control, "make" will update the $(DOMAIN).pot and +# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This +# timestamp would not be necessary if updating the $(CATALOGS) would always +# touch them; however, the rule for $(POFILES) has been designed to not touch +# files that don't need to be changed. +$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ - echo "touch stamp-po" && \ - echo timestamp > stamp-poT && \ - mv stamp-poT stamp-po; \ + echo "touch $(srcdir)/stamp-po" && \ + echo timestamp > $(srcdir)/stamp-poT && \ + mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', @@ -137,11 +167,27 @@ # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ - package_gnu='GNU '; \ + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ else \ - package_gnu=''; \ + package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ @@ -151,22 +197,30 @@ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --add-comments=TRANSLATORS: \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --add-comments=TRANSLATORS: \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --package-name="$${package_gnu}@PACKAGE@" \ + --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ esac test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ + rm -f $(DOMAIN).1po \ + || exit 1; \ + fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ @@ -189,17 +243,20 @@ # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. -$(POFILES): $(srcdir)/$(DOMAIN).pot +$(POFILES): $(POFILESDEPS) + @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ *) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ @@ -334,34 +391,41 @@ info dvi ps pdf html tags TAGS ctags CTAGS ID: +install-dvi install-ps install-pdf install-html: + mostlyclean: rm -f remove-potcdate.sed - rm -f stamp-poT + rm -f $(srcdir)/stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo + rm -f Makefile Makefile.in POTFILES maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f stamp-po $(GMOFILES) + rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: - $(MAKE) update-po + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. -dist2: stamp-po $(DISTFILES) - dists="$(DISTFILES)"; \ +dist2: $(srcdir)/stamp-po $(DISTFILES) + @dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ + else \ + case $(XGETTEXT) in \ + :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ + *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \ + esac; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ @@ -396,17 +460,19 @@ .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ diff -Nru libbde-20190102/po/Makevars libbde-20240223/po/Makevars --- libbde-20190102/po/Makevars 2019-01-02 15:58:06.000000000 +0000 +++ libbde-20240223/po/Makevars 2024-02-23 03:04:01.000000000 +0000 @@ -40,3 +40,6 @@ # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = +# Additional make targets. +sources splint: + diff -Nru libbde-20190102/po/Makevars.in libbde-20240223/po/Makevars.in --- libbde-20190102/po/Makevars.in 2016-12-14 01:55:28.000000000 +0000 +++ libbde-20240223/po/Makevars.in 2023-12-03 08:57:24.000000000 +0000 @@ -40,3 +40,6 @@ # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = +# Additional make targets. +sources splint: + diff -Nru libbde-20190102/po/Rules-quot libbde-20240223/po/Rules-quot --- libbde-20190102/po/Rules-quot 2013-01-13 14:53:08.000000000 +0000 +++ libbde-20240223/po/Rules-quot 2023-12-03 08:57:24.000000000 +0000 @@ -1,4 +1,9 @@ # Special Makefile rules for English message catalogs with quotation marks. +# +# Copyright (C) 2001-2017 Free Software Foundation, Inc. +# This file, Rules-quot, and its auxiliary files (listed under +# DISTFILES.common.extra1) are free software; the Free Software Foundation +# gives unlimited permission to use, copy, distribute, and modify them. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot @@ -14,13 +19,23 @@ .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ - if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ diff -Nru libbde-20190102/po/en@boldquot.header libbde-20240223/po/en@boldquot.header --- libbde-20190102/po/en@boldquot.header 2011-03-18 12:48:14.000000000 +0000 +++ libbde-20240223/po/en@boldquot.header 2023-12-03 08:57:24.000000000 +0000 @@ -2,7 +2,7 @@ # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see -# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). diff -Nru libbde-20190102/po/en@quot.header libbde-20240223/po/en@quot.header --- libbde-20190102/po/en@quot.header 2011-03-18 12:48:14.000000000 +0000 +++ libbde-20240223/po/en@quot.header 2023-12-03 08:57:24.000000000 +0000 @@ -2,7 +2,7 @@ # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see -# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). diff -Nru libbde-20190102/po/insert-header.sin libbde-20240223/po/insert-header.sin --- libbde-20190102/po/insert-header.sin 2011-03-18 12:48:14.000000000 +0000 +++ libbde-20240223/po/insert-header.sin 2023-12-03 08:57:24.000000000 +0000 @@ -1,5 +1,10 @@ # Sed script that inserts the file called HEADER before the header entry. # +# Copyright (C) 2001 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# This file is free software; the Free Software Foundation gives +# unlimited permission to use, copy, distribute, and modify it. +# # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following diff -Nru libbde-20190102/po/remove-potcdate.sin libbde-20240223/po/remove-potcdate.sin --- libbde-20190102/po/remove-potcdate.sin 2011-03-18 12:48:13.000000000 +0000 +++ libbde-20240223/po/remove-potcdate.sin 2023-12-03 08:57:24.000000000 +0000 @@ -1,6 +1,12 @@ -# Sed script that remove the POT-Creation-Date line in the header entry +# Sed script that removes the POT-Creation-Date line in the header entry # from a POT file. # +# Copyright (C) 2002 Free Software Foundation, Inc. +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. +# # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ diff -Nru libbde-20190102/pybde/Makefile.am libbde-20240223/pybde/Makefile.am --- libbde-20190102/pybde/Makefile.am 2018-08-06 18:11:52.000000000 +0000 +++ libbde-20240223/pybde/Makefile.am 2023-12-03 08:57:20.000000000 +0000 @@ -56,5 +56,5 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile diff -Nru libbde-20190102/pybde/Makefile.in libbde-20240223/pybde/Makefile.in --- libbde-20190102/pybde/Makefile.in 2019-01-02 15:57:52.000000000 +0000 +++ libbde-20240223/pybde/Makefile.in 2024-02-23 03:03:51.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,16 +91,16 @@ subdir = pybde ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -231,6 +231,7 @@ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -248,8 +249,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -266,6 +265,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -277,8 +282,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -296,7 +303,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -314,7 +320,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -368,8 +373,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -388,6 +391,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -398,8 +402,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -422,26 +426,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -450,7 +434,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -469,6 +452,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -511,9 +495,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -582,8 +563,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -606,11 +585,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -870,6 +846,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -922,7 +900,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -1070,6 +1047,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: uninstall-pyexecLTLIBRARIES .MAKE: install-am install-strip @@ -1087,14 +1072,14 @@ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ - uninstall-pyexecLTLIBRARIES + sources-am sources-local splint-am splint-local tags tags-am \ + uninstall uninstall-am uninstall-pyexecLTLIBRARIES .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libbde-20190102/pybde/pybde.c libbde-20240223/pybde/pybde.c --- libbde-20190102/pybde/pybde.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/pybde/pybde.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python bindings module for libbde (pybde) * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -30,22 +30,25 @@ #include "pybde.h" #include "pybde_encryption_methods.h" #include "pybde_error.h" +#include "pybde_file_object_io_handle.h" #include "pybde_key_protection_types.h" #include "pybde_key_protector.h" #include "pybde_key_protectors.h" -#include "pybde_libcerror.h" #include "pybde_libbde.h" -#include "pybde_file_object_io_handle.h" +#include "pybde_libbfio.h" +#include "pybde_libcerror.h" #include "pybde_python.h" #include "pybde_unused.h" #include "pybde_volume.h" #if !defined( LIBBDE_HAVE_BFIO ) + LIBBDE_EXTERN \ int libbde_check_volume_signature_file_io_handle( libbfio_handle_t *file_io_handle, libbde_error_t **error ); -#endif + +#endif /* !defined( LIBBDE_HAVE_BFIO ) */ /* The pybde module methods */ @@ -67,19 +70,19 @@ { "check_volume_signature_file_object", (PyCFunction) pybde_check_volume_signature_file_object, METH_VARARGS | METH_KEYWORDS, - "check_volume_signature(file_object) -> Boolean\n" + "check_volume_signature_file_object(file_object) -> Boolean\n" "\n" "Checks if a volume has a BitLocker Drive Encryption (BDE) volume signature using a file-like object." }, { "open", - (PyCFunction) pybde_volume_new_open, + (PyCFunction) pybde_open_new_volume, METH_VARARGS | METH_KEYWORDS, "open(filename, mode='r') -> Object\n" "\n" "Opens a volume." }, { "open_file_object", - (PyCFunction) pybde_volume_new_open_file_object, + (PyCFunction) pybde_open_new_volume_with_file_object, METH_VARARGS | METH_KEYWORDS, "open_file_object(file_object, mode='r') -> Object\n" "\n" @@ -96,7 +99,6 @@ PyObject *self PYBDE_ATTRIBUTE_UNUSED, PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) { - const char *errors = NULL; const char *version_string = NULL; size_t version_string_length = 0; @@ -119,10 +121,10 @@ return( PyUnicode_DecodeUTF8( version_string, (Py_ssize_t) version_string_length, - errors ) ); + NULL ) ); } -/* Checks if the volume has a BitLocker Drive Encryption (BDE) volume signature +/* Checks if a volume has a BitLocker Drive Encryption (BDE) volume signature * Returns a Python object if successful or NULL on error */ PyObject *pybde_check_volume_signature( @@ -130,12 +132,12 @@ PyObject *arguments, PyObject *keywords ) { - PyObject *string_object = NULL; - libcerror_error_t *error = NULL; - static char *function = "pybde_check_volume_signature"; - static char *keyword_list[] = { "filename", NULL }; - const char *filename_narrow = NULL; - int result = 0; + PyObject *string_object = NULL; + libcerror_error_t *error = NULL; + const char *filename_narrow = NULL; + static char *function = "pybde_check_volume_signature"; + static char *keyword_list[] = { "filename", NULL }; + int result = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) const wchar_t *filename_wide = NULL; @@ -153,7 +155,7 @@ if( PyArg_ParseTupleAndKeywords( arguments, keywords, - "|O", + "O|", keyword_list, &string_object ) == 0 ) { @@ -168,8 +170,8 @@ if( result == -1 ) { pybde_error_fetch_and_raise( - PyExc_RuntimeError, - "%s: unable to determine if string object is of type unicode.", + PyExc_RuntimeError, + "%s: unable to determine if string object is of type Unicode.", function ); return( NULL ); @@ -179,8 +181,14 @@ PyErr_Clear(); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + filename_wide = (wchar_t *) PyUnicode_AsWideCharString( + string_object, + NULL ); +#else filename_wide = (wchar_t *) PyUnicode_AsUnicode( string_object ); +#endif Py_BEGIN_ALLOW_THREADS result = libbde_check_volume_signature_wide( @@ -188,6 +196,11 @@ &error ); Py_END_ALLOW_THREADS + +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + PyMem_Free( + filename_wide ); +#endif #else utf8_string_object = PyUnicode_AsUTF8String( string_object ); @@ -196,17 +209,17 @@ { pybde_error_fetch_and_raise( PyExc_RuntimeError, - "%s: unable to convert unicode string to UTF-8.", + "%s: unable to convert Unicode string to UTF-8.", function ); return( NULL ); } #if PY_MAJOR_VERSION >= 3 filename_narrow = PyBytes_AsString( - utf8_string_object ); + utf8_string_object ); #else filename_narrow = PyString_AsString( - utf8_string_object ); + utf8_string_object ); #endif Py_BEGIN_ALLOW_THREADS @@ -218,7 +231,9 @@ Py_DecRef( utf8_string_object ); -#endif + +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + if( result == -1 ) { pybde_error_raise( @@ -248,17 +263,17 @@ #if PY_MAJOR_VERSION >= 3 result = PyObject_IsInstance( - string_object, - (PyObject *) &PyBytes_Type ); + string_object, + (PyObject *) &PyBytes_Type ); #else result = PyObject_IsInstance( - string_object, - (PyObject *) &PyString_Type ); + string_object, + (PyObject *) &PyString_Type ); #endif if( result == -1 ) { pybde_error_fetch_and_raise( - PyExc_RuntimeError, + PyExc_RuntimeError, "%s: unable to determine if string object is of type string.", function ); @@ -270,10 +285,10 @@ #if PY_MAJOR_VERSION >= 3 filename_narrow = PyBytes_AsString( - string_object ); + string_object ); #else filename_narrow = PyString_AsString( - string_object ); + string_object ); #endif Py_BEGIN_ALLOW_THREADS @@ -316,7 +331,7 @@ return( NULL ); } -/* Checks if the volume has a BitLocker Drive Encryption (BDE) volume signature using a file-like object +/* Checks if a volume has a BitLocker Drive Encryption (BDE) volume signature using a file-like object * Returns a Python object if successful or NULL on error */ PyObject *pybde_check_volume_signature_file_object( @@ -324,9 +339,9 @@ PyObject *arguments, PyObject *keywords ) { - libcerror_error_t *error = NULL; - libbfio_handle_t *file_io_handle = NULL; PyObject *file_object = NULL; + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_check_volume_signature_file_object"; static char *keyword_list[] = { "file_object", NULL }; int result = 0; @@ -336,7 +351,7 @@ if( PyArg_ParseTupleAndKeywords( arguments, keywords, - "|O", + "O|", keyword_list, &file_object ) == 0 ) { @@ -416,6 +431,108 @@ return( NULL ); } +/* Creates a new volume object and opens it + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_open_new_volume( + PyObject *self PYBDE_ATTRIBUTE_UNUSED, + PyObject *arguments, + PyObject *keywords ) +{ + pybde_volume_t *pybde_volume = NULL; + static char *function = "pybde_open_new_volume"; + + PYBDE_UNREFERENCED_PARAMETER( self ) + + /* PyObject_New does not invoke tp_init + */ + pybde_volume = PyObject_New( + struct pybde_volume, + &pybde_volume_type_object ); + + if( pybde_volume == NULL ) + { + PyErr_Format( + PyExc_MemoryError, + "%s: unable to create volume.", + function ); + + goto on_error; + } + if( pybde_volume_init( + pybde_volume ) != 0 ) + { + goto on_error; + } + if( pybde_volume_open( + pybde_volume, + arguments, + keywords ) == NULL ) + { + goto on_error; + } + return( (PyObject *) pybde_volume ); + +on_error: + if( pybde_volume != NULL ) + { + Py_DecRef( + (PyObject *) pybde_volume ); + } + return( NULL ); +} + +/* Creates a new volume object and opens it using a file-like object + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_open_new_volume_with_file_object( + PyObject *self PYBDE_ATTRIBUTE_UNUSED, + PyObject *arguments, + PyObject *keywords ) +{ + pybde_volume_t *pybde_volume = NULL; + static char *function = "pybde_open_new_volume_with_file_object"; + + PYBDE_UNREFERENCED_PARAMETER( self ) + + /* PyObject_New does not invoke tp_init + */ + pybde_volume = PyObject_New( + struct pybde_volume, + &pybde_volume_type_object ); + + if( pybde_volume == NULL ) + { + PyErr_Format( + PyExc_MemoryError, + "%s: unable to create volume.", + function ); + + goto on_error; + } + if( pybde_volume_init( + pybde_volume ) != 0 ) + { + goto on_error; + } + if( pybde_volume_open_file_object( + pybde_volume, + arguments, + keywords ) == NULL ) + { + goto on_error; + } + return( (PyObject *) pybde_volume ); + +on_error: + if( pybde_volume != NULL ) + { + Py_DecRef( + (PyObject *) pybde_volume ); + } + return( NULL ); +} + #if PY_MAJOR_VERSION >= 3 /* The pybde module definition @@ -453,13 +570,8 @@ void ) #endif { - PyObject *module = NULL; - PyTypeObject *encryption_methods_type_object = NULL; - PyTypeObject *key_protection_types_type_object = NULL; - PyTypeObject *key_protector_type_object = NULL; - PyTypeObject *key_protectors_type_object = NULL; - PyTypeObject *volume_type_object = NULL; - PyGILState_STATE gil_state = 0; + PyObject *module = NULL; + PyGILState_STATE gil_state = 0; #if defined( HAVE_DEBUG_OUTPUT ) libbde_notify_set_stream( @@ -490,49 +602,56 @@ return; #endif } +#if PY_VERSION_HEX < 0x03070000 PyEval_InitThreads(); - +#endif gil_state = PyGILState_Ensure(); - /* Setup the volume type object + /* Setup the encryption_methods type object */ - pybde_volume_type_object.tp_new = PyType_GenericNew; + pybde_encryption_methods_type_object.tp_new = PyType_GenericNew; + if( pybde_encryption_methods_init_type( + &pybde_encryption_methods_type_object ) != 1 ) + { + goto on_error; + } if( PyType_Ready( - &pybde_volume_type_object ) < 0 ) + &pybde_encryption_methods_type_object ) < 0 ) { goto on_error; } Py_IncRef( - (PyObject *) &pybde_volume_type_object ); - - volume_type_object = &pybde_volume_type_object; + (PyObject *) &pybde_encryption_methods_type_object ); PyModule_AddObject( module, - "volume", - (PyObject *) volume_type_object ); + "encryption_methods", + (PyObject *) &pybde_encryption_methods_type_object ); - /* Setup the key protectors type object + /* Setup the key_protection_types type object */ - pybde_key_protectors_type_object.tp_new = PyType_GenericNew; + pybde_key_protection_types_type_object.tp_new = PyType_GenericNew; + if( pybde_key_protection_types_init_type( + &pybde_key_protection_types_type_object ) != 1 ) + { + goto on_error; + } if( PyType_Ready( - &pybde_key_protectors_type_object ) < 0 ) + &pybde_key_protection_types_type_object ) < 0 ) { goto on_error; } Py_IncRef( - (PyObject *) &pybde_key_protectors_type_object ); - - key_protectors_type_object = &pybde_key_protectors_type_object; + (PyObject *) &pybde_key_protection_types_type_object ); PyModule_AddObject( module, - "_key_protectors", - (PyObject *) key_protectors_type_object ); + "key_protection_types", + (PyObject *) &pybde_key_protection_types_type_object ); - /* Setup the key protector type object + /* Setup the key_protector type object */ pybde_key_protector_type_object.tp_new = PyType_GenericNew; @@ -544,60 +663,44 @@ Py_IncRef( (PyObject *) &pybde_key_protector_type_object ); - key_protector_type_object = &pybde_key_protector_type_object; - PyModule_AddObject( module, "key_protector", - (PyObject *) key_protector_type_object ); + (PyObject *) &pybde_key_protector_type_object ); - /* Setup the encryption methods type object + /* Setup the key_protectors type object */ - pybde_encryption_methods_type_object.tp_new = PyType_GenericNew; + pybde_key_protectors_type_object.tp_new = PyType_GenericNew; - if( pybde_encryption_methods_init_type( - &pybde_encryption_methods_type_object ) != 1 ) - { - goto on_error; - } if( PyType_Ready( - &pybde_encryption_methods_type_object ) < 0 ) + &pybde_key_protectors_type_object ) < 0 ) { goto on_error; } Py_IncRef( - (PyObject *) &pybde_encryption_methods_type_object ); - - encryption_methods_type_object = &pybde_encryption_methods_type_object; + (PyObject *) &pybde_key_protectors_type_object ); PyModule_AddObject( module, - "encryption_methods", - (PyObject *) encryption_methods_type_object ); + "key_protectors", + (PyObject *) &pybde_key_protectors_type_object ); - /* Setup the key protection types type object + /* Setup the volume type object */ - pybde_key_protection_types_type_object.tp_new = PyType_GenericNew; + pybde_volume_type_object.tp_new = PyType_GenericNew; - if( pybde_key_protection_types_init_type( - &pybde_key_protection_types_type_object ) != 1 ) - { - goto on_error; - } if( PyType_Ready( - &pybde_key_protection_types_type_object ) < 0 ) + &pybde_volume_type_object ) < 0 ) { goto on_error; } Py_IncRef( - (PyObject *) &pybde_key_protection_types_type_object ); - - key_protection_types_type_object = &pybde_key_protection_types_type_object; + (PyObject *) &pybde_volume_type_object ); PyModule_AddObject( module, - "key_protection_types", - (PyObject *) key_protection_types_type_object ); + "volume", + (PyObject *) &pybde_volume_type_object ); PyGILState_Release( gil_state ); diff -Nru libbde-20190102/pybde/pybde.h libbde-20240223/pybde/pybde.h --- libbde-20190102/pybde/pybde.h 2019-01-02 14:16:40.000000000 +0000 +++ libbde-20240223/pybde/pybde.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* - * Python bindings for libbde (pybde) + * Python bindings module for libbde (pybde) * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_H ) @@ -44,6 +44,16 @@ PyObject *self, PyObject *arguments, PyObject *keywords ); + +PyObject *pybde_open_new_volume( + PyObject *self, + PyObject *arguments, + PyObject *keywords ); + +PyObject *pybde_open_new_volume_with_file_object( + PyObject *self, + PyObject *arguments, + PyObject *keywords ); #if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit_pybde( diff -Nru libbde-20190102/pybde/pybde_datetime.c libbde-20240223/pybde/pybde_datetime.c --- libbde-20190102/pybde/pybde_datetime.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_datetime.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Date and time functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -28,6 +28,146 @@ #include +/* Creates a new datetime object from date and time elements + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_datetime_new_from_time_elements( + uint16_t year, + uint64_t number_of_days, + uint8_t hours, + uint8_t minutes, + uint8_t seconds, + uint32_t micro_seconds ) +{ + PyObject *datetime_object = NULL; + static char *function = "pybde_datetime_new_from_time_elements"; + uint32_t days_in_century = 0; + uint16_t days_in_year = 0; + uint8_t day_of_month = 0; + uint8_t days_in_month = 0; + uint8_t month = 0; + + while( number_of_days > 0 ) + { + if( ( year % 400 ) == 0 ) + { + days_in_century = 36525; + } + else + { + days_in_century = 36524; + } + if( number_of_days <= days_in_century ) + { + break; + } + number_of_days -= days_in_century; + + year += 100; + } + while( number_of_days > 0 ) + { + /* Check for a leap year + * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) + */ + if( ( ( ( year % 4 ) == 0 ) + && ( ( year % 100 ) != 0 ) ) + || ( ( year % 400 ) == 0 ) ) + { + days_in_year = 366; + } + else + { + days_in_year = 365; + } + if( number_of_days <= days_in_year ) + { + break; + } + number_of_days -= days_in_year; + + year += 1; + } + /* Determine the month correct the value to days within the month + */ + month = 1; + + while( number_of_days > 0 ) + { + /* February (2) + */ + if( month == 2 ) + { + if( ( ( ( year % 4 ) == 0 ) + && ( ( year % 100 ) != 0 ) ) + || ( ( year % 400 ) == 0 ) ) + { + days_in_month = 29; + } + else + { + days_in_month = 28; + } + } + /* April (4), June (6), September (9), November (11) + */ + else if( ( month == 4 ) + || ( month == 6 ) + || ( month == 9 ) + || ( month == 11 ) ) + { + days_in_month = 30; + } + /* January (1), March (3), May (5), July (7), August (8), October (10), December (12) + */ + else if( ( month == 1 ) + || ( month == 3 ) + || ( month == 5 ) + || ( month == 7 ) + || ( month == 8 ) + || ( month == 10 ) + || ( month == 12 ) ) + { + days_in_month = 31; + } + /* This should never happen, but just in case + */ + else + { + PyErr_Format( + PyExc_IOError, + "%s: unsupported month: %" PRIu8 ".", + function, + month ); + + return( NULL ); + } + if( number_of_days <= days_in_month ) + { + break; + } + number_of_days -= days_in_month; + + month += 1; + } + /* Determine the day + */ + day_of_month = (uint8_t) number_of_days; + + PyDateTime_IMPORT; + + datetime_object = (PyObject *) PyDateTime_FromDateAndTime( + (int) year, + (int) month, + (int) day_of_month, + (int) hours, + (int) minutes, + (int) seconds, + (int) micro_seconds ); + + return( datetime_object ); +} + /* Creates a new datetime object from a FAT date time * Returns a Python object if successful or NULL on error */ @@ -98,7 +238,7 @@ { days_in_month = 30; } - /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) + /* January (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) @@ -152,16 +292,10 @@ uint64_t filetime ) { PyObject *datetime_object = NULL; - static char *function = "pybde_datetime_new_from_filetime"; - uint32_t days_in_century = 0; uint32_t micro_seconds = 0; - uint16_t days_in_year = 0; uint16_t year = 0; - uint8_t day_of_month = 0; - uint8_t days_in_month = 0; uint8_t hours = 0; uint8_t minutes = 0; - uint8_t month = 0; uint8_t seconds = 0; /* The timestamp is in units of 100 nano seconds correct the value to seconds @@ -199,123 +333,13 @@ filetime -= 36159; } - while( filetime > 0 ) - { - if( ( year % 400 ) == 0 ) - { - days_in_century = 36525; - } - else - { - days_in_century = 36524; - } - if( filetime <= days_in_century ) - { - break; - } - filetime -= days_in_century; - - year += 100; - } - while( filetime > 0 ) - { - /* Check for a leap year - * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) - */ - if( ( ( ( year % 4 ) == 0 ) - && ( ( year % 100 ) != 0 ) ) - || ( ( year % 400 ) == 0 ) ) - { - days_in_year = 366; - } - else - { - days_in_year = 365; - } - if( filetime <= days_in_year ) - { - break; - } - filetime -= days_in_year; - - year += 1; - } - /* Determine the month correct the value to days within the month - */ - month = 1; - - while( filetime > 0 ) - { - /* February (2) - */ - if( month == 2 ) - { - if( ( ( ( year % 4 ) == 0 ) - && ( ( year % 100 ) != 0 ) ) - || ( ( year % 400 ) == 0 ) ) - { - days_in_month = 29; - } - else - { - days_in_month = 28; - } - } - /* April (4), June (6), September (9), November (11) - */ - else if( ( month == 4 ) - || ( month == 6 ) - || ( month == 9 ) - || ( month == 11 ) ) - { - days_in_month = 30; - } - /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) - */ - else if( ( month == 1 ) - || ( month == 3 ) - || ( month == 5 ) - || ( month == 7 ) - || ( month == 8 ) - || ( month == 10 ) - || ( month == 12 ) ) - { - days_in_month = 31; - } - /* This should never happen, but just in case - */ - else - { - PyErr_Format( - PyExc_IOError, - "%s: unsupported month: %" PRIu8 ".", - function, - month ); - - return( NULL ); - } - if( filetime <= days_in_month ) - { - break; - } - filetime -= days_in_month; - - month += 1; - } - /* Determine the day - */ - day_of_month = (uint8_t) filetime; - - PyDateTime_IMPORT; - - datetime_object = (PyObject *) PyDateTime_FromDateAndTime( - (int) year, - (int) month, - (int) day_of_month, - (int) hours, - (int) minutes, - (int) seconds, - (int) micro_seconds ); + datetime_object = pybde_datetime_new_from_time_elements( + year, + filetime, + hours, + minutes, + seconds, + micro_seconds ); return( datetime_object ); } @@ -425,7 +449,7 @@ { days_in_month = 30; } - /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) + /* January (1), March (3), May (5), July (7), August (8), October (10), December (12) */ else if( ( month == 1 ) || ( month == 3 ) @@ -500,21 +524,69 @@ return( datetime_object ); } +/* Creates a new datetime object from a HFS time + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_datetime_new_from_hfs_time( + uint32_t hfs_time ) +{ + PyObject *datetime_object = NULL; + uint16_t year = 0; + uint8_t hours = 0; + uint8_t minutes = 0; + uint8_t seconds = 0; + + /* There are 60 seconds in a minute correct the value to minutes + */ + seconds = (uint8_t) ( hfs_time % 60 ); + hfs_time /= 60; + + /* There are 60 minutes in an hour correct the value to hours + */ + minutes = (uint8_t) ( hfs_time % 60 ); + hfs_time /= 60; + + /* There are 24 hours in a day correct the value to days + */ + hours = (uint8_t) ( hfs_time % 24 ); + hfs_time /= 24; + + /* Add 1 day to compensate that Jan 1 1904 is represented as 0 + */ + hfs_time += 1; + + /* Determine the number of years starting at '1 Jan 1904 00:00:00' + * correct the value to days within the year + */ + year = 1904; + + if( hfs_time >= 35064 ) + { + year = 2000; + + hfs_time -= 35064; + } + datetime_object = pybde_datetime_new_from_time_elements( + year, + (uint64_t) hfs_time, + hours, + minutes, + seconds, + 0 ); + + return( datetime_object ); +} + /* Creates a new datetime object from a POSIX time * Returns a Python object if successful or NULL on error */ PyObject *pybde_datetime_new_from_posix_time( - uint32_t posix_time ) + int64_t posix_time ) { PyObject *datetime_object = NULL; - static char *function = "pybde_datetime_new_from_posix_time"; - uint16_t days_in_year = 0; uint16_t year = 0; - uint8_t day_of_month = 0; - uint8_t days_in_month = 0; uint8_t hours = 0; uint8_t minutes = 0; - uint8_t month = 0; uint8_t seconds = 0; /* There are 60 seconds in a minute correct the value to minutes @@ -547,105 +619,72 @@ posix_time -= 10957; } - while( posix_time > 0 ) - { - /* Check for a leap year - * The year is ( ( dividable by 4 ) and ( not dividable by 100 ) ) or ( dividable by 400 ) - */ - if( ( ( ( year % 4 ) == 0 ) - && ( ( year % 100 ) != 0 ) ) - || ( ( year % 400 ) == 0 ) ) - { - days_in_year = 366; - } - else - { - days_in_year = 365; - } - if( posix_time <= days_in_year ) - { - break; - } - posix_time -= days_in_year; + datetime_object = pybde_datetime_new_from_time_elements( + year, + (uint64_t) posix_time, + hours, + minutes, + seconds, + 0 ); - year += 1; - } - /* Determine the month correct the value to days within the month + return( datetime_object ); +} + +/* Creates a new datetime object from a POSIX time in micro seconds + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_datetime_new_from_posix_time_in_micro_seconds( + int64_t posix_time ) +{ + PyObject *datetime_object = NULL; + uint32_t micro_seconds = 0; + uint16_t year = 0; + uint8_t hours = 0; + uint8_t minutes = 0; + uint8_t seconds = 0; + + /* There are 1000000 micro seconds in a second correct the value to seconds */ - month = 1; + micro_seconds = (uint32_t) ( posix_time % 1000000 ); + posix_time /= 1000000; - while( posix_time > 0 ) - { - /* February (2) - */ - if( month == 2 ) - { - if( ( ( ( year % 4 ) == 0 ) - && ( ( year % 100 ) != 0 ) ) - || ( ( year % 400 ) == 0 ) ) - { - days_in_month = 29; - } - else - { - days_in_month = 28; - } - } - /* April (4), June (6), September (9), November (11) - */ - else if( ( month == 4 ) - || ( month == 6 ) - || ( month == 9 ) - || ( month == 11 ) ) - { - days_in_month = 30; - } - /* Januari (1), March (3), May (5), July (7), August (8), October (10), December (12) - */ - else if( ( month == 1 ) - || ( month == 3 ) - || ( month == 5 ) - || ( month == 7 ) - || ( month == 8 ) - || ( month == 10 ) - || ( month == 12 ) ) - { - days_in_month = 31; - } - /* This should never happen, but just in case - */ - else - { - PyErr_Format( - PyExc_IOError, - "%s: unsupported month: %" PRIu8 ".", - function, - month ); + /* There are 60 seconds in a minute correct the value to minutes + */ + seconds = posix_time % 60; + posix_time /= 60; - return( NULL ); - } - if( posix_time <= days_in_month ) - { - break; - } - posix_time -= days_in_month; + /* There are 60 minutes in an hour correct the value to hours + */ + minutes = posix_time % 60; + posix_time /= 60; - month += 1; - } - /* Determine the day + /* There are 24 hours in a day correct the value to days */ - day_of_month = (uint8_t) posix_time; + hours = posix_time % 24; + posix_time /= 24; - PyDateTime_IMPORT; + /* Add 1 day to compensate that Jan 1 1970 is represented as 0 + */ + posix_time += 1; - datetime_object = (PyObject *) PyDateTime_FromDateAndTime( - (int) year, - (int) month, - (int) day_of_month, - (int) hours, - (int) minutes, - (int) seconds, - 0 ); + /* Determine the number of years starting at '1 Jan 1970 00:00:00' + * correct the value to days within the year + */ + year = 1970; + + if( posix_time >= 10957 ) + { + year = 2000; + + posix_time -= 10957; + } + datetime_object = pybde_datetime_new_from_time_elements( + year, + (uint64_t) posix_time, + hours, + minutes, + seconds, + micro_seconds ); return( datetime_object ); } diff -Nru libbde-20190102/pybde/pybde_datetime.h libbde-20240223/pybde/pybde_datetime.h --- libbde-20190102/pybde/pybde_datetime.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_datetime.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Date and time functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_DATETIME_H ) @@ -31,6 +31,14 @@ extern "C" { #endif +PyObject *pybde_datetime_new_from_time_elements( + uint16_t year, + uint64_t number_of_days, + uint8_t hours, + uint8_t minutes, + uint8_t seconds, + uint32_t micro_seconds ); + PyObject *pybde_datetime_new_from_fat_date_time( uint32_t fat_date_time ); @@ -40,8 +48,14 @@ PyObject *pybde_datetime_new_from_floatingtime( uint64_t floatingtime ); +PyObject *pybde_datetime_new_from_hfs_time( + uint32_t hfs_time ); + PyObject *pybde_datetime_new_from_posix_time( - uint32_t posix_time ); + int64_t posix_time ); + +PyObject *pybde_datetime_new_from_posix_time_in_micro_seconds( + int64_t posix_time ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/pybde/pybde_encryption_methods.c libbde-20240223/pybde/pybde_encryption_methods.c --- libbde-20190102/pybde/pybde_encryption_methods.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_encryption_methods.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object definition of the libbde encryption methods * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -284,7 +284,7 @@ return( NULL ); } -/* Intializes an encryption methods object +/* Initializes an encryption methods object * Returns 0 if successful or -1 on error */ int pybde_encryption_methods_init( diff -Nru libbde-20190102/pybde/pybde_encryption_methods.h libbde-20240223/pybde/pybde_encryption_methods.h --- libbde-20190102/pybde/pybde_encryption_methods.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_encryption_methods.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object definition of the libbde encryption methods * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_ENCRYPTION_METHODS_H ) diff -Nru libbde-20190102/pybde/pybde_error.c libbde-20240223/pybde/pybde_error.c --- libbde-20190102/pybde/pybde_error.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_error.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -388,7 +388,8 @@ { break; } - if( error_string[ error_string_index ] == '\n' ) + if( ( error_string[ error_string_index ] == '\n' ) + || ( error_string[ error_string_index ] == '\r' ) ) { error_string[ error_string_index ] = ' '; } diff -Nru libbde-20190102/pybde/pybde_error.h libbde-20240223/pybde/pybde_error.h --- libbde-20190102/pybde/pybde_error.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_error.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Error functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_ERROR_H ) diff -Nru libbde-20190102/pybde/pybde_file_object_io_handle.c libbde-20240223/pybde/pybde_file_object_io_handle.c --- libbde-20190102/pybde/pybde_file_object_io_handle.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_file_object_io_handle.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python file object IO handle functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -232,13 +232,13 @@ Py_DecRef( ( *file_object_io_handle )->file_object ); - PyGILState_Release( - gil_state ); - PyMem_Free( *file_object_io_handle ); *file_object_io_handle = NULL; + + PyGILState_Release( + gil_state ); } return( 1 ); } @@ -578,7 +578,7 @@ error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to data to buffer.", + "%s: unable to copy data to buffer.", function ); goto on_error; diff -Nru libbde-20190102/pybde/pybde_file_object_io_handle.h libbde-20240223/pybde/pybde_file_object_io_handle.h --- libbde-20190102/pybde/pybde_file_object_io_handle.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_file_object_io_handle.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python file object IO handle functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_FILE_OBJECT_IO_HANDLE_H ) diff -Nru libbde-20190102/pybde/pybde_guid.c libbde-20240223/pybde/pybde_guid.c --- libbde-20190102/pybde/pybde_guid.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_guid.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * GUID functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -39,7 +39,6 @@ libcerror_error_t *error = NULL; libfguid_identifier_t *guid = NULL; PyObject *string_object = NULL; - const char *errors = NULL; static char *function = "pybde_string_new_from_guid"; if( libfguid_identifier_initialize( @@ -115,7 +114,7 @@ string_object = PyUnicode_DecodeUTF8( guid_string, (Py_ssize_t) 36, - errors ); + NULL ); return( string_object ); diff -Nru libbde-20190102/pybde/pybde_guid.h libbde-20240223/pybde/pybde_guid.h --- libbde-20190102/pybde/pybde_guid.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_guid.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * GUID functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_GUID_H ) diff -Nru libbde-20190102/pybde/pybde_integer.c libbde-20240223/pybde/pybde_integer.c --- libbde-20190102/pybde/pybde_integer.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_integer.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Integer functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -188,6 +188,7 @@ } } #endif /* PY_MAJOR_VERSION < 3 */ + if( result == 0 ) { libcerror_error_set( @@ -333,6 +334,7 @@ } } #endif /* PY_MAJOR_VERSION < 3 */ + if( result == 0 ) { libcerror_error_set( diff -Nru libbde-20190102/pybde/pybde_integer.h libbde-20240223/pybde/pybde_integer.h --- libbde-20190102/pybde/pybde_integer.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_integer.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Integer functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_INTEGER_H ) diff -Nru libbde-20190102/pybde/pybde_key_protection_types.c libbde-20240223/pybde/pybde_key_protection_types.c --- libbde-20190102/pybde/pybde_key_protection_types.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_key_protection_types.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object definition of the libbde key protection types * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -188,6 +188,20 @@ } #if PY_MAJOR_VERSION >= 3 value_object = PyLong_FromLong( + LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN ); +#else + value_object = PyInt_FromLong( + LIBBDE_KEY_PROTECTION_TYPE_TPM_AND_PIN ); +#endif + if( PyDict_SetItemString( + type_object->tp_dict, + "TPM_AND_PIN", + value_object ) != 0 ) + { + goto on_error; + } +#if PY_MAJOR_VERSION >= 3 + value_object = PyLong_FromLong( LIBBDE_KEY_PROTECTION_TYPE_RECOVERY_PASSWORD ); #else value_object = PyInt_FromLong( @@ -270,7 +284,7 @@ return( NULL ); } -/* Intializes a key protection types object +/* Initializes a key protection types object * Returns 0 if successful or -1 on error */ int pybde_key_protection_types_init( diff -Nru libbde-20190102/pybde/pybde_key_protection_types.h libbde-20240223/pybde/pybde_key_protection_types.h --- libbde-20190102/pybde/pybde_key_protection_types.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_key_protection_types.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object definition of the libbde key protection types * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_KEY_PROTECTION_TYPES_H ) diff -Nru libbde-20190102/pybde/pybde_key_protector.c libbde-20240223/pybde/pybde_key_protector.c --- libbde-20190102/pybde/pybde_key_protector.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/pybde/pybde_key_protector.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object wrapper of libbde_key_protector_t * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -39,14 +39,14 @@ { "get_identifier", (PyCFunction) pybde_key_protector_get_identifier, METH_NOARGS, - "get_identifier() -> Unicode string or None\n" + "get_identifier() -> Unicode string\n" "\n" "Retrieves the identifier." }, { "get_type", (PyCFunction) pybde_key_protector_get_type, METH_NOARGS, - "get_type() -> Integer or None\n" + "get_type() -> Integer\n" "\n" "Retrieves the type." }, @@ -171,7 +171,6 @@ * Returns a Python object if successful or NULL on error */ PyObject *pybde_key_protector_new( - PyTypeObject *type_object, libbde_key_protector_t *key_protector, PyObject *parent_object ) { @@ -187,9 +186,11 @@ return( NULL ); } + /* PyObject_New does not invoke tp_init + */ pybde_key_protector = PyObject_New( struct pybde_key_protector, - type_object ); + &pybde_key_protector_type_object ); if( pybde_key_protector == NULL ) { @@ -200,22 +201,14 @@ goto on_error; } - if( pybde_key_protector_init( - pybde_key_protector ) != 0 ) - { - PyErr_Format( - PyExc_MemoryError, - "%s: unable to initialize key protector.", - function ); - - goto on_error; - } pybde_key_protector->key_protector = key_protector; pybde_key_protector->parent_object = parent_object; - Py_IncRef( - (PyObject *) pybde_key_protector->parent_object ); - + if( pybde_key_protector->parent_object != NULL ) + { + Py_IncRef( + pybde_key_protector->parent_object ); + } return( (PyObject *) pybde_key_protector ); on_error: @@ -227,7 +220,7 @@ return( NULL ); } -/* Intializes a key protector object +/* Initializes a key protector object * Returns 0 if successful or -1 on error */ int pybde_key_protector_init( @@ -248,7 +241,12 @@ */ pybde_key_protector->key_protector = NULL; - return( 0 ); + PyErr_Format( + PyExc_NotImplementedError, + "%s: initialize of key protector not supported.", + function ); + + return( -1 ); } /* Frees a key protector object @@ -270,15 +268,6 @@ return; } - if( pybde_key_protector->key_protector == NULL ) - { - PyErr_Format( - PyExc_ValueError, - "%s: invalid key protector - missing libbde key protector.", - function ); - - return; - } ob_type = Py_TYPE( pybde_key_protector ); @@ -300,29 +289,32 @@ return; } - Py_BEGIN_ALLOW_THREADS - - result = libbde_key_protector_free( - &( pybde_key_protector->key_protector ), - &error ); - - Py_END_ALLOW_THREADS - - if( result != 1 ) + if( pybde_key_protector->key_protector != NULL ) { - pybde_error_raise( - error, - PyExc_IOError, - "%s: unable to free libbde key protector.", - function ); + Py_BEGIN_ALLOW_THREADS - libcerror_error_free( - &error ); + result = libbde_key_protector_free( + &( pybde_key_protector->key_protector ), + &error ); + + Py_END_ALLOW_THREADS + + if( result != 1 ) + { + pybde_error_raise( + error, + PyExc_MemoryError, + "%s: unable to free libbde key protector.", + function ); + + libcerror_error_free( + &error ); + } } if( pybde_key_protector->parent_object != NULL ) { Py_DecRef( - (PyObject *) pybde_key_protector->parent_object ); + pybde_key_protector->parent_object ); } ob_type->tp_free( (PyObject*) pybde_key_protector ); @@ -363,7 +355,7 @@ Py_END_ALLOW_THREADS - if( result == -1 ) + if( result != 1 ) { pybde_error_raise( error, @@ -376,17 +368,19 @@ return( NULL ); } - else if( result == 0 ) - { - Py_IncRef( - Py_None ); - - return( Py_None ); - } string_object = pybde_string_new_from_guid( guid_data, 16 ); + if( string_object == NULL ) + { + PyErr_Format( + PyExc_IOError, + "%s: unable to convert GUID into Unicode object.", + function ); + + return( NULL ); + } return( string_object ); } @@ -423,7 +417,7 @@ Py_END_ALLOW_THREADS - if( result == -1 ) + if( result != 1 ) { pybde_error_raise( error, @@ -436,13 +430,6 @@ return( NULL ); } - else if( result == 0 ) - { - Py_IncRef( - Py_None ); - - return( Py_None ); - } #if PY_MAJOR_VERSION >= 3 integer_object = PyLong_FromLong( (long) type ); diff -Nru libbde-20190102/pybde/pybde_key_protector.h libbde-20240223/pybde/pybde_key_protector.h --- libbde-20190102/pybde/pybde_key_protector.h 2019-01-02 14:17:03.000000000 +0000 +++ libbde-20240223/pybde/pybde_key_protector.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object wrapper of libbde_key_protector_t * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_KEY_PROTECTOR_H ) @@ -53,7 +53,6 @@ extern PyTypeObject pybde_key_protector_type_object; PyObject *pybde_key_protector_new( - PyTypeObject *type_object, libbde_key_protector_t *key_protector, PyObject *parent_object ); diff -Nru libbde-20190102/pybde/pybde_key_protectors.c libbde-20240223/pybde/pybde_key_protectors.c --- libbde-20190102/pybde/pybde_key_protectors.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/pybde/pybde_key_protectors.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object definition of the sequence and iterator object of key protectors * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -59,7 +59,7 @@ PyVarObject_HEAD_INIT( NULL, 0 ) /* tp_name */ - "pybde._key_protectors", + "pybde.key_protectors", /* tp_basicsize */ sizeof( pybde_key_protectors_t ), /* tp_itemsize */ @@ -97,7 +97,7 @@ /* tp_flags */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_ITER, /* tp_doc */ - "pybde internal sequence and iterator object of key protectors", + "pybde sequence and iterator object of key protectors", /* tp_traverse */ 0, /* tp_clear */ @@ -150,7 +150,7 @@ 0 }; -/* Creates a new key protectors object +/* Creates a new key protectors sequence and iterator object * Returns a Python object if successful or NULL on error */ PyObject *pybde_key_protectors_new( @@ -160,8 +160,8 @@ int index ), int number_of_items ) { - pybde_key_protectors_t *key_protectors_object = NULL; - static char *function = "pybde_key_protectors_new"; + pybde_key_protectors_t *sequence_object = NULL; + static char *function = "pybde_key_protectors_new"; if( parent_object == NULL ) { @@ -183,93 +183,89 @@ } /* Make sure the key protectors values are initialized */ - key_protectors_object = PyObject_New( - struct pybde_key_protectors, - &pybde_key_protectors_type_object ); + sequence_object = PyObject_New( + struct pybde_key_protectors, + &pybde_key_protectors_type_object ); - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_MemoryError, - "%s: unable to create key protectors object.", + "%s: unable to create sequence object.", function ); goto on_error; } - if( pybde_key_protectors_init( - key_protectors_object ) != 0 ) - { - PyErr_Format( - PyExc_MemoryError, - "%s: unable to initialize key protectors object.", - function ); - - goto on_error; - } - key_protectors_object->parent_object = parent_object; - key_protectors_object->get_item_by_index = get_item_by_index; - key_protectors_object->number_of_items = number_of_items; + sequence_object->parent_object = parent_object; + sequence_object->get_item_by_index = get_item_by_index; + sequence_object->current_index = 0; + sequence_object->number_of_items = number_of_items; Py_IncRef( - (PyObject *) key_protectors_object->parent_object ); + (PyObject *) sequence_object->parent_object ); - return( (PyObject *) key_protectors_object ); + return( (PyObject *) sequence_object ); on_error: - if( key_protectors_object != NULL ) + if( sequence_object != NULL ) { Py_DecRef( - (PyObject *) key_protectors_object ); + (PyObject *) sequence_object ); } return( NULL ); } -/* Intializes a key protectors object +/* Initializes a key protectors sequence and iterator object * Returns 0 if successful or -1 on error */ int pybde_key_protectors_init( - pybde_key_protectors_t *key_protectors_object ) + pybde_key_protectors_t *sequence_object ) { static char *function = "pybde_key_protectors_init"; - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object.", + "%s: invalid sequence object.", function ); return( -1 ); } /* Make sure the key protectors values are initialized */ - key_protectors_object->parent_object = NULL; - key_protectors_object->get_item_by_index = NULL; - key_protectors_object->current_index = 0; - key_protectors_object->number_of_items = 0; + sequence_object->parent_object = NULL; + sequence_object->get_item_by_index = NULL; + sequence_object->current_index = 0; + sequence_object->number_of_items = 0; + + PyErr_Format( + PyExc_NotImplementedError, + "%s: initialize of key protectors not supported.", + function ); - return( 0 ); + return( -1 ); } -/* Frees a key protectors object +/* Frees a key protectors sequence object */ void pybde_key_protectors_free( - pybde_key_protectors_t *key_protectors_object ) + pybde_key_protectors_t *sequence_object ) { struct _typeobject *ob_type = NULL; static char *function = "pybde_key_protectors_free"; - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object.", + "%s: invalid sequence object.", function ); return; } ob_type = Py_TYPE( - key_protectors_object ); + sequence_object ); if( ob_type == NULL ) { @@ -289,72 +285,72 @@ return; } - if( key_protectors_object->parent_object != NULL ) + if( sequence_object->parent_object != NULL ) { Py_DecRef( - (PyObject *) key_protectors_object->parent_object ); + (PyObject *) sequence_object->parent_object ); } ob_type->tp_free( - (PyObject*) key_protectors_object ); + (PyObject*) sequence_object ); } /* The key protectors len() function */ Py_ssize_t pybde_key_protectors_len( - pybde_key_protectors_t *key_protectors_object ) + pybde_key_protectors_t *sequence_object ) { static char *function = "pybde_key_protectors_len"; - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object.", + "%s: invalid sequence object.", function ); return( -1 ); } - return( (Py_ssize_t) key_protectors_object->number_of_items ); + return( (Py_ssize_t) sequence_object->number_of_items ); } /* The key protectors getitem() function */ PyObject *pybde_key_protectors_getitem( - pybde_key_protectors_t *key_protectors_object, + pybde_key_protectors_t *sequence_object, Py_ssize_t item_index ) { PyObject *key_protector_object = NULL; static char *function = "pybde_key_protectors_getitem"; - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object.", + "%s: invalid sequence object.", function ); return( NULL ); } - if( key_protectors_object->get_item_by_index == NULL ) + if( sequence_object->get_item_by_index == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object - missing get item by index function.", + "%s: invalid sequence object - missing get item by index function.", function ); return( NULL ); } - if( key_protectors_object->number_of_items < 0 ) + if( sequence_object->number_of_items < 0 ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object - invalid number of items.", + "%s: invalid sequence object - invalid number of items.", function ); return( NULL ); } if( ( item_index < 0 ) - || ( item_index >= (Py_ssize_t) key_protectors_object->number_of_items ) ) + || ( item_index >= (Py_ssize_t) sequence_object->number_of_items ) ) { PyErr_Format( PyExc_ValueError, @@ -363,8 +359,8 @@ return( NULL ); } - key_protector_object = key_protectors_object->get_item_by_index( - key_protectors_object->parent_object, + key_protector_object = sequence_object->get_item_by_index( + sequence_object->parent_object, (int) item_index ); return( key_protector_object ); @@ -373,83 +369,83 @@ /* The key protectors iter() function */ PyObject *pybde_key_protectors_iter( - pybde_key_protectors_t *key_protectors_object ) + pybde_key_protectors_t *sequence_object ) { static char *function = "pybde_key_protectors_iter"; - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object.", + "%s: invalid sequence object.", function ); return( NULL ); } Py_IncRef( - (PyObject *) key_protectors_object ); + (PyObject *) sequence_object ); - return( (PyObject *) key_protectors_object ); + return( (PyObject *) sequence_object ); } /* The key protectors iternext() function */ PyObject *pybde_key_protectors_iternext( - pybde_key_protectors_t *key_protectors_object ) + pybde_key_protectors_t *sequence_object ) { PyObject *key_protector_object = NULL; static char *function = "pybde_key_protectors_iternext"; - if( key_protectors_object == NULL ) + if( sequence_object == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object.", + "%s: invalid sequence object.", function ); return( NULL ); } - if( key_protectors_object->get_item_by_index == NULL ) + if( sequence_object->get_item_by_index == NULL ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object - missing get item by index function.", + "%s: invalid sequence object - missing get item by index function.", function ); return( NULL ); } - if( key_protectors_object->current_index < 0 ) + if( sequence_object->current_index < 0 ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object - invalid current index.", + "%s: invalid sequence object - invalid current index.", function ); return( NULL ); } - if( key_protectors_object->number_of_items < 0 ) + if( sequence_object->number_of_items < 0 ) { PyErr_Format( PyExc_ValueError, - "%s: invalid key protectors object - invalid number of items.", + "%s: invalid sequence object - invalid number of items.", function ); return( NULL ); } - if( key_protectors_object->current_index >= key_protectors_object->number_of_items ) + if( sequence_object->current_index >= sequence_object->number_of_items ) { PyErr_SetNone( PyExc_StopIteration ); return( NULL ); } - key_protector_object = key_protectors_object->get_item_by_index( - key_protectors_object->parent_object, - key_protectors_object->current_index ); + key_protector_object = sequence_object->get_item_by_index( + sequence_object->parent_object, + sequence_object->current_index ); if( key_protector_object != NULL ) { - key_protectors_object->current_index++; + sequence_object->current_index++; } return( key_protector_object ); } diff -Nru libbde-20190102/pybde/pybde_key_protectors.h libbde-20240223/pybde/pybde_key_protectors.h --- libbde-20190102/pybde/pybde_key_protectors.h 2019-01-02 14:16:40.000000000 +0000 +++ libbde-20240223/pybde/pybde_key_protectors.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object definition of the sequence and iterator object of key protectors * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_KEY_PROTECTORS_H ) @@ -69,23 +69,23 @@ int number_of_items ); int pybde_key_protectors_init( - pybde_key_protectors_t *key_protectors_object ); + pybde_key_protectors_t *sequence_object ); void pybde_key_protectors_free( - pybde_key_protectors_t *key_protectors_object ); + pybde_key_protectors_t *sequence_object ); Py_ssize_t pybde_key_protectors_len( - pybde_key_protectors_t *key_protectors_object ); + pybde_key_protectors_t *sequence_object ); PyObject *pybde_key_protectors_getitem( - pybde_key_protectors_t *key_protectors_object, + pybde_key_protectors_t *sequence_object, Py_ssize_t item_index ); PyObject *pybde_key_protectors_iter( - pybde_key_protectors_t *key_protectors_object ); + pybde_key_protectors_t *sequence_object ); PyObject *pybde_key_protectors_iternext( - pybde_key_protectors_t *key_protectors_object ); + pybde_key_protectors_t *sequence_object ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/pybde/pybde_libbde.h libbde-20240223/pybde/pybde_libbde.h --- libbde-20190102/pybde/pybde_libbde.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_libbde.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The internal libbde header * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_LIBBDE_H ) diff -Nru libbde-20190102/pybde/pybde_libbfio.h libbde-20240223/pybde/pybde_libbfio.h --- libbde-20190102/pybde/pybde_libbfio.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_libbfio.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_LIBBFIO_H ) diff -Nru libbde-20190102/pybde/pybde_libcerror.h libbde-20240223/pybde/pybde_libcerror.h --- libbde-20190102/pybde/pybde_libcerror.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_libcerror.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_LIBCERROR_H ) diff -Nru libbde-20190102/pybde/pybde_libclocale.h libbde-20240223/pybde/pybde_libclocale.h --- libbde-20190102/pybde/pybde_libclocale.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_libclocale.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libclocale header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_LIBCLOCALE_H ) diff -Nru libbde-20190102/pybde/pybde_libfguid.h libbde-20240223/pybde/pybde_libfguid.h --- libbde-20190102/pybde/pybde_libfguid.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_libfguid.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libfguid header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_LIBFGUID_H ) diff -Nru libbde-20190102/pybde/pybde_python.h libbde-20240223/pybde/pybde_python.h --- libbde-20190102/pybde/pybde_python.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_python.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The python header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_PYTHON_H ) @@ -43,6 +43,13 @@ #endif /* PY_MAJOR_VERSION < 3 */ +/* Define PY_SSIZE_T_CLEAN to silence: + * DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats + * + * PY_SSIZE_T_CLEAN was introduced in Python 2.5 + */ +#define PY_SSIZE_T_CLEAN + #include /* Python compatibility macros diff -Nru libbde-20190102/pybde/pybde_unused.h libbde-20240223/pybde/pybde_unused.h --- libbde-20190102/pybde/pybde_unused.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/pybde/pybde_unused.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_UNUSED_H ) diff -Nru libbde-20190102/pybde/pybde_volume.c libbde-20240223/pybde/pybde_volume.c --- libbde-20190102/pybde/pybde_volume.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/pybde/pybde_volume.c 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object wrapper of libbde_volume_t * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -31,14 +31,13 @@ #include "pybde_datetime.h" #include "pybde_error.h" #include "pybde_file_object_io_handle.h" -#include "pybde_integer.h" #include "pybde_guid.h" +#include "pybde_integer.h" #include "pybde_key_protector.h" #include "pybde_key_protectors.h" +#include "pybde_libbde.h" #include "pybde_libbfio.h" #include "pybde_libcerror.h" -#include "pybde_libclocale.h" -#include "pybde_libbde.h" #include "pybde_python.h" #include "pybde_unused.h" #include "pybde_volume.h" @@ -63,8 +62,6 @@ "\n" "Signals the volume to abort the current activity." }, - /* Functions to access the volume */ - { "open", (PyCFunction) pybde_volume_open, METH_VARARGS | METH_KEYWORDS, @@ -89,69 +86,72 @@ { "is_locked", (PyCFunction) pybde_volume_is_locked, METH_NOARGS, - "is_locked() -> Boolean\n" + "is_locked() -> Boolean or None\n" "\n" - "Indicates if the volume is locked." }, + "Determines if the volume is locked." }, + + { "unlock", + (PyCFunction) pybde_volume_unlock, + METH_NOARGS, + "unlock() -> Boolean\n" + "\n" + "Unlocks the volume." }, { "read_buffer", (PyCFunction) pybde_volume_read_buffer, METH_VARARGS | METH_KEYWORDS, - "read_buffer(size) -> String\n" + "read_buffer(size) -> Binary string\n" "\n" - "Reads a buffer of volume data." }, + "Reads a buffer of unencrypted data." }, { "read_buffer_at_offset", (PyCFunction) pybde_volume_read_buffer_at_offset, METH_VARARGS | METH_KEYWORDS, - "read_buffer_at_offset(size, offset) -> String\n" + "read_buffer_at_offset(size, offset) -> Binary string\n" "\n" - "Reads a buffer of volume data at a specific offset." }, + "Reads a buffer of unencrypted data at a specific offset." }, { "seek_offset", (PyCFunction) pybde_volume_seek_offset, METH_VARARGS | METH_KEYWORDS, "seek_offset(offset, whence) -> None\n" "\n" - "Seeks an offset within the volume data." }, + "Seeks an offset within the unencrypted data." }, { "get_offset", (PyCFunction) pybde_volume_get_offset, METH_NOARGS, "get_offset() -> Integer\n" "\n" - "Retrieved the current offset within the volume data." }, - - /* Some Pythonesque aliases */ + "Retrieves the current offset within the unencrypted data." }, { "read", (PyCFunction) pybde_volume_read_buffer, METH_VARARGS | METH_KEYWORDS, - "read(size) -> String\n" + "read(size) -> Binary string\n" "\n" - "Reads a buffer of volume data." }, + "Reads a buffer of unencrypted data." }, { "seek", (PyCFunction) pybde_volume_seek_offset, METH_VARARGS | METH_KEYWORDS, "seek(offset, whence) -> None\n" "\n" - "Seeks an offset within the volume data." }, + "Seeks an offset within the unencrypted data." }, { "tell", (PyCFunction) pybde_volume_get_offset, METH_NOARGS, "tell() -> Integer\n" "\n" - "Retrieves the current offset within the volume data." }, - - /* Functions to access the volume values */ + "Retrieves the current offset within the unencrypted data." }, { "get_size", (PyCFunction) pybde_volume_get_size, METH_NOARGS, "get_size() -> Integer\n" "\n" - "Retrieves the size of the volume data." }, + "Retrieves the size of the unencrypted data." }, { "get_encryption_method", (PyCFunction) pybde_volume_get_encryption_method, @@ -165,21 +165,21 @@ METH_NOARGS, "get_volume_identifier() -> Unicode string or None\n" "\n" - "Retrieves the volume identifier (GUID)." }, + "Retrieves the volume identifier." }, { "get_creation_time", (PyCFunction) pybde_volume_get_creation_time, METH_NOARGS, "get_creation_time() -> Datetime\n" "\n" - "Returns the creation date and time." }, + "Retrieves the creation date and time." }, { "get_creation_time_as_integer", (PyCFunction) pybde_volume_get_creation_time_as_integer, METH_NOARGS, - "get_creation_time_as_integer() -> Integer\n" + "get_creation_time_as_integer() -> Integer or None\n" "\n" - "Returns the creation date and time as a 64-bit integer containing a FILETIME value." }, + "Retrieves the creation date and time as a 64-bit integer containing a FILETIME value." }, { "get_description", (PyCFunction) pybde_volume_get_description, @@ -188,6 +188,20 @@ "\n" "Retrieves the description." }, + { "get_number_of_key_protectors", + (PyCFunction) pybde_volume_get_number_of_key_protectors, + METH_NOARGS, + "get_number_of_key_protectors() -> Integer\n" + "\n" + "Retrieves the number of volume master key protectors." }, + + { "get_key_protector", + (PyCFunction) pybde_volume_get_key_protector, + METH_VARARGS | METH_KEYWORDS, + "get_key_protector(key_protector_index) -> Object\n" + "\n" + "Retrieves the volume master key protector specified by the index." }, + { "set_keys", (PyCFunction) pybde_volume_set_keys, METH_VARARGS | METH_KEYWORDS, @@ -258,6 +272,18 @@ "The description.", NULL }, + { "number_of_key_protectors", + (getter) pybde_volume_get_number_of_key_protectors, + (setter) 0, + "The number of volume master key protectors.", + NULL }, + + { "key_protectors", + (getter) pybde_volume_get_key_protectors, + (setter) 0, + "The volume master key protectors.", + NULL }, + /* Sentinel */ { NULL, NULL, NULL, NULL, NULL } }; @@ -357,101 +383,14 @@ 0 }; -/* Creates a new volume object - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_new( - void ) -{ - pybde_volume_t *pybde_volume = NULL; - static char *function = "pybde_volume_new"; - - pybde_volume = PyObject_New( - struct pybde_volume, - &pybde_volume_type_object ); - - if( pybde_volume == NULL ) - { - PyErr_Format( - PyExc_MemoryError, - "%s: unable to initialize volume.", - function ); - - goto on_error; - } - if( pybde_volume_init( - pybde_volume ) != 0 ) - { - PyErr_Format( - PyExc_MemoryError, - "%s: unable to initialize volume.", - function ); - - goto on_error; - } - return( (PyObject *) pybde_volume ); - -on_error: - if( pybde_volume != NULL ) - { - Py_DecRef( - (PyObject *) pybde_volume ); - } - return( NULL ); -} - -/* Creates a new volume object and opens it - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_new_open( - PyObject *self PYBDE_ATTRIBUTE_UNUSED, - PyObject *arguments, - PyObject *keywords ) -{ - PyObject *pybde_volume = NULL; - - PYBDE_UNREFERENCED_PARAMETER( self ) - - pybde_volume = pybde_volume_new(); - - pybde_volume_open( - (pybde_volume_t *) pybde_volume, - arguments, - keywords ); - - return( pybde_volume ); -} - -/* Creates a new volume object and opens it - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_new_open_file_object( - PyObject *self PYBDE_ATTRIBUTE_UNUSED, - PyObject *arguments, - PyObject *keywords ) -{ - PyObject *pybde_volume = NULL; - - PYBDE_UNREFERENCED_PARAMETER( self ) - - pybde_volume = pybde_volume_new(); - - pybde_volume_open_file_object( - (pybde_volume_t *) pybde_volume, - arguments, - keywords ); - - return( pybde_volume ); -} - -/* Intializes a volume object +/* Initializes a volume object * Returns 0 if successful or -1 on error */ int pybde_volume_init( pybde_volume_t *pybde_volume ) { - static char *function = "pybde_volume_init"; libcerror_error_t *error = NULL; + static char *function = "pybde_volume_init"; if( pybde_volume == NULL ) { @@ -462,6 +401,8 @@ return( -1 ); } + /* Make sure libbde volume is set to NULL + */ pybde_volume->volume = NULL; pybde_volume->file_io_handle = NULL; @@ -488,8 +429,8 @@ void pybde_volume_free( pybde_volume_t *pybde_volume ) { - libcerror_error_t *error = NULL; struct _typeobject *ob_type = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_volume_free"; int result = 0; @@ -502,15 +443,6 @@ return; } - if( pybde_volume->volume == NULL ) - { - PyErr_Format( - PyExc_ValueError, - "%s: invalid volume - missing libbde volume.", - function ); - - return; - } ob_type = Py_TYPE( pybde_volume ); @@ -532,24 +464,36 @@ return; } - Py_BEGIN_ALLOW_THREADS + if( pybde_volume->file_io_handle != NULL ) + { + if( pybde_volume_close( + pybde_volume, + NULL ) == NULL ) + { + return; + } + } + if( pybde_volume->volume != NULL ) + { + Py_BEGIN_ALLOW_THREADS - result = libbde_volume_free( - &( pybde_volume->volume ), - &error ); + result = libbde_volume_free( + &( pybde_volume->volume ), + &error ); - Py_END_ALLOW_THREADS + Py_END_ALLOW_THREADS - if( result != 1 ) - { - pybde_error_raise( - error, - PyExc_MemoryError, - "%s: unable to free libbde volume.", - function ); + if( result != 1 ) + { + pybde_error_raise( + error, + PyExc_MemoryError, + "%s: unable to free libbde volume.", + function ); - libcerror_error_free( - &error ); + libcerror_error_free( + &error ); + } } ob_type->tp_free( (PyObject*) pybde_volume ); @@ -614,9 +558,9 @@ { PyObject *string_object = NULL; libcerror_error_t *error = NULL; + const char *filename_narrow = NULL; static char *function = "pybde_volume_open"; static char *keyword_list[] = { "filename", "mode", NULL }; - const char *filename_narrow = NULL; char *mode = NULL; int result = 0; @@ -670,8 +614,8 @@ if( result == -1 ) { pybde_error_fetch_and_raise( - PyExc_RuntimeError, - "%s: unable to determine if string object is of type unicode.", + PyExc_RuntimeError, + "%s: unable to determine if string object is of type Unicode.", function ); return( NULL ); @@ -681,17 +625,28 @@ PyErr_Clear(); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + filename_wide = (wchar_t *) PyUnicode_AsWideCharString( + string_object, + NULL ); +#else filename_wide = (wchar_t *) PyUnicode_AsUnicode( string_object ); +#endif Py_BEGIN_ALLOW_THREADS result = libbde_volume_open_wide( pybde_volume->volume, - filename_wide, + filename_wide, LIBBDE_OPEN_READ, &error ); Py_END_ALLOW_THREADS + +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + PyMem_Free( + filename_wide ); +#endif #else utf8_string_object = PyUnicode_AsUTF8String( string_object ); @@ -700,23 +655,23 @@ { pybde_error_fetch_and_raise( PyExc_RuntimeError, - "%s: unable to convert unicode string to UTF-8.", + "%s: unable to convert Unicode string to UTF-8.", function ); return( NULL ); } #if PY_MAJOR_VERSION >= 3 filename_narrow = PyBytes_AsString( - utf8_string_object ); + utf8_string_object ); #else filename_narrow = PyString_AsString( - utf8_string_object ); + utf8_string_object ); #endif Py_BEGIN_ALLOW_THREADS result = libbde_volume_open( pybde_volume->volume, - filename_narrow, + filename_narrow, LIBBDE_OPEN_READ, &error ); @@ -725,7 +680,7 @@ Py_DecRef( utf8_string_object ); #endif - if( result != 1 ) + if( result == -1 ) { pybde_error_raise( error, @@ -747,17 +702,17 @@ #if PY_MAJOR_VERSION >= 3 result = PyObject_IsInstance( - string_object, - (PyObject *) &PyBytes_Type ); + string_object, + (PyObject *) &PyBytes_Type ); #else result = PyObject_IsInstance( - string_object, - (PyObject *) &PyString_Type ); + string_object, + (PyObject *) &PyString_Type ); #endif if( result == -1 ) { pybde_error_fetch_and_raise( - PyExc_RuntimeError, + PyExc_RuntimeError, "%s: unable to determine if string object is of type string.", function ); @@ -769,22 +724,22 @@ #if PY_MAJOR_VERSION >= 3 filename_narrow = PyBytes_AsString( - string_object ); + string_object ); #else filename_narrow = PyString_AsString( - string_object ); + string_object ); #endif Py_BEGIN_ALLOW_THREADS result = libbde_volume_open( pybde_volume->volume, - filename_narrow, + filename_narrow, LIBBDE_OPEN_READ, &error ); Py_END_ALLOW_THREADS - if( result != 1 ) + if( result == -1 ) { pybde_error_raise( error, @@ -820,9 +775,9 @@ { PyObject *file_object = NULL; libcerror_error_t *error = NULL; - char *mode = NULL; - static char *keyword_list[] = { "file_object", "mode", NULL }; static char *function = "pybde_volume_open_file_object"; + static char *keyword_list[] = { "file_object", "mode", NULL }; + char *mode = NULL; int result = 0; if( pybde_volume == NULL ) @@ -855,6 +810,46 @@ return( NULL ); } + PyErr_Clear(); + + result = PyObject_HasAttrString( + file_object, + "read" ); + + if( result != 1 ) + { + PyErr_Format( + PyExc_TypeError, + "%s: unsupported file object - missing read attribute.", + function ); + + return( NULL ); + } + PyErr_Clear(); + + result = PyObject_HasAttrString( + file_object, + "seek" ); + + if( result != 1 ) + { + PyErr_Format( + PyExc_TypeError, + "%s: unsupported file object - missing seek attribute.", + function ); + + return( NULL ); + } + if( pybde_volume->file_io_handle != NULL ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: invalid volume - file IO handle already set.", + function ); + + goto on_error; + } if( pybde_file_object_initialize( &( pybde_volume->file_io_handle ), file_object, @@ -966,7 +961,7 @@ { pybde_error_raise( error, - PyExc_IOError, + PyExc_MemoryError, "%s: unable to free libbfio file IO handle.", function ); @@ -1038,7 +1033,63 @@ return( Py_False ); } -/* Reads (volume) data at the current offset into a buffer +/* Unlocks the volume + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_volume_unlock( + pybde_volume_t *pybde_volume, + PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) +{ + libcerror_error_t *error = NULL; + static char *function = "pybde_volume_unlock"; + int result = 0; + + PYBDE_UNREFERENCED_PARAMETER( arguments ) + + if( pybde_volume == NULL ) + { + PyErr_Format( + PyExc_ValueError, + "%s: invalid volume.", + function ); + + return( NULL ); + } + Py_BEGIN_ALLOW_THREADS + + result = libbde_volume_unlock( + pybde_volume->volume, + &error ); + + Py_END_ALLOW_THREADS + + if( result == -1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to unlock volume.", + function ); + + libcerror_error_free( + &error ); + + return( NULL ); + } + if( result != 0 ) + { + Py_IncRef( + (PyObject *) Py_True ); + + return( Py_True ); + } + Py_IncRef( + (PyObject *) Py_False ); + + return( Py_False ); +} + +/* Reads data at the current offset into a buffer * Returns a Python object if successful or NULL on error */ PyObject *pybde_volume_read_buffer( @@ -1046,19 +1097,21 @@ PyObject *arguments, PyObject *keywords ) { - libcerror_error_t *error = NULL; + PyObject *integer_object = NULL; PyObject *string_object = NULL; + libcerror_error_t *error = NULL; + char *buffer = NULL; static char *function = "pybde_volume_read_buffer"; static char *keyword_list[] = { "size", NULL }; - char *buffer = NULL; ssize_t read_count = 0; - int read_size = -1; + int64_t read_size = 0; + int result = 0; if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, - "%s: invalid pybde volume.", + PyExc_ValueError, + "%s: invalid volume.", function ); return( NULL ); @@ -1066,24 +1119,130 @@ if( PyArg_ParseTupleAndKeywords( arguments, keywords, - "|i", + "|O", keyword_list, - &read_size ) == 0 ) + &integer_object ) == 0 ) + { + return( NULL ); + } + if( integer_object == NULL ) + { + result = 0; + } + else + { + result = PyObject_IsInstance( + integer_object, + (PyObject *) &PyLong_Type ); + + if( result == -1 ) + { + pybde_error_fetch_and_raise( + PyExc_RuntimeError, + "%s: unable to determine if integer object is of type long.", + function ); + + return( NULL ); + } +#if PY_MAJOR_VERSION < 3 + else if( result == 0 ) + { + PyErr_Clear(); + + result = PyObject_IsInstance( + integer_object, + (PyObject *) &PyInt_Type ); + + if( result == -1 ) + { + pybde_error_fetch_and_raise( + PyExc_RuntimeError, + "%s: unable to determine if integer object is of type int.", + function ); + + return( NULL ); + } + } +#endif + } + if( result != 0 ) + { + if( pybde_integer_signed_copy_to_64bit( + integer_object, + &read_size, + &error ) != 1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to convert integer object into read size.", + function ); + + libcerror_error_free( + &error ); + + return( NULL ); + } + } + else if( ( integer_object == NULL ) + || ( integer_object == Py_None ) ) + { + Py_BEGIN_ALLOW_THREADS + + result = libbde_volume_get_size( + pybde_volume->volume, + (size64_t *) &read_size, + &error ); + + Py_END_ALLOW_THREADS + + if( result != 1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to retrieve size.", + function ); + + libcerror_error_free( + &error ); + + return( NULL ); + } + } + else { + PyErr_Format( + PyExc_TypeError, + "%s: unsupported integer object type.", + function ); + return( NULL ); } + if( read_size == 0 ) + { +#if PY_MAJOR_VERSION >= 3 + string_object = PyBytes_FromString( + "" ); +#else + string_object = PyString_FromString( + "" ); +#endif + return( string_object ); + } if( read_size < 0 ) { PyErr_Format( PyExc_ValueError, - "%s: invalid argument read size value less than zero.", + "%s: invalid read size value less than zero.", function ); return( NULL ); } - /* Make sure the data fits into the memory buffer + /* Make sure the data fits into a memory buffer */ - if( read_size > INT_MAX ) + if( ( read_size > (int64_t) INT_MAX ) + || ( read_size > (int64_t) SSIZE_MAX ) ) { PyErr_Format( PyExc_ValueError, @@ -1095,14 +1254,16 @@ #if PY_MAJOR_VERSION >= 3 string_object = PyBytes_FromStringAndSize( NULL, - read_size ); + (Py_ssize_t) read_size ); buffer = PyBytes_AsString( string_object ); #else + /* Note that a size of 0 is not supported + */ string_object = PyString_FromStringAndSize( NULL, - read_size ); + (Py_ssize_t) read_size ); buffer = PyString_AsString( string_object ); @@ -1117,7 +1278,7 @@ Py_END_ALLOW_THREADS - if( read_count <= -1 ) + if( read_count == -1 ) { pybde_error_raise( error, @@ -1153,7 +1314,7 @@ return( string_object ); } -/* Reads (volume) data at a specific offset +/* Reads data at a specific offset into a buffer * Returns a Python object if successful or NULL on error */ PyObject *pybde_volume_read_buffer_at_offset( @@ -1161,20 +1322,22 @@ PyObject *arguments, PyObject *keywords ) { - libcerror_error_t *error = NULL; + PyObject *integer_object = NULL; PyObject *string_object = NULL; + libcerror_error_t *error = NULL; + char *buffer = NULL; static char *function = "pybde_volume_read_buffer_at_offset"; static char *keyword_list[] = { "size", "offset", NULL }; - char *buffer = NULL; - off64_t read_offset = 0; ssize_t read_count = 0; - int read_size = 0; + off64_t read_offset = 0; + int64_t read_size = 0; + int result = 0; if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, - "%s: invalid pybde volume.", + PyExc_ValueError, + "%s: invalid volume.", function ); return( NULL ); @@ -1182,25 +1345,98 @@ if( PyArg_ParseTupleAndKeywords( arguments, keywords, - "i|L", + "OL", keyword_list, - &read_size, + &integer_object, &read_offset ) == 0 ) { return( NULL ); } + result = PyObject_IsInstance( + integer_object, + (PyObject *) &PyLong_Type ); + + if( result == -1 ) + { + pybde_error_fetch_and_raise( + PyExc_RuntimeError, + "%s: unable to determine if integer object is of type long.", + function ); + + return( NULL ); + } +#if PY_MAJOR_VERSION < 3 + else if( result == 0 ) + { + PyErr_Clear(); + + result = PyObject_IsInstance( + integer_object, + (PyObject *) &PyInt_Type ); + + if( result == -1 ) + { + pybde_error_fetch_and_raise( + PyExc_RuntimeError, + "%s: unable to determine if integer object is of type int.", + function ); + + return( NULL ); + } + } +#endif + if( result != 0 ) + { + if( pybde_integer_signed_copy_to_64bit( + integer_object, + &read_size, + &error ) != 1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to convert integer object into read size.", + function ); + + libcerror_error_free( + &error ); + + return( NULL ); + } + } + else + { + PyErr_Format( + PyExc_TypeError, + "%s: unsupported integer object type.", + function ); + + return( NULL ); + } + if( read_size == 0 ) + { +#if PY_MAJOR_VERSION >= 3 + string_object = PyBytes_FromString( + "" ); +#else + string_object = PyString_FromString( + "" ); +#endif + return( string_object ); + } if( read_size < 0 ) { PyErr_Format( PyExc_ValueError, - "%s: invalid argument read size value less than zero.", + "%s: invalid read size value less than zero.", function ); return( NULL ); } - /* Make sure the data fits into the memory buffer + /* Make sure the data fits into a memory buffer */ - if( read_size > INT_MAX ) + if( ( read_size > (int64_t) INT_MAX ) + || ( read_size > (int64_t) SSIZE_MAX ) ) { PyErr_Format( PyExc_ValueError, @@ -1213,24 +1449,24 @@ { PyErr_Format( PyExc_ValueError, - "%s: invalid argument read offset value less than zero.", + "%s: invalid read offset value less than zero.", function ); return( NULL ); } - /* Make sure the data fits into the memory buffer - */ #if PY_MAJOR_VERSION >= 3 string_object = PyBytes_FromStringAndSize( NULL, - read_size ); + (Py_ssize_t) read_size ); buffer = PyBytes_AsString( string_object ); #else + /* Note that a size of 0 is not supported + */ string_object = PyString_FromStringAndSize( NULL, - read_size ); + (Py_ssize_t) read_size ); buffer = PyString_AsString( string_object ); @@ -1246,7 +1482,7 @@ Py_END_ALLOW_THREADS - if( read_count <= -1 ) + if( read_count == -1 ) { pybde_error_raise( error, @@ -1282,7 +1518,7 @@ return( string_object ); } -/* Seeks a certain offset in the (volume) data +/* Seeks a certain offset * Returns a Python object if successful or NULL on error */ PyObject *pybde_volume_seek_offset( @@ -1299,8 +1535,8 @@ if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, - "%s: invalid pybde volume.", + PyExc_ValueError, + "%s: invalid volume.", function ); return( NULL ); @@ -1351,10 +1587,10 @@ pybde_volume_t *pybde_volume, PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) { - libcerror_error_t *error = NULL; PyObject *integer_object = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_volume_get_offset"; - off64_t current_offset = 0; + off64_t offset = 0; int result = 0; PYBDE_UNREFERENCED_PARAMETER( arguments ) @@ -1362,7 +1598,7 @@ if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, + PyExc_ValueError, "%s: invalid volume.", function ); @@ -1372,7 +1608,7 @@ result = libbde_volume_get_offset( pybde_volume->volume, - ¤t_offset, + &offset, &error ); Py_END_ALLOW_THREADS @@ -1391,7 +1627,7 @@ return( NULL ); } integer_object = pybde_integer_signed_new_from_64bit( - (int64_t) current_offset ); + (int64_t) offset ); return( integer_object ); } @@ -1403,8 +1639,8 @@ pybde_volume_t *pybde_volume, PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) { - libcerror_error_t *error = NULL; PyObject *integer_object = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_volume_get_size"; size64_t size = 0; int result = 0; @@ -1414,7 +1650,7 @@ if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, + PyExc_ValueError, "%s: invalid volume.", function ); @@ -1455,8 +1691,8 @@ pybde_volume_t *pybde_volume, PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) { - libcerror_error_t *error = NULL; PyObject *integer_object = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_volume_get_encryption_method"; uint16_t encryption_method = 0; int result = 0; @@ -1466,7 +1702,7 @@ if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, + PyExc_ValueError, "%s: invalid volume.", function ); @@ -1486,7 +1722,7 @@ pybde_error_raise( error, PyExc_IOError, - "%s: failed to retrieve encryption method.", + "%s: unable to retrieve encryption method.", function ); libcerror_error_free( @@ -1494,9 +1730,13 @@ return( NULL ); } - integer_object = pybde_integer_unsigned_new_from_64bit( - (uint64_t) encryption_method ); - +#if PY_MAJOR_VERSION >= 3 + integer_object = PyLong_FromLong( + (long) encryption_method ); +#else + integer_object = PyInt_FromLong( + (long) encryption_method ); +#endif return( integer_object ); } @@ -1509,8 +1749,8 @@ { uint8_t guid_data[ 16 ]; - libcerror_error_t *error = NULL; PyObject *string_object = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_volume_get_volume_identifier"; int result = 0; @@ -1519,7 +1759,7 @@ if( pybde_volume == NULL ) { PyErr_Format( - PyExc_TypeError, + PyExc_ValueError, "%s: invalid volume.", function ); @@ -1556,9 +1796,18 @@ return( Py_None ); } string_object = pybde_string_new_from_guid( - guid_data, - 16 ); + guid_data, + 16 ); + if( string_object == NULL ) + { + PyErr_Format( + PyExc_IOError, + "%s: unable to convert GUID into Unicode object.", + function ); + + return( NULL ); + } return( string_object ); } @@ -1569,11 +1818,11 @@ pybde_volume_t *pybde_volume, PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) { - libcerror_error_t *error = NULL; - PyObject *date_time_object = NULL; - static char *function = "pybde_volume_get_creation_time"; - uint64_t filetime = 0; - int result = 0; + PyObject *datetime_object = NULL; + libcerror_error_t *error = NULL; + static char *function = "pybde_volume_get_creation_time"; + uint64_t filetime = 0; + int result = 0; PYBDE_UNREFERENCED_PARAMETER( arguments ) @@ -1600,7 +1849,7 @@ pybde_error_raise( error, PyExc_IOError, - "%s: unable to retrieve creation time.", + "%s: unable to retrieve creation date and time.", function ); libcerror_error_free( @@ -1615,10 +1864,10 @@ return( Py_None ); } - date_time_object = pybde_datetime_new_from_filetime( - filetime ); + datetime_object = pybde_datetime_new_from_filetime( + filetime ); - return( date_time_object ); + return( datetime_object ); } /* Retrieves the creation date and time as an integer @@ -1628,8 +1877,8 @@ pybde_volume_t *pybde_volume, PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) { - libcerror_error_t *error = NULL; PyObject *integer_object = NULL; + libcerror_error_t *error = NULL; static char *function = "pybde_volume_get_creation_time_as_integer"; uint64_t filetime = 0; int result = 0; @@ -1654,12 +1903,12 @@ Py_END_ALLOW_THREADS - if( result != 1 ) + if( result == -1 ) { pybde_error_raise( error, PyExc_IOError, - "%s: unable to retrieve creation time.", + "%s: unable to retrieve creation date and time.", function ); libcerror_error_free( @@ -1667,8 +1916,15 @@ return( NULL ); } + else if( result == 0 ) + { + Py_IncRef( + Py_None ); + + return( Py_None ); + } integer_object = pybde_integer_unsigned_new_from_64bit( - filetime ); + (uint64_t) filetime ); return( integer_object ); } @@ -1682,7 +1938,6 @@ { libcerror_error_t *error = NULL; PyObject *string_object = NULL; - const char *errors = NULL; uint8_t *description = NULL; static char *function = "pybde_volume_get_description"; size_t description_size = 0; @@ -1735,7 +1990,7 @@ if( description == NULL ) { PyErr_Format( - PyExc_IOError, + PyExc_MemoryError, "%s: unable to create description.", function ); @@ -1771,7 +2026,7 @@ string_object = PyUnicode_DecodeUTF8( (char *) description, (Py_ssize_t) description_size - 1, - errors ); + NULL ); PyMem_Free( description ); @@ -1787,6 +2042,225 @@ return( NULL ); } +/* Retrieves the number of volume master key protectors + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_volume_get_number_of_key_protectors( + pybde_volume_t *pybde_volume, + PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) +{ + PyObject *integer_object = NULL; + libcerror_error_t *error = NULL; + static char *function = "pybde_volume_get_number_of_key_protectors"; + int number_of_key_protectors = 0; + int result = 0; + + PYBDE_UNREFERENCED_PARAMETER( arguments ) + + if( pybde_volume == NULL ) + { + PyErr_Format( + PyExc_ValueError, + "%s: invalid volume.", + function ); + + return( NULL ); + } + Py_BEGIN_ALLOW_THREADS + + result = libbde_volume_get_number_of_key_protectors( + pybde_volume->volume, + &number_of_key_protectors, + &error ); + + Py_END_ALLOW_THREADS + + if( result != 1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to retrieve number of volume master key protectors.", + function ); + + libcerror_error_free( + &error ); + + return( NULL ); + } +#if PY_MAJOR_VERSION >= 3 + integer_object = PyLong_FromLong( + (long) number_of_key_protectors ); +#else + integer_object = PyInt_FromLong( + (long) number_of_key_protectors ); +#endif + return( integer_object ); +} + +/* Retrieves a specific volume master key protector by index + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_volume_get_key_protector_by_index( + PyObject *pybde_volume, + int key_protector_index ) +{ + PyObject *key_protector_object = NULL; + libbde_key_protector_t *key_protector = NULL; + libcerror_error_t *error = NULL; + static char *function = "pybde_volume_get_key_protector_by_index"; + int result = 0; + + if( pybde_volume == NULL ) + { + PyErr_Format( + PyExc_ValueError, + "%s: invalid volume.", + function ); + + return( NULL ); + } + Py_BEGIN_ALLOW_THREADS + + result = libbde_volume_get_key_protector_by_index( + ( (pybde_volume_t *) pybde_volume )->volume, + key_protector_index, + &key_protector, + &error ); + + Py_END_ALLOW_THREADS + + if( result != 1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to retrieve volume master key protector: %d.", + function, + key_protector_index ); + + libcerror_error_free( + &error ); + + goto on_error; + } + key_protector_object = pybde_key_protector_new( + key_protector, + pybde_volume ); + + if( key_protector_object == NULL ) + { + PyErr_Format( + PyExc_MemoryError, + "%s: unable to create key protector object.", + function ); + + goto on_error; + } + return( key_protector_object ); + +on_error: + if( key_protector != NULL ) + { + libbde_key_protector_free( + &key_protector, + NULL ); + } + return( NULL ); +} + +/* Retrieves a specific volume master key protector + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_volume_get_key_protector( + pybde_volume_t *pybde_volume, + PyObject *arguments, + PyObject *keywords ) +{ + PyObject *key_protector_object = NULL; + static char *keyword_list[] = { "key_protector_index", NULL }; + int key_protector_index = 0; + + if( PyArg_ParseTupleAndKeywords( + arguments, + keywords, + "i", + keyword_list, + &key_protector_index ) == 0 ) + { + return( NULL ); + } + key_protector_object = pybde_volume_get_key_protector_by_index( + (PyObject *) pybde_volume, + key_protector_index ); + + return( key_protector_object ); +} + +/* Retrieves a sequence and iterator object for the key protectors + * Returns a Python object if successful or NULL on error + */ +PyObject *pybde_volume_get_key_protectors( + pybde_volume_t *pybde_volume, + PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) +{ + PyObject *sequence_object = NULL; + libcerror_error_t *error = NULL; + static char *function = "pybde_volume_get_key_protectors"; + int number_of_key_protectors = 0; + int result = 0; + + PYBDE_UNREFERENCED_PARAMETER( arguments ) + + if( pybde_volume == NULL ) + { + PyErr_Format( + PyExc_ValueError, + "%s: invalid volume.", + function ); + + return( NULL ); + } + Py_BEGIN_ALLOW_THREADS + + result = libbde_volume_get_number_of_key_protectors( + pybde_volume->volume, + &number_of_key_protectors, + &error ); + + Py_END_ALLOW_THREADS + + if( result != 1 ) + { + pybde_error_raise( + error, + PyExc_IOError, + "%s: unable to retrieve number of key protectors.", + function ); + + libcerror_error_free( + &error ); + + return( NULL ); + } + sequence_object = pybde_key_protectors_new( + (PyObject *) pybde_volume, + &pybde_volume_get_key_protector_by_index, + number_of_key_protectors ); + + if( sequence_object == NULL ) + { + pybde_error_raise( + error, + PyExc_MemoryError, + "%s: unable to create sequence object.", + function ); + + return( NULL ); + } + return( sequence_object ); +} + /* Sets the keys * Returns a Python object if successful or NULL on error */ @@ -1932,12 +2406,17 @@ { PyErr_Clear(); +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + password_string_wide = (wchar_t *) PyUnicode_AsWideCharString( + string_object, + &password_string_length ); +#else password_string_wide = (wchar_t *) PyUnicode_AsUnicode( string_object ); password_string_length = wide_string_length( password_string_wide ); - +#endif Py_BEGIN_ALLOW_THREADS result = libbde_volume_set_utf16_password( @@ -1948,6 +2427,10 @@ Py_END_ALLOW_THREADS +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + PyMem_Free( + password_string_wide ); +#endif if( result == -1 ) { pybde_error_raise( @@ -2178,12 +2661,17 @@ { PyErr_Clear(); +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + recovery_password_string_wide = (wchar_t *) PyUnicode_AsWideCharString( + string_object, + &recovery_password_string_length ); +#else recovery_password_string_wide = (wchar_t *) PyUnicode_AsUnicode( string_object ); recovery_password_string_length = wide_string_length( recovery_password_string_wide ); - +#endif Py_BEGIN_ALLOW_THREADS result = libbde_volume_set_utf16_recovery_password( @@ -2194,6 +2682,10 @@ Py_END_ALLOW_THREADS +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + PyMem_Free( + recovery_password_string_wide ); +#endif if( result == -1 ) { pybde_error_raise( @@ -2423,8 +2915,14 @@ { PyErr_Clear(); +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + filename_wide = (wchar_t *) PyUnicode_AsWideCharString( + string_object, + NULL ); +#else filename_wide = (wchar_t *) PyUnicode_AsUnicode( string_object ); +#endif Py_BEGIN_ALLOW_THREADS result = libbde_volume_read_startup_key_wide( @@ -2434,6 +2932,10 @@ Py_END_ALLOW_THREADS +#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 3 + PyMem_Free( + filename_wide ); +#endif if( result == -1 ) { pybde_error_raise( @@ -2593,223 +3095,3 @@ } #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - -/* Retrieves the number of key protectors - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_get_number_of_key_protectors( - pybde_volume_t *pybde_volume, - PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) -{ - libcerror_error_t *error = NULL; - PyObject *integer_object = NULL; - static char *function = "pybde_volume_get_number_of_key_protectors"; - int number_of_key_protectors = 0; - int result = 0; - - PYBDE_UNREFERENCED_PARAMETER( arguments ) - - if( pybde_volume == NULL ) - { - PyErr_Format( - PyExc_TypeError, - "%s: invalid volume.", - function ); - - return( NULL ); - } - Py_BEGIN_ALLOW_THREADS - - result = libbde_volume_get_number_of_key_protectors( - pybde_volume->volume, - &number_of_key_protectors, - &error ); - - Py_END_ALLOW_THREADS - - if( result != 1 ) - { - pybde_error_raise( - error, - PyExc_IOError, - "%s: unable to retrieve number of key protectors.", - function ); - - libcerror_error_free( - &error ); - - return( NULL ); - } -#if PY_MAJOR_VERSION >= 3 - integer_object = PyLong_FromLong( - (long) number_of_key_protectors ); -#else - integer_object = PyInt_FromLong( - (long) number_of_key_protectors ); -#endif - return( integer_object ); -} - -/* Retrieves a specific key protector by index - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_get_key_protector_by_index( - PyObject *pybde_volume, - int key_protector_index ) -{ - libcerror_error_t *error = NULL; - libbde_key_protector_t *key_protector = NULL; - PyObject *key_protector_object = NULL; - static char *function = "pybde_volume_get_key_protector_by_index"; - int result = 0; - - if( pybde_volume == NULL ) - { - PyErr_Format( - PyExc_TypeError, - "%s: invalid volume.", - function ); - - return( NULL ); - } - Py_BEGIN_ALLOW_THREADS - - result = libbde_volume_get_key_protector( - ( (pybde_volume_t *) pybde_volume )->volume, - key_protector_index, - &key_protector, - &error ); - - Py_END_ALLOW_THREADS - - if( result != 1 ) - { - pybde_error_raise( - error, - PyExc_IOError, - "%s: unable to retrieve key protector: %d.", - function, - key_protector_index ); - - libcerror_error_free( - &error ); - - goto on_error; - } - key_protector_object = pybde_key_protector_new( - &pybde_key_protector_type_object, - key_protector, - pybde_volume ); - - if( key_protector_object == NULL ) - { - PyErr_Format( - PyExc_MemoryError, - "%s: unable to create key protector object.", - function ); - - goto on_error; - } - return( key_protector_object ); - -on_error: - if( key_protector != NULL ) - { - libbde_key_protector_free( - &key_protector, - NULL ); - } - return( NULL ); -} - -/* Retrieves a specific key protector - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_get_key_protector( - pybde_volume_t *pybde_volume, - PyObject *arguments, - PyObject *keywords ) -{ - PyObject *key_protector_object = NULL; - static char *keyword_list[] = { "key_protector_index", NULL }; - int key_protector_index = 0; - - if( PyArg_ParseTupleAndKeywords( - arguments, - keywords, - "i", - keyword_list, - &key_protector_index ) == 0 ) - { - return( NULL ); - } - key_protector_object = pybde_volume_get_key_protector_by_index( - (PyObject *) pybde_volume, - key_protector_index ); - - return( key_protector_object ); -} - -/* Retrieves a key protectors sequence and iterator object for the key protectors - * Returns a Python object if successful or NULL on error - */ -PyObject *pybde_volume_get_key_protectors( - pybde_volume_t *pybde_volume, - PyObject *arguments PYBDE_ATTRIBUTE_UNUSED ) -{ - libcerror_error_t *error = NULL; - PyObject *key_protectors_object = NULL; - static char *function = "pybde_volume_get_key_protectors"; - int number_of_key_protectors = 0; - int result = 0; - - PYBDE_UNREFERENCED_PARAMETER( arguments ) - - if( pybde_volume == NULL ) - { - PyErr_Format( - PyExc_TypeError, - "%s: invalid volume.", - function ); - - return( NULL ); - } - Py_BEGIN_ALLOW_THREADS - - result = libbde_volume_get_number_of_key_protectors( - pybde_volume->volume, - &number_of_key_protectors, - &error ); - - Py_END_ALLOW_THREADS - - if( result != 1 ) - { - pybde_error_raise( - error, - PyExc_IOError, - "%s: unable to retrieve number of key protectors.", - function ); - - libcerror_error_free( - &error ); - - return( NULL ); - } - key_protectors_object = pybde_key_protectors_new( - (PyObject *) pybde_volume, - &pybde_volume_get_key_protector_by_index, - number_of_key_protectors ); - - if( key_protectors_object == NULL ) - { - PyErr_Format( - PyExc_MemoryError, - "%s: unable to create key protectors object.", - function ); - - return( NULL ); - } - return( key_protectors_object ); -} - diff -Nru libbde-20190102/pybde/pybde_volume.h libbde-20240223/pybde/pybde_volume.h --- libbde-20190102/pybde/pybde_volume.h 2019-01-02 14:16:40.000000000 +0000 +++ libbde-20240223/pybde/pybde_volume.h 2024-02-23 02:48:27.000000000 +0000 @@ -1,22 +1,22 @@ /* * Python object wrapper of libbde_volume_t * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _PYBDE_VOLUME_H ) @@ -53,19 +53,6 @@ extern PyMethodDef pybde_volume_object_methods[]; extern PyTypeObject pybde_volume_type_object; -PyObject *pybde_volume_new( - void ); - -PyObject *pybde_volume_new_open( - PyObject *self, - PyObject *arguments, - PyObject *keywords ); - -PyObject *pybde_volume_new_open_file_object( - PyObject *self, - PyObject *arguments, - PyObject *keywords ); - int pybde_volume_init( pybde_volume_t *pybde_volume ); @@ -94,6 +81,10 @@ pybde_volume_t *pybde_volume, PyObject *arguments ); +PyObject *pybde_volume_unlock( + pybde_volume_t *pybde_volume, + PyObject *arguments ); + PyObject *pybde_volume_read_buffer( pybde_volume_t *pybde_volume, PyObject *arguments, @@ -137,42 +128,42 @@ pybde_volume_t *pybde_volume, PyObject *arguments ); -PyObject *pybde_volume_set_keys( +PyObject *pybde_volume_get_number_of_key_protectors( pybde_volume_t *pybde_volume, - PyObject *arguments, - PyObject *keywords ); + PyObject *arguments ); -PyObject *pybde_volume_set_password( +PyObject *pybde_volume_get_key_protector_by_index( + PyObject *pybde_volume, + int key_protector_index ); + +PyObject *pybde_volume_get_key_protector( pybde_volume_t *pybde_volume, PyObject *arguments, PyObject *keywords ); -PyObject *pybde_volume_set_recovery_password( +PyObject *pybde_volume_get_key_protectors( pybde_volume_t *pybde_volume, - PyObject *arguments, - PyObject *keywords ); + PyObject *arguments ); -PyObject *pybde_volume_read_startup_key( +PyObject *pybde_volume_set_keys( pybde_volume_t *pybde_volume, PyObject *arguments, PyObject *keywords ); -PyObject *pybde_volume_get_number_of_key_protectors( +PyObject *pybde_volume_set_password( pybde_volume_t *pybde_volume, - PyObject *arguments ); - -PyObject *pybde_volume_get_key_protector_by_index( - PyObject *pybde_volume, - int key_protector_index ); + PyObject *arguments, + PyObject *keywords ); -PyObject *pybde_volume_get_key_protector( +PyObject *pybde_volume_set_recovery_password( pybde_volume_t *pybde_volume, PyObject *arguments, PyObject *keywords ); -PyObject *pybde_volume_get_key_protectors( +PyObject *pybde_volume_read_startup_key( pybde_volume_t *pybde_volume, - PyObject *arguments ); + PyObject *arguments, + PyObject *keywords ); #if defined( __cplusplus ) } diff -Nru libbde-20190102/pybde-python2/Makefile.am libbde-20240223/pybde-python2/Makefile.am --- libbde-20190102/pybde-python2/Makefile.am 2019-01-02 14:14:09.000000000 +0000 +++ libbde-20240223/pybde-python2/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -# Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects -# subdir-objects will compile the source files to a single version of Python. -# Since subdir-objects is being deprecated we copy the source files instead. -am__installdirs = "$(DESTDIR)$(pyexecdir2)" -pyexecdir = $(pyexecdir2) - -if HAVE_PYTHON2 -AM_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ \ - @LIBCDATA_CPPFLAGS@ \ - @LIBCLOCALE_CPPFLAGS@ \ - @LIBCSPLIT_CPPFLAGS@ \ - @LIBUNA_CPPFLAGS@ \ - @LIBCFILE_CPPFLAGS@ \ - @LIBCPATH_CPPFLAGS@ \ - @LIBBFIO_CPPFLAGS@ \ - @LIBFGUID_CPPFLAGS@ \ - @LIBBDE_DLL_IMPORT@ - -am_pybde_la_rpath = -rpath $(pyexecdir2) - -BUILT_SOURCES = \ - pybde.c pybde.h \ - pybde_datetime.c pybde_datetime.h \ - pybde_encryption_methods.c pybde_encryption_methods.h \ - pybde_error.c pybde_error.h \ - pybde_file_object_io_handle.c pybde_file_object_io_handle.h \ - pybde_guid.c pybde_guid.h \ - pybde_integer.c pybde_integer.h \ - pybde_key_protection_types.c pybde_key_protection_types.h \ - pybde_key_protector.c pybde_key_protector.h \ - pybde_key_protectors.c pybde_key_protectors.h \ - pybde_libbde.h \ - pybde_libbfio.h \ - pybde_libcerror.h \ - pybde_libclocale.h \ - pybde_libfguid.h \ - pybde_python.h \ - pybde_unused.h \ - pybde_volume.c pybde_volume.h - -pyexec_LTLIBRARIES = pybde.la - -nodist_pybde_la_SOURCES = $(BUILT_SOURCES) - -pybde_la_LIBADD = \ - @LIBCERROR_LIBADD@ \ - ../libbde/libbde.la \ - @LIBCDATA_LIBADD@ \ - @LIBCLOCALE_LIBADD@ \ - @LIBCSPLIT_LIBADD@ \ - @LIBUNA_LIBADD@ \ - @LIBCFILE_LIBADD@ \ - @LIBCPATH_LIBADD@ \ - @LIBBFIO_LIBADD@ \ - @LIBFGUID_LIBADD@ - -pybde_la_CPPFLAGS = $(PYTHON2_CPPFLAGS) -pybde_la_LDFLAGS = -module -avoid-version $(PYTHON2_LDFLAGS) - -$(BUILT_SOURCES): - /bin/cp -f $(top_srcdir)/pybde/$@ $@ - -endif - -MAINTAINERCLEANFILES = \ - Makefile.in - -clean-local: - /bin/rm -f pybde*.[ch] - -distclean: clean - /bin/rm -f Makefile - diff -Nru libbde-20190102/pybde-python2/Makefile.in libbde-20240223/pybde-python2/Makefile.in --- libbde-20190102/pybde-python2/Makefile.in 2019-01-02 15:57:51.000000000 +0000 +++ libbde-20240223/pybde-python2/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,1106 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = pybde-python2 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ - $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ - $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/pthread.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/tests.m4 \ - $(top_srcdir)/m4/types.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/common/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -LTLIBRARIES = $(pyexec_LTLIBRARIES) -@HAVE_PYTHON2_TRUE@pybde_la_DEPENDENCIES = ../libbde/libbde.la -@HAVE_PYTHON2_TRUE@am__objects_1 = pybde_la-pybde.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_datetime.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_encryption_methods.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_error.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_file_object_io_handle.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_guid.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_integer.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_key_protection_types.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_key_protector.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_key_protectors.lo \ -@HAVE_PYTHON2_TRUE@ pybde_la-pybde_volume.lo -@HAVE_PYTHON2_TRUE@nodist_pybde_la_OBJECTS = $(am__objects_1) -pybde_la_OBJECTS = $(nodist_pybde_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -pybde_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(pybde_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/pybde_la-pybde.Plo \ - ./$(DEPDIR)/pybde_la-pybde_datetime.Plo \ - ./$(DEPDIR)/pybde_la-pybde_encryption_methods.Plo \ - ./$(DEPDIR)/pybde_la-pybde_error.Plo \ - ./$(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo \ - ./$(DEPDIR)/pybde_la-pybde_guid.Plo \ - ./$(DEPDIR)/pybde_la-pybde_integer.Plo \ - ./$(DEPDIR)/pybde_la-pybde_key_protection_types.Plo \ - ./$(DEPDIR)/pybde_la-pybde_key_protector.Plo \ - ./$(DEPDIR)/pybde_la-pybde_key_protectors.Plo \ - ./$(DEPDIR)/pybde_la-pybde_volume.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(nodist_pybde_la_SOURCES) -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DPKG_DATE = @DPKG_DATE@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GREP = @GREP@ -HAVE_DLLMAIN = @HAVE_DLLMAIN@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_LIBBFIO = @HAVE_LIBBFIO@ -HAVE_LIBCAES = @HAVE_LIBCAES@ -HAVE_LIBCDATA = @HAVE_LIBCDATA@ -HAVE_LIBCERROR = @HAVE_LIBCERROR@ -HAVE_LIBCFILE = @HAVE_LIBCFILE@ -HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ -HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ -HAVE_LIBCPATH = @HAVE_LIBCPATH@ -HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ -HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ -HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ -HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ -HAVE_LIBFGUID = @HAVE_LIBFGUID@ -HAVE_LIBFUSE = @HAVE_LIBFUSE@ -HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ -HAVE_LIBHMAC = @HAVE_LIBHMAC@ -HAVE_LIBUNA = @HAVE_LIBUNA@ -HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ -HAVE_LOCAL_LIBCAES = @HAVE_LOCAL_LIBCAES@ -HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ -HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ -HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ -HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ -HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ -HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ -HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ -HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ -HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ -HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ -HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ -HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ -HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ -HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ -HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ -HAVE_OFF64_T = @HAVE_OFF64_T@ -HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ -HAVE_PTHREAD = @HAVE_PTHREAD@ -HAVE_SIZE32_T = @HAVE_SIZE32_T@ -HAVE_SIZE64_T = @HAVE_SIZE64_T@ -HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ -HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBBDE_DLL_EXPORT = @LIBBDE_DLL_EXPORT@ -LIBBDE_DLL_IMPORT = @LIBBDE_DLL_IMPORT@ -LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ -LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ -LIBCAES_CPPFLAGS = @LIBCAES_CPPFLAGS@ -LIBCAES_LIBADD = @LIBCAES_LIBADD@ -LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ -LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ -LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ -LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ -LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ -LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ -LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ -LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ -LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ -LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ -LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ -LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ -LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ -LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ -LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ -LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ -LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ -LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ -LIBDL_LIBADD = @LIBDL_LIBADD@ -LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ -LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ -LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ -LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ -LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ -LIBFGUID_LIBADD = @LIBFGUID_LIBADD@ -LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ -LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ -LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ -LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ -LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ -LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ -LIBUNA_LIBADD = @LIBUNA_LIBADD@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGCONFIG = @PKGCONFIG@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -POSUB = @POSUB@ -PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ -PTHREAD_LIBADD = @PTHREAD_LIBADD@ -PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ -PYTHON_CONFIG = @PYTHON_CONFIG@ -PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ -PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ -PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SPEC_DATE = @SPEC_DATE@ -STATIC_LDFLAGS = @STATIC_LDFLAGS@ -STRIP = @STRIP@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ -ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ -ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ -ax_libcaes_pc_libs_private = @ax_libcaes_pc_libs_private@ -ax_libcaes_spec_build_requires = @ax_libcaes_spec_build_requires@ -ax_libcaes_spec_requires = @ax_libcaes_spec_requires@ -ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ -ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ -ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ -ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ -ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ -ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ -ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ -ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ -ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ -ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ -ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ -ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ -ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ -ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ -ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ -ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ -ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ -ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ -ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ -ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ -ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ -ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ -ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ -ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ -ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ -ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ -ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ -ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ -ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ -ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ -ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ -ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ -ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ -ax_libfguid_pc_libs_private = @ax_libfguid_pc_libs_private@ -ax_libfguid_spec_build_requires = @ax_libfguid_spec_build_requires@ -ax_libfguid_spec_requires = @ax_libfguid_spec_requires@ -ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ -ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ -ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ -ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ -ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ -ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ -ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ -ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ -ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ -ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ -ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ -ax_libuna_spec_requires = @ax_libuna_spec_requires@ -ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -fuse_CFLAGS = @fuse_CFLAGS@ -fuse_LIBS = @fuse_LIBS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libbde_spec_requires = @libbde_spec_requires@ -libbde_spec_tools_build_requires = @libbde_spec_tools_build_requires@ -libbfio_CFLAGS = @libbfio_CFLAGS@ -libbfio_LIBS = @libbfio_LIBS@ -libcaes_CFLAGS = @libcaes_CFLAGS@ -libcaes_LIBS = @libcaes_LIBS@ -libcdata_CFLAGS = @libcdata_CFLAGS@ -libcdata_LIBS = @libcdata_LIBS@ -libcerror_CFLAGS = @libcerror_CFLAGS@ -libcerror_LIBS = @libcerror_LIBS@ -libcfile_CFLAGS = @libcfile_CFLAGS@ -libcfile_LIBS = @libcfile_LIBS@ -libclocale_CFLAGS = @libclocale_CFLAGS@ -libclocale_LIBS = @libclocale_LIBS@ -libcnotify_CFLAGS = @libcnotify_CFLAGS@ -libcnotify_LIBS = @libcnotify_LIBS@ -libcpath_CFLAGS = @libcpath_CFLAGS@ -libcpath_LIBS = @libcpath_LIBS@ -libcsplit_CFLAGS = @libcsplit_CFLAGS@ -libcsplit_LIBS = @libcsplit_LIBS@ -libcthreads_CFLAGS = @libcthreads_CFLAGS@ -libcthreads_LIBS = @libcthreads_LIBS@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libfcache_CFLAGS = @libfcache_CFLAGS@ -libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ -libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ -libfdatetime_LIBS = @libfdatetime_LIBS@ -libfguid_CFLAGS = @libfguid_CFLAGS@ -libfguid_LIBS = @libfguid_LIBS@ -libfvalue_CFLAGS = @libfvalue_CFLAGS@ -libfvalue_LIBS = @libfvalue_LIBS@ -libhmac_CFLAGS = @libhmac_CFLAGS@ -libhmac_LIBS = @libhmac_LIBS@ -libuna_CFLAGS = @libuna_CFLAGS@ -libuna_LIBS = @libuna_LIBS@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -openssl_CFLAGS = @openssl_CFLAGS@ -openssl_LIBS = @openssl_LIBS@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = $(pyexecdir2) -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ -pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects -# subdir-objects will compile the source files to a single version of Python. -# Since subdir-objects is being deprecated we copy the source files instead. -am__installdirs = "$(DESTDIR)$(pyexecdir2)" -@HAVE_PYTHON2_TRUE@AM_CFLAGS = \ -@HAVE_PYTHON2_TRUE@ -I$(top_srcdir)/include \ -@HAVE_PYTHON2_TRUE@ -I$(top_srcdir)/common \ -@HAVE_PYTHON2_TRUE@ @LIBCERROR_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBCDATA_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBUNA_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBCFILE_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBCPATH_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBBFIO_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBFGUID_CPPFLAGS@ \ -@HAVE_PYTHON2_TRUE@ @LIBBDE_DLL_IMPORT@ - -@HAVE_PYTHON2_TRUE@am_pybde_la_rpath = -rpath $(pyexecdir2) -@HAVE_PYTHON2_TRUE@BUILT_SOURCES = \ -@HAVE_PYTHON2_TRUE@ pybde.c pybde.h \ -@HAVE_PYTHON2_TRUE@ pybde_datetime.c pybde_datetime.h \ -@HAVE_PYTHON2_TRUE@ pybde_encryption_methods.c pybde_encryption_methods.h \ -@HAVE_PYTHON2_TRUE@ pybde_error.c pybde_error.h \ -@HAVE_PYTHON2_TRUE@ pybde_file_object_io_handle.c pybde_file_object_io_handle.h \ -@HAVE_PYTHON2_TRUE@ pybde_guid.c pybde_guid.h \ -@HAVE_PYTHON2_TRUE@ pybde_integer.c pybde_integer.h \ -@HAVE_PYTHON2_TRUE@ pybde_key_protection_types.c pybde_key_protection_types.h \ -@HAVE_PYTHON2_TRUE@ pybde_key_protector.c pybde_key_protector.h \ -@HAVE_PYTHON2_TRUE@ pybde_key_protectors.c pybde_key_protectors.h \ -@HAVE_PYTHON2_TRUE@ pybde_libbde.h \ -@HAVE_PYTHON2_TRUE@ pybde_libbfio.h \ -@HAVE_PYTHON2_TRUE@ pybde_libcerror.h \ -@HAVE_PYTHON2_TRUE@ pybde_libclocale.h \ -@HAVE_PYTHON2_TRUE@ pybde_libfguid.h \ -@HAVE_PYTHON2_TRUE@ pybde_python.h \ -@HAVE_PYTHON2_TRUE@ pybde_unused.h \ -@HAVE_PYTHON2_TRUE@ pybde_volume.c pybde_volume.h - -@HAVE_PYTHON2_TRUE@pyexec_LTLIBRARIES = pybde.la -@HAVE_PYTHON2_TRUE@nodist_pybde_la_SOURCES = $(BUILT_SOURCES) -@HAVE_PYTHON2_TRUE@pybde_la_LIBADD = \ -@HAVE_PYTHON2_TRUE@ @LIBCERROR_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ ../libbde/libbde.la \ -@HAVE_PYTHON2_TRUE@ @LIBCDATA_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBCLOCALE_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBCSPLIT_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBUNA_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBCFILE_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBCPATH_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBBFIO_LIBADD@ \ -@HAVE_PYTHON2_TRUE@ @LIBFGUID_LIBADD@ - -@HAVE_PYTHON2_TRUE@pybde_la_CPPFLAGS = $(PYTHON2_CPPFLAGS) -@HAVE_PYTHON2_TRUE@pybde_la_LDFLAGS = -module -avoid-version $(PYTHON2_LDFLAGS) -MAINTAINERCLEANFILES = \ - Makefile.in - -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pybde-python2/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu pybde-python2/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ - } - -uninstall-pyexecLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ - done - -clean-pyexecLTLIBRARIES: - -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) - @list='$(pyexec_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -pybde.la: $(pybde_la_OBJECTS) $(pybde_la_DEPENDENCIES) $(EXTRA_pybde_la_DEPENDENCIES) - $(AM_V_CCLD)$(pybde_la_LINK) $(am_pybde_la_rpath) $(pybde_la_OBJECTS) $(pybde_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_datetime.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_encryption_methods.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_error.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_guid.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_integer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_key_protection_types.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_key_protector.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_key_protectors.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_volume.Plo@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -pybde_la-pybde.lo: pybde.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde.Tpo -c -o pybde_la-pybde.lo `test -f 'pybde.c' || echo '$(srcdir)/'`pybde.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde.Tpo $(DEPDIR)/pybde_la-pybde.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde.c' object='pybde_la-pybde.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde.lo `test -f 'pybde.c' || echo '$(srcdir)/'`pybde.c - -pybde_la-pybde_datetime.lo: pybde_datetime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_datetime.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_datetime.Tpo -c -o pybde_la-pybde_datetime.lo `test -f 'pybde_datetime.c' || echo '$(srcdir)/'`pybde_datetime.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_datetime.Tpo $(DEPDIR)/pybde_la-pybde_datetime.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_datetime.c' object='pybde_la-pybde_datetime.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_datetime.lo `test -f 'pybde_datetime.c' || echo '$(srcdir)/'`pybde_datetime.c - -pybde_la-pybde_encryption_methods.lo: pybde_encryption_methods.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_encryption_methods.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_encryption_methods.Tpo -c -o pybde_la-pybde_encryption_methods.lo `test -f 'pybde_encryption_methods.c' || echo '$(srcdir)/'`pybde_encryption_methods.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_encryption_methods.Tpo $(DEPDIR)/pybde_la-pybde_encryption_methods.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_encryption_methods.c' object='pybde_la-pybde_encryption_methods.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_encryption_methods.lo `test -f 'pybde_encryption_methods.c' || echo '$(srcdir)/'`pybde_encryption_methods.c - -pybde_la-pybde_error.lo: pybde_error.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_error.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_error.Tpo -c -o pybde_la-pybde_error.lo `test -f 'pybde_error.c' || echo '$(srcdir)/'`pybde_error.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_error.Tpo $(DEPDIR)/pybde_la-pybde_error.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_error.c' object='pybde_la-pybde_error.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_error.lo `test -f 'pybde_error.c' || echo '$(srcdir)/'`pybde_error.c - -pybde_la-pybde_file_object_io_handle.lo: pybde_file_object_io_handle.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_file_object_io_handle.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_file_object_io_handle.Tpo -c -o pybde_la-pybde_file_object_io_handle.lo `test -f 'pybde_file_object_io_handle.c' || echo '$(srcdir)/'`pybde_file_object_io_handle.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_file_object_io_handle.Tpo $(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_file_object_io_handle.c' object='pybde_la-pybde_file_object_io_handle.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_file_object_io_handle.lo `test -f 'pybde_file_object_io_handle.c' || echo '$(srcdir)/'`pybde_file_object_io_handle.c - -pybde_la-pybde_guid.lo: pybde_guid.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_guid.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_guid.Tpo -c -o pybde_la-pybde_guid.lo `test -f 'pybde_guid.c' || echo '$(srcdir)/'`pybde_guid.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_guid.Tpo $(DEPDIR)/pybde_la-pybde_guid.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_guid.c' object='pybde_la-pybde_guid.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_guid.lo `test -f 'pybde_guid.c' || echo '$(srcdir)/'`pybde_guid.c - -pybde_la-pybde_integer.lo: pybde_integer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_integer.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_integer.Tpo -c -o pybde_la-pybde_integer.lo `test -f 'pybde_integer.c' || echo '$(srcdir)/'`pybde_integer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_integer.Tpo $(DEPDIR)/pybde_la-pybde_integer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_integer.c' object='pybde_la-pybde_integer.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_integer.lo `test -f 'pybde_integer.c' || echo '$(srcdir)/'`pybde_integer.c - -pybde_la-pybde_key_protection_types.lo: pybde_key_protection_types.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_key_protection_types.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_key_protection_types.Tpo -c -o pybde_la-pybde_key_protection_types.lo `test -f 'pybde_key_protection_types.c' || echo '$(srcdir)/'`pybde_key_protection_types.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_key_protection_types.Tpo $(DEPDIR)/pybde_la-pybde_key_protection_types.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_key_protection_types.c' object='pybde_la-pybde_key_protection_types.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_key_protection_types.lo `test -f 'pybde_key_protection_types.c' || echo '$(srcdir)/'`pybde_key_protection_types.c - -pybde_la-pybde_key_protector.lo: pybde_key_protector.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_key_protector.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_key_protector.Tpo -c -o pybde_la-pybde_key_protector.lo `test -f 'pybde_key_protector.c' || echo '$(srcdir)/'`pybde_key_protector.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_key_protector.Tpo $(DEPDIR)/pybde_la-pybde_key_protector.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_key_protector.c' object='pybde_la-pybde_key_protector.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_key_protector.lo `test -f 'pybde_key_protector.c' || echo '$(srcdir)/'`pybde_key_protector.c - -pybde_la-pybde_key_protectors.lo: pybde_key_protectors.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_key_protectors.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_key_protectors.Tpo -c -o pybde_la-pybde_key_protectors.lo `test -f 'pybde_key_protectors.c' || echo '$(srcdir)/'`pybde_key_protectors.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_key_protectors.Tpo $(DEPDIR)/pybde_la-pybde_key_protectors.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_key_protectors.c' object='pybde_la-pybde_key_protectors.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_key_protectors.lo `test -f 'pybde_key_protectors.c' || echo '$(srcdir)/'`pybde_key_protectors.c - -pybde_la-pybde_volume.lo: pybde_volume.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_volume.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_volume.Tpo -c -o pybde_la-pybde_volume.lo `test -f 'pybde_volume.c' || echo '$(srcdir)/'`pybde_volume.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_volume.Tpo $(DEPDIR)/pybde_la-pybde_volume.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_volume.c' object='pybde_la-pybde_volume.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_volume.lo `test -f 'pybde_volume.c' || echo '$(srcdir)/'`pybde_volume.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pyexecdir2)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local \ - clean-pyexecLTLIBRARIES mostlyclean-am - -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pyexecLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/pybde_la-pybde.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_datetime.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_encryption_methods.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_error.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_guid.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_integer.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_key_protection_types.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_key_protector.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_key_protectors.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_volume.Plo - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pyexecLTLIBRARIES - -.MAKE: all check install install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libtool clean-local \ - clean-pyexecLTLIBRARIES cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-pyexecLTLIBRARIES install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ - uninstall-pyexecLTLIBRARIES - -.PRECIOUS: Makefile - - -@HAVE_PYTHON2_TRUE@$(BUILT_SOURCES): -@HAVE_PYTHON2_TRUE@ /bin/cp -f $(top_srcdir)/pybde/$@ $@ - -clean-local: - /bin/rm -f pybde*.[ch] - -distclean: clean - /bin/rm -f Makefile - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru libbde-20190102/pybde-python3/Makefile.am libbde-20240223/pybde-python3/Makefile.am --- libbde-20190102/pybde-python3/Makefile.am 2019-01-02 14:14:09.000000000 +0000 +++ libbde-20240223/pybde-python3/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -# Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects -# subdir-objects will compile the source files to a single version of Python. -# Since subdir-objects is being deprecated we copy the source files instead. -am__installdirs = "$(DESTDIR)$(pyexecdir3)" -pyexecdir = $(pyexecdir3) - -if HAVE_PYTHON3 -AM_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/common \ - @LIBCERROR_CPPFLAGS@ \ - @LIBCDATA_CPPFLAGS@ \ - @LIBCLOCALE_CPPFLAGS@ \ - @LIBCSPLIT_CPPFLAGS@ \ - @LIBUNA_CPPFLAGS@ \ - @LIBCFILE_CPPFLAGS@ \ - @LIBCPATH_CPPFLAGS@ \ - @LIBBFIO_CPPFLAGS@ \ - @LIBFGUID_CPPFLAGS@ \ - @LIBBDE_DLL_IMPORT@ - -am_pybde_la_rpath = -rpath $(pyexecdir3) - -BUILT_SOURCES = \ - pybde.c pybde.h \ - pybde_datetime.c pybde_datetime.h \ - pybde_encryption_methods.c pybde_encryption_methods.h \ - pybde_error.c pybde_error.h \ - pybde_file_object_io_handle.c pybde_file_object_io_handle.h \ - pybde_guid.c pybde_guid.h \ - pybde_integer.c pybde_integer.h \ - pybde_key_protection_types.c pybde_key_protection_types.h \ - pybde_key_protector.c pybde_key_protector.h \ - pybde_key_protectors.c pybde_key_protectors.h \ - pybde_libbde.h \ - pybde_libbfio.h \ - pybde_libcerror.h \ - pybde_libclocale.h \ - pybde_libfguid.h \ - pybde_python.h \ - pybde_unused.h \ - pybde_volume.c pybde_volume.h - -pyexec_LTLIBRARIES = pybde.la - -nodist_pybde_la_SOURCES = $(BUILT_SOURCES) - -pybde_la_LIBADD = \ - @LIBCERROR_LIBADD@ \ - ../libbde/libbde.la \ - @LIBCDATA_LIBADD@ \ - @LIBCLOCALE_LIBADD@ \ - @LIBCSPLIT_LIBADD@ \ - @LIBUNA_LIBADD@ \ - @LIBCFILE_LIBADD@ \ - @LIBCPATH_LIBADD@ \ - @LIBBFIO_LIBADD@ \ - @LIBFGUID_LIBADD@ - -pybde_la_CPPFLAGS = $(PYTHON3_CPPFLAGS) -pybde_la_LDFLAGS = -module -avoid-version $(PYTHON3_LDFLAGS) - -$(BUILT_SOURCES): - /bin/cp -f $(top_srcdir)/pybde/$@ $@ - -endif - -MAINTAINERCLEANFILES = \ - Makefile.in - -clean-local: - /bin/rm -f pybde*.[ch] - -distclean: clean - /bin/rm -f Makefile - diff -Nru libbde-20190102/pybde-python3/Makefile.in libbde-20240223/pybde-python3/Makefile.in --- libbde-20190102/pybde-python3/Makefile.in 2019-01-02 15:57:52.000000000 +0000 +++ libbde-20240223/pybde-python3/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,1106 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = pybde-python3 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ - $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ - $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ - $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/pthread.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/tests.m4 \ - $(top_srcdir)/m4/types.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/common/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -LTLIBRARIES = $(pyexec_LTLIBRARIES) -@HAVE_PYTHON3_TRUE@pybde_la_DEPENDENCIES = ../libbde/libbde.la -@HAVE_PYTHON3_TRUE@am__objects_1 = pybde_la-pybde.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_datetime.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_encryption_methods.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_error.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_file_object_io_handle.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_guid.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_integer.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_key_protection_types.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_key_protector.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_key_protectors.lo \ -@HAVE_PYTHON3_TRUE@ pybde_la-pybde_volume.lo -@HAVE_PYTHON3_TRUE@nodist_pybde_la_OBJECTS = $(am__objects_1) -pybde_la_OBJECTS = $(nodist_pybde_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -pybde_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(pybde_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/pybde_la-pybde.Plo \ - ./$(DEPDIR)/pybde_la-pybde_datetime.Plo \ - ./$(DEPDIR)/pybde_la-pybde_encryption_methods.Plo \ - ./$(DEPDIR)/pybde_la-pybde_error.Plo \ - ./$(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo \ - ./$(DEPDIR)/pybde_la-pybde_guid.Plo \ - ./$(DEPDIR)/pybde_la-pybde_integer.Plo \ - ./$(DEPDIR)/pybde_la-pybde_key_protection_types.Plo \ - ./$(DEPDIR)/pybde_la-pybde_key_protector.Plo \ - ./$(DEPDIR)/pybde_la-pybde_key_protectors.Plo \ - ./$(DEPDIR)/pybde_la-pybde_volume.Plo -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(nodist_pybde_la_SOURCES) -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DPKG_DATE = @DPKG_DATE@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GREP = @GREP@ -HAVE_DLLMAIN = @HAVE_DLLMAIN@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_LIBBFIO = @HAVE_LIBBFIO@ -HAVE_LIBCAES = @HAVE_LIBCAES@ -HAVE_LIBCDATA = @HAVE_LIBCDATA@ -HAVE_LIBCERROR = @HAVE_LIBCERROR@ -HAVE_LIBCFILE = @HAVE_LIBCFILE@ -HAVE_LIBCLOCALE = @HAVE_LIBCLOCALE@ -HAVE_LIBCNOTIFY = @HAVE_LIBCNOTIFY@ -HAVE_LIBCPATH = @HAVE_LIBCPATH@ -HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ -HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ -HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ -HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ -HAVE_LIBFGUID = @HAVE_LIBFGUID@ -HAVE_LIBFUSE = @HAVE_LIBFUSE@ -HAVE_LIBFVALUE = @HAVE_LIBFVALUE@ -HAVE_LIBHMAC = @HAVE_LIBHMAC@ -HAVE_LIBUNA = @HAVE_LIBUNA@ -HAVE_LOCAL_LIBBFIO = @HAVE_LOCAL_LIBBFIO@ -HAVE_LOCAL_LIBCAES = @HAVE_LOCAL_LIBCAES@ -HAVE_LOCAL_LIBCDATA = @HAVE_LOCAL_LIBCDATA@ -HAVE_LOCAL_LIBCERROR = @HAVE_LOCAL_LIBCERROR@ -HAVE_LOCAL_LIBCFILE = @HAVE_LOCAL_LIBCFILE@ -HAVE_LOCAL_LIBCLOCALE = @HAVE_LOCAL_LIBCLOCALE@ -HAVE_LOCAL_LIBCNOTIFY = @HAVE_LOCAL_LIBCNOTIFY@ -HAVE_LOCAL_LIBCPATH = @HAVE_LOCAL_LIBCPATH@ -HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ -HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ -HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ -HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ -HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ -HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ -HAVE_LOCAL_LIBHMAC = @HAVE_LOCAL_LIBHMAC@ -HAVE_LOCAL_LIBUNA = @HAVE_LOCAL_LIBUNA@ -HAVE_MULTI_THREAD_SUPPORT = @HAVE_MULTI_THREAD_SUPPORT@ -HAVE_OFF64_T = @HAVE_OFF64_T@ -HAVE_OPENSSL_EVP_H = @HAVE_OPENSSL_EVP_H@ -HAVE_PTHREAD = @HAVE_PTHREAD@ -HAVE_SIZE32_T = @HAVE_SIZE32_T@ -HAVE_SIZE64_T = @HAVE_SIZE64_T@ -HAVE_SSIZE32_T = @HAVE_SSIZE32_T@ -HAVE_SSIZE64_T = @HAVE_SSIZE64_T@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WIDE_CHARACTER_TYPE = @HAVE_WIDE_CHARACTER_TYPE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBBDE_DLL_EXPORT = @LIBBDE_DLL_EXPORT@ -LIBBDE_DLL_IMPORT = @LIBBDE_DLL_IMPORT@ -LIBBFIO_CPPFLAGS = @LIBBFIO_CPPFLAGS@ -LIBBFIO_LIBADD = @LIBBFIO_LIBADD@ -LIBCAES_CPPFLAGS = @LIBCAES_CPPFLAGS@ -LIBCAES_LIBADD = @LIBCAES_LIBADD@ -LIBCDATA_CPPFLAGS = @LIBCDATA_CPPFLAGS@ -LIBCDATA_LIBADD = @LIBCDATA_LIBADD@ -LIBCERROR_CPPFLAGS = @LIBCERROR_CPPFLAGS@ -LIBCERROR_LIBADD = @LIBCERROR_LIBADD@ -LIBCFILE_CPPFLAGS = @LIBCFILE_CPPFLAGS@ -LIBCFILE_LIBADD = @LIBCFILE_LIBADD@ -LIBCLOCALE_CPPFLAGS = @LIBCLOCALE_CPPFLAGS@ -LIBCLOCALE_LIBADD = @LIBCLOCALE_LIBADD@ -LIBCNOTIFY_CPPFLAGS = @LIBCNOTIFY_CPPFLAGS@ -LIBCNOTIFY_LIBADD = @LIBCNOTIFY_LIBADD@ -LIBCPATH_CPPFLAGS = @LIBCPATH_CPPFLAGS@ -LIBCPATH_LIBADD = @LIBCPATH_LIBADD@ -LIBCRYPTO_CPPFLAGS = @LIBCRYPTO_CPPFLAGS@ -LIBCRYPTO_LIBADD = @LIBCRYPTO_LIBADD@ -LIBCSPLIT_CPPFLAGS = @LIBCSPLIT_CPPFLAGS@ -LIBCSPLIT_LIBADD = @LIBCSPLIT_LIBADD@ -LIBCTHREADS_CPPFLAGS = @LIBCTHREADS_CPPFLAGS@ -LIBCTHREADS_LIBADD = @LIBCTHREADS_LIBADD@ -LIBDL_LIBADD = @LIBDL_LIBADD@ -LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ -LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ -LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ -LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ -LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ -LIBFGUID_LIBADD = @LIBFGUID_LIBADD@ -LIBFUSE_CPPFLAGS = @LIBFUSE_CPPFLAGS@ -LIBFUSE_LIBADD = @LIBFUSE_LIBADD@ -LIBFVALUE_CPPFLAGS = @LIBFVALUE_CPPFLAGS@ -LIBFVALUE_LIBADD = @LIBFVALUE_LIBADD@ -LIBHMAC_CPPFLAGS = @LIBHMAC_CPPFLAGS@ -LIBHMAC_LIBADD = @LIBHMAC_LIBADD@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ -LIBUNA_LIBADD = @LIBUNA_LIBADD@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGCONFIG = @PKGCONFIG@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -POSUB = @POSUB@ -PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ -PTHREAD_LIBADD = @PTHREAD_LIBADD@ -PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ -PYTHON_CONFIG = @PYTHON_CONFIG@ -PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ -PYTHON_LIBRARY_DIR = @PYTHON_LIBRARY_DIR@ -PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SPEC_DATE = @SPEC_DATE@ -STATIC_LDFLAGS = @STATIC_LDFLAGS@ -STRIP = @STRIP@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -ax_libbfio_pc_libs_private = @ax_libbfio_pc_libs_private@ -ax_libbfio_spec_build_requires = @ax_libbfio_spec_build_requires@ -ax_libbfio_spec_requires = @ax_libbfio_spec_requires@ -ax_libcaes_pc_libs_private = @ax_libcaes_pc_libs_private@ -ax_libcaes_spec_build_requires = @ax_libcaes_spec_build_requires@ -ax_libcaes_spec_requires = @ax_libcaes_spec_requires@ -ax_libcdata_pc_libs_private = @ax_libcdata_pc_libs_private@ -ax_libcdata_spec_build_requires = @ax_libcdata_spec_build_requires@ -ax_libcdata_spec_requires = @ax_libcdata_spec_requires@ -ax_libcerror_pc_libs_private = @ax_libcerror_pc_libs_private@ -ax_libcerror_spec_build_requires = @ax_libcerror_spec_build_requires@ -ax_libcerror_spec_requires = @ax_libcerror_spec_requires@ -ax_libcfile_pc_libs_private = @ax_libcfile_pc_libs_private@ -ax_libcfile_spec_build_requires = @ax_libcfile_spec_build_requires@ -ax_libcfile_spec_requires = @ax_libcfile_spec_requires@ -ax_libclocale_pc_libs_private = @ax_libclocale_pc_libs_private@ -ax_libclocale_spec_build_requires = @ax_libclocale_spec_build_requires@ -ax_libclocale_spec_requires = @ax_libclocale_spec_requires@ -ax_libcnotify_pc_libs_private = @ax_libcnotify_pc_libs_private@ -ax_libcnotify_spec_build_requires = @ax_libcnotify_spec_build_requires@ -ax_libcnotify_spec_requires = @ax_libcnotify_spec_requires@ -ax_libcpath_pc_libs_private = @ax_libcpath_pc_libs_private@ -ax_libcpath_spec_build_requires = @ax_libcpath_spec_build_requires@ -ax_libcpath_spec_requires = @ax_libcpath_spec_requires@ -ax_libcrypto_pc_libs_private = @ax_libcrypto_pc_libs_private@ -ax_libcrypto_spec_build_requires = @ax_libcrypto_spec_build_requires@ -ax_libcrypto_spec_requires = @ax_libcrypto_spec_requires@ -ax_libcsplit_pc_libs_private = @ax_libcsplit_pc_libs_private@ -ax_libcsplit_spec_build_requires = @ax_libcsplit_spec_build_requires@ -ax_libcsplit_spec_requires = @ax_libcsplit_spec_requires@ -ax_libcthreads_pc_libs_private = @ax_libcthreads_pc_libs_private@ -ax_libcthreads_spec_build_requires = @ax_libcthreads_spec_build_requires@ -ax_libcthreads_spec_requires = @ax_libcthreads_spec_requires@ -ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ -ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ -ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ -ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ -ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ -ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ -ax_libfguid_pc_libs_private = @ax_libfguid_pc_libs_private@ -ax_libfguid_spec_build_requires = @ax_libfguid_spec_build_requires@ -ax_libfguid_spec_requires = @ax_libfguid_spec_requires@ -ax_libfuse_pc_libs_private = @ax_libfuse_pc_libs_private@ -ax_libfuse_spec_build_requires = @ax_libfuse_spec_build_requires@ -ax_libfuse_spec_requires = @ax_libfuse_spec_requires@ -ax_libfvalue_pc_libs_private = @ax_libfvalue_pc_libs_private@ -ax_libfvalue_spec_build_requires = @ax_libfvalue_spec_build_requires@ -ax_libfvalue_spec_requires = @ax_libfvalue_spec_requires@ -ax_libhmac_pc_libs_private = @ax_libhmac_pc_libs_private@ -ax_libhmac_spec_build_requires = @ax_libhmac_spec_build_requires@ -ax_libhmac_spec_requires = @ax_libhmac_spec_requires@ -ax_libuna_pc_libs_private = @ax_libuna_pc_libs_private@ -ax_libuna_spec_build_requires = @ax_libuna_spec_build_requires@ -ax_libuna_spec_requires = @ax_libuna_spec_requires@ -ax_pthread_pc_libs_private = @ax_pthread_pc_libs_private@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -fuse_CFLAGS = @fuse_CFLAGS@ -fuse_LIBS = @fuse_LIBS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libbde_spec_requires = @libbde_spec_requires@ -libbde_spec_tools_build_requires = @libbde_spec_tools_build_requires@ -libbfio_CFLAGS = @libbfio_CFLAGS@ -libbfio_LIBS = @libbfio_LIBS@ -libcaes_CFLAGS = @libcaes_CFLAGS@ -libcaes_LIBS = @libcaes_LIBS@ -libcdata_CFLAGS = @libcdata_CFLAGS@ -libcdata_LIBS = @libcdata_LIBS@ -libcerror_CFLAGS = @libcerror_CFLAGS@ -libcerror_LIBS = @libcerror_LIBS@ -libcfile_CFLAGS = @libcfile_CFLAGS@ -libcfile_LIBS = @libcfile_LIBS@ -libclocale_CFLAGS = @libclocale_CFLAGS@ -libclocale_LIBS = @libclocale_LIBS@ -libcnotify_CFLAGS = @libcnotify_CFLAGS@ -libcnotify_LIBS = @libcnotify_LIBS@ -libcpath_CFLAGS = @libcpath_CFLAGS@ -libcpath_LIBS = @libcpath_LIBS@ -libcsplit_CFLAGS = @libcsplit_CFLAGS@ -libcsplit_LIBS = @libcsplit_LIBS@ -libcthreads_CFLAGS = @libcthreads_CFLAGS@ -libcthreads_LIBS = @libcthreads_LIBS@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libfcache_CFLAGS = @libfcache_CFLAGS@ -libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ -libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ -libfdatetime_LIBS = @libfdatetime_LIBS@ -libfguid_CFLAGS = @libfguid_CFLAGS@ -libfguid_LIBS = @libfguid_LIBS@ -libfvalue_CFLAGS = @libfvalue_CFLAGS@ -libfvalue_LIBS = @libfvalue_LIBS@ -libhmac_CFLAGS = @libhmac_CFLAGS@ -libhmac_LIBS = @libhmac_LIBS@ -libuna_CFLAGS = @libuna_CFLAGS@ -libuna_LIBS = @libuna_LIBS@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -openssl_CFLAGS = @openssl_CFLAGS@ -openssl_LIBS = @openssl_LIBS@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = $(pyexecdir3) -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ -pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# Note that we cannot use: AUTOMAKE_OPTIONS = subdir-objects -# subdir-objects will compile the source files to a single version of Python. -# Since subdir-objects is being deprecated we copy the source files instead. -am__installdirs = "$(DESTDIR)$(pyexecdir3)" -@HAVE_PYTHON3_TRUE@AM_CFLAGS = \ -@HAVE_PYTHON3_TRUE@ -I$(top_srcdir)/include \ -@HAVE_PYTHON3_TRUE@ -I$(top_srcdir)/common \ -@HAVE_PYTHON3_TRUE@ @LIBCERROR_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBCDATA_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBCLOCALE_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBCSPLIT_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBUNA_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBCFILE_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBCPATH_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBBFIO_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBFGUID_CPPFLAGS@ \ -@HAVE_PYTHON3_TRUE@ @LIBBDE_DLL_IMPORT@ - -@HAVE_PYTHON3_TRUE@am_pybde_la_rpath = -rpath $(pyexecdir3) -@HAVE_PYTHON3_TRUE@BUILT_SOURCES = \ -@HAVE_PYTHON3_TRUE@ pybde.c pybde.h \ -@HAVE_PYTHON3_TRUE@ pybde_datetime.c pybde_datetime.h \ -@HAVE_PYTHON3_TRUE@ pybde_encryption_methods.c pybde_encryption_methods.h \ -@HAVE_PYTHON3_TRUE@ pybde_error.c pybde_error.h \ -@HAVE_PYTHON3_TRUE@ pybde_file_object_io_handle.c pybde_file_object_io_handle.h \ -@HAVE_PYTHON3_TRUE@ pybde_guid.c pybde_guid.h \ -@HAVE_PYTHON3_TRUE@ pybde_integer.c pybde_integer.h \ -@HAVE_PYTHON3_TRUE@ pybde_key_protection_types.c pybde_key_protection_types.h \ -@HAVE_PYTHON3_TRUE@ pybde_key_protector.c pybde_key_protector.h \ -@HAVE_PYTHON3_TRUE@ pybde_key_protectors.c pybde_key_protectors.h \ -@HAVE_PYTHON3_TRUE@ pybde_libbde.h \ -@HAVE_PYTHON3_TRUE@ pybde_libbfio.h \ -@HAVE_PYTHON3_TRUE@ pybde_libcerror.h \ -@HAVE_PYTHON3_TRUE@ pybde_libclocale.h \ -@HAVE_PYTHON3_TRUE@ pybde_libfguid.h \ -@HAVE_PYTHON3_TRUE@ pybde_python.h \ -@HAVE_PYTHON3_TRUE@ pybde_unused.h \ -@HAVE_PYTHON3_TRUE@ pybde_volume.c pybde_volume.h - -@HAVE_PYTHON3_TRUE@pyexec_LTLIBRARIES = pybde.la -@HAVE_PYTHON3_TRUE@nodist_pybde_la_SOURCES = $(BUILT_SOURCES) -@HAVE_PYTHON3_TRUE@pybde_la_LIBADD = \ -@HAVE_PYTHON3_TRUE@ @LIBCERROR_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ ../libbde/libbde.la \ -@HAVE_PYTHON3_TRUE@ @LIBCDATA_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBCLOCALE_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBCSPLIT_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBUNA_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBCFILE_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBCPATH_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBBFIO_LIBADD@ \ -@HAVE_PYTHON3_TRUE@ @LIBFGUID_LIBADD@ - -@HAVE_PYTHON3_TRUE@pybde_la_CPPFLAGS = $(PYTHON3_CPPFLAGS) -@HAVE_PYTHON3_TRUE@pybde_la_LDFLAGS = -module -avoid-version $(PYTHON3_LDFLAGS) -MAINTAINERCLEANFILES = \ - Makefile.in - -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pybde-python3/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu pybde-python3/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(pyexecdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pyexecdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pyexecdir)"; \ - } - -uninstall-pyexecLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pyexec_LTLIBRARIES)'; test -n "$(pyexecdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$f"; \ - done - -clean-pyexecLTLIBRARIES: - -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) - @list='$(pyexec_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -pybde.la: $(pybde_la_OBJECTS) $(pybde_la_DEPENDENCIES) $(EXTRA_pybde_la_DEPENDENCIES) - $(AM_V_CCLD)$(pybde_la_LINK) $(am_pybde_la_rpath) $(pybde_la_OBJECTS) $(pybde_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_datetime.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_encryption_methods.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_error.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_guid.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_integer.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_key_protection_types.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_key_protector.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_key_protectors.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pybde_la-pybde_volume.Plo@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -pybde_la-pybde.lo: pybde.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde.Tpo -c -o pybde_la-pybde.lo `test -f 'pybde.c' || echo '$(srcdir)/'`pybde.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde.Tpo $(DEPDIR)/pybde_la-pybde.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde.c' object='pybde_la-pybde.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde.lo `test -f 'pybde.c' || echo '$(srcdir)/'`pybde.c - -pybde_la-pybde_datetime.lo: pybde_datetime.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_datetime.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_datetime.Tpo -c -o pybde_la-pybde_datetime.lo `test -f 'pybde_datetime.c' || echo '$(srcdir)/'`pybde_datetime.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_datetime.Tpo $(DEPDIR)/pybde_la-pybde_datetime.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_datetime.c' object='pybde_la-pybde_datetime.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_datetime.lo `test -f 'pybde_datetime.c' || echo '$(srcdir)/'`pybde_datetime.c - -pybde_la-pybde_encryption_methods.lo: pybde_encryption_methods.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_encryption_methods.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_encryption_methods.Tpo -c -o pybde_la-pybde_encryption_methods.lo `test -f 'pybde_encryption_methods.c' || echo '$(srcdir)/'`pybde_encryption_methods.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_encryption_methods.Tpo $(DEPDIR)/pybde_la-pybde_encryption_methods.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_encryption_methods.c' object='pybde_la-pybde_encryption_methods.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_encryption_methods.lo `test -f 'pybde_encryption_methods.c' || echo '$(srcdir)/'`pybde_encryption_methods.c - -pybde_la-pybde_error.lo: pybde_error.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_error.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_error.Tpo -c -o pybde_la-pybde_error.lo `test -f 'pybde_error.c' || echo '$(srcdir)/'`pybde_error.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_error.Tpo $(DEPDIR)/pybde_la-pybde_error.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_error.c' object='pybde_la-pybde_error.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_error.lo `test -f 'pybde_error.c' || echo '$(srcdir)/'`pybde_error.c - -pybde_la-pybde_file_object_io_handle.lo: pybde_file_object_io_handle.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_file_object_io_handle.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_file_object_io_handle.Tpo -c -o pybde_la-pybde_file_object_io_handle.lo `test -f 'pybde_file_object_io_handle.c' || echo '$(srcdir)/'`pybde_file_object_io_handle.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_file_object_io_handle.Tpo $(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_file_object_io_handle.c' object='pybde_la-pybde_file_object_io_handle.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_file_object_io_handle.lo `test -f 'pybde_file_object_io_handle.c' || echo '$(srcdir)/'`pybde_file_object_io_handle.c - -pybde_la-pybde_guid.lo: pybde_guid.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_guid.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_guid.Tpo -c -o pybde_la-pybde_guid.lo `test -f 'pybde_guid.c' || echo '$(srcdir)/'`pybde_guid.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_guid.Tpo $(DEPDIR)/pybde_la-pybde_guid.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_guid.c' object='pybde_la-pybde_guid.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_guid.lo `test -f 'pybde_guid.c' || echo '$(srcdir)/'`pybde_guid.c - -pybde_la-pybde_integer.lo: pybde_integer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_integer.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_integer.Tpo -c -o pybde_la-pybde_integer.lo `test -f 'pybde_integer.c' || echo '$(srcdir)/'`pybde_integer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_integer.Tpo $(DEPDIR)/pybde_la-pybde_integer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_integer.c' object='pybde_la-pybde_integer.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_integer.lo `test -f 'pybde_integer.c' || echo '$(srcdir)/'`pybde_integer.c - -pybde_la-pybde_key_protection_types.lo: pybde_key_protection_types.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_key_protection_types.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_key_protection_types.Tpo -c -o pybde_la-pybde_key_protection_types.lo `test -f 'pybde_key_protection_types.c' || echo '$(srcdir)/'`pybde_key_protection_types.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_key_protection_types.Tpo $(DEPDIR)/pybde_la-pybde_key_protection_types.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_key_protection_types.c' object='pybde_la-pybde_key_protection_types.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_key_protection_types.lo `test -f 'pybde_key_protection_types.c' || echo '$(srcdir)/'`pybde_key_protection_types.c - -pybde_la-pybde_key_protector.lo: pybde_key_protector.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_key_protector.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_key_protector.Tpo -c -o pybde_la-pybde_key_protector.lo `test -f 'pybde_key_protector.c' || echo '$(srcdir)/'`pybde_key_protector.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_key_protector.Tpo $(DEPDIR)/pybde_la-pybde_key_protector.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_key_protector.c' object='pybde_la-pybde_key_protector.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_key_protector.lo `test -f 'pybde_key_protector.c' || echo '$(srcdir)/'`pybde_key_protector.c - -pybde_la-pybde_key_protectors.lo: pybde_key_protectors.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_key_protectors.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_key_protectors.Tpo -c -o pybde_la-pybde_key_protectors.lo `test -f 'pybde_key_protectors.c' || echo '$(srcdir)/'`pybde_key_protectors.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_key_protectors.Tpo $(DEPDIR)/pybde_la-pybde_key_protectors.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_key_protectors.c' object='pybde_la-pybde_key_protectors.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_key_protectors.lo `test -f 'pybde_key_protectors.c' || echo '$(srcdir)/'`pybde_key_protectors.c - -pybde_la-pybde_volume.lo: pybde_volume.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pybde_la-pybde_volume.lo -MD -MP -MF $(DEPDIR)/pybde_la-pybde_volume.Tpo -c -o pybde_la-pybde_volume.lo `test -f 'pybde_volume.c' || echo '$(srcdir)/'`pybde_volume.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pybde_la-pybde_volume.Tpo $(DEPDIR)/pybde_la-pybde_volume.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pybde_volume.c' object='pybde_la-pybde_volume.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pybde_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pybde_la-pybde_volume.lo `test -f 'pybde_volume.c' || echo '$(srcdir)/'`pybde_volume.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(pyexecdir3)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local \ - clean-pyexecLTLIBRARIES mostlyclean-am - -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-pyexecLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/pybde_la-pybde.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_datetime.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_encryption_methods.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_error.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_file_object_io_handle.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_guid.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_integer.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_key_protection_types.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_key_protector.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_key_protectors.Plo - -rm -f ./$(DEPDIR)/pybde_la-pybde_volume.Plo - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pyexecLTLIBRARIES - -.MAKE: all check install install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-generic clean-libtool clean-local \ - clean-pyexecLTLIBRARIES cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-pyexecLTLIBRARIES install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am \ - uninstall-pyexecLTLIBRARIES - -.PRECIOUS: Makefile - - -@HAVE_PYTHON3_TRUE@$(BUILT_SOURCES): -@HAVE_PYTHON3_TRUE@ /bin/cp -f $(top_srcdir)/pybde/$@ $@ - -clean-local: - /bin/rm -f pybde*.[ch] - -distclean: clean - /bin/rm -f Makefile - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru libbde-20190102/pyproject.toml libbde-20240223/pyproject.toml --- libbde-20190102/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/pyproject.toml 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1,4 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + diff -Nru libbde-20190102/setup.cfg libbde-20240223/setup.cfg --- libbde-20190102/setup.cfg 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/setup.cfg 2024-02-23 03:04:01.000000000 +0000 @@ -0,0 +1,16 @@ +[metadata] +name = libbde-python +version = 20240223 +description = Python bindings module for libbde +long_description = Python bindings module for libbde +long_description_content_type = text/plain +author = Joachim Metz +author_email = joachim.metz@gmail.com +license = GNU Lesser General Public License v3 or later (LGPLv3+) +license_files = COPYING COPYING.LESSER +classifiers = + Development Status :: 3 - Alpha + Programming Language :: Python + +[options] +python_requires = >=3.7 diff -Nru libbde-20190102/setup.cfg.in libbde-20240223/setup.cfg.in --- libbde-20190102/setup.cfg.in 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/setup.cfg.in 2024-02-23 02:47:17.000000000 +0000 @@ -0,0 +1,16 @@ +[metadata] +name = libbde-python +version = @VERSION@ +description = Python bindings module for libbde +long_description = Python bindings module for libbde +long_description_content_type = text/plain +author = Joachim Metz +author_email = joachim.metz@gmail.com +license = GNU Lesser General Public License v3 or later (LGPLv3+) +license_files = COPYING COPYING.LESSER +classifiers = + Development Status :: 3 - Alpha + Programming Language :: Python + +[options] +python_requires = >=3.7 diff -Nru libbde-20190102/setup.py libbde-20240223/setup.py --- libbde-20190102/setup.py 2019-01-02 14:15:13.000000000 +0000 +++ libbde-20240223/setup.py 2024-02-23 02:47:17.000000000 +0000 @@ -1,10 +1,12 @@ #!/usr/bin/env python # # Script to build and install Python-bindings. -# Version: 20181117 +# Version: 20230909 from __future__ import print_function +import copy +import datetime import glob import gzip import platform @@ -14,44 +16,20 @@ import subprocess import sys import tarfile +import zipfile -from distutils import dist -from distutils import sysconfig from distutils.ccompiler import new_compiler -from distutils.command.build_ext import build_ext -from distutils.command.bdist import bdist -from distutils.command.sdist import sdist -from distutils.core import Extension, setup - -try: - from distutils.command.bdist_msi import bdist_msi -except ImportError: - bdist_msi = None - - -if not bdist_msi: - custom_bdist_msi = None -else: - class custom_bdist_msi(bdist_msi): - """Custom handler for the bdist_msi command.""" - - def run(self): - """Builds an MSI.""" - # bdist_msi does not support the library version so we add ".1" - # as a work around. - self.distribution.metadata.version = "{0:s}.1".format( - self.distribution.metadata.version) - bdist_msi.run(self) +from setuptools import Extension +from setuptools import setup +from setuptools.command.build_ext import build_ext +from setuptools.command.sdist import sdist -class custom_bdist_rpm(bdist): - """Custom handler for the bdist_rpm command.""" - - def run(self): - """Builds a RPM.""" - print("'setup.py bdist_rpm' command not supported use 'rpmbuild' instead.") - sys.exit(1) +if (sys.version_info[0], sys.version_info[1]) < (3, 7): + print(("Unsupported Python version: {0:s}, version 3.7 or higher " + "required.").format(sys.version)) + sys.exit(1) class custom_build_ext(build_ext): @@ -84,11 +62,12 @@ compiler = new_compiler(compiler=self.compiler) if compiler.compiler_type == "msvc": self.define = [ + ("_CRT_SECURE_NO_WARNINGS", ""), ("UNICODE", ""), ] else: - command = "sh configure --disable-shared-libs" + command = "sh configure --disable-nls --disable-shared-libs" output = self._RunCommand(command) print_line = False @@ -102,7 +81,6 @@ self.define = [ ("HAVE_CONFIG_H", ""), - ("LOCALEDIR", "\"/usr/share/locale\""), ] build_ext.run(self) @@ -113,7 +91,7 @@ def run(self): """Builds a source distribution (sdist) package.""" - if self.formats != ["gztar"]: + if self.formats != ["gztar"] and self.formats != ["zip"]: print("'setup.py sdist' unsupported format.") sys.exit(1) @@ -127,20 +105,20 @@ if exit_code != 0: raise RuntimeError("Running: {0:s} failed.".format(command)) - if not os.path.exists("dist"): - os.mkdir("dist") + if not os.path.exists(self.dist_dir): + os.mkdir(self.dist_dir) source_package_file = glob.glob("*.tar.gz")[0] source_package_prefix, _, source_package_suffix = ( source_package_file.partition("-")) sdist_package_file = "{0:s}-python-{1:s}".format( source_package_prefix, source_package_suffix) - sdist_package_file = os.path.join("dist", sdist_package_file) + sdist_package_file = os.path.join(self.dist_dir, sdist_package_file) os.rename(source_package_file, sdist_package_file) # Create and add the PKG-INFO file to the source package. - with gzip.open(sdist_package_file, 'rb') as input_file: - with open(sdist_package_file[:-3], 'wb') as output_file: + with gzip.open(sdist_package_file, "rb") as input_file: + with open(sdist_package_file[:-3], "wb") as output_file: shutil.copyfileobj(input_file, output_file) os.remove(sdist_package_file) @@ -151,11 +129,38 @@ tar_file.add("PKG-INFO", arcname=pkg_info_path) os.remove("PKG-INFO") - with open(sdist_package_file[:-3], 'rb') as input_file: - with gzip.open(sdist_package_file, 'wb') as output_file: + with open(sdist_package_file[:-3], "rb") as input_file: + with gzip.open(sdist_package_file, "wb") as output_file: shutil.copyfileobj(input_file, output_file) os.remove(sdist_package_file[:-3]) + # Convert the .tar.gz into a .zip + if self.formats == ["zip"]: + zip_sdist_package_file = "{0:s}.zip".format(sdist_package_file[:-7]) + + with tarfile.open(sdist_package_file, "r|gz") as tar_file: + with zipfile.ZipFile( + zip_sdist_package_file, "w", zipfile.ZIP_DEFLATED) as zip_file: + for tar_file_entry in tar_file: + file_entry = tar_file.extractfile(tar_file_entry) + if tar_file_entry.isfile(): + modification_time = datetime.datetime.fromtimestamp( + tar_file_entry.mtime) + zip_modification_time = ( + modification_time.year, modification_time.month, + modification_time.day, modification_time.hour, + modification_time.minute, modification_time.second) + zip_info = zipfile.ZipInfo( + date_time=zip_modification_time, + filename=tar_file_entry.name) + zip_info.external_attr = (tar_file_entry.mode & 0xff) << 16 + + file_data = file_entry.read() + zip_file.writestr(zip_info, file_data) + + os.remove(sdist_package_file) + sdist_package_file = zip_sdist_package_file + # Inform distutils what files were created. dist_files = getattr(self.distribution, "dist_files", []) dist_files.append(("sdist", "", sdist_package_file)) @@ -180,49 +185,25 @@ """The Python module name.""" return "py{0:s}".format(self.library_name[3:]) - @property - def package_name(self): - """The package name.""" - return "{0:s}-python".format(self.library_name) - - @property - def package_description(self): - """The package description.""" - return "Python bindings module for {0:s}".format(self.library_name) - - @property - def project_url(self): - """The project URL.""" - return "https://github.com/libyal/{0:s}/".format(self.library_name) - def _ReadConfigureAc(self): """Reads configure.ac to initialize the project information.""" - file_object = open("configure.ac", "rb") - if not file_object: - raise IOError("Unable to open: configure.ac") - - found_ac_init = False - found_library_name = False - for line in file_object.readlines(): - line = line.strip() - if found_library_name: - library_version = line[1:-2] - if sys.version_info[0] >= 3: - library_version = library_version.decode("ascii") - self.library_version = library_version - break - - elif found_ac_init: - library_name = line[1:-2] - if sys.version_info[0] >= 3: - library_name = library_name.decode("ascii") - self.library_name = library_name - found_library_name = True + with open("configure.ac", "r", encoding="utf-8") as file_object: + found_ac_init = False + found_library_name = False + for line in file_object.readlines(): + line = line.strip() + if found_library_name: + library_version = line[1:-2] + self.library_version = library_version + break - elif line.startswith(b"AC_INIT"): - found_ac_init = True + elif found_ac_init: + library_name = line[1:-2] + self.library_name = library_name + found_library_name = True - file_object.close() + elif line.startswith("AC_INIT"): + found_ac_init = True if not self.library_name or not self.library_version: raise RuntimeError( @@ -233,30 +214,23 @@ if not self.library_name: raise RuntimeError("Missing library name") - file_object = open("Makefile.am", "rb") - if not file_object: - raise IOError("Unable to open: Makefile.am") - - found_subdirs = False - for line in file_object.readlines(): - line = line.strip() - if found_subdirs: - library_name, _, _ = line.partition(b" ") - if sys.version_info[0] >= 3: - library_name = library_name.decode("ascii") + with open("Makefile.am", "r", encoding="utf-8") as file_object: + found_subdirs = False + for line in file_object.readlines(): + line = line.strip() + if found_subdirs: + library_name, _, _ = line.partition(" ") + + self.include_directories.append(library_name) - self.include_directories.append(library_name) + if library_name.startswith("lib"): + self.library_names.append(library_name) - if library_name.startswith("lib"): - self.library_names.append(library_name) + if library_name == self.library_name: + break - if library_name == self.library_name: - break - - elif line.startswith(b"SUBDIRS"): - found_subdirs = True - - file_object.close() + elif line.startswith("SUBDIRS"): + found_subdirs = True if not self.include_directories or not self.library_names: raise RuntimeError( @@ -264,20 +238,11 @@ "Makefile.am") -def GetPythonLibraryDirectoryPath(): - """Retrieves the Python library directory path.""" - path = sysconfig.get_python_lib(True) - _, _, path = path.rpartition(sysconfig.PREFIX) - - if path.startswith(os.sep): - path = path[1:] - - return path - - project_information = ProjectInformation() -PYTHON_LIBRARY_DIRECTORY = GetPythonLibraryDirectoryPath() +CMDCLASS = { + "build_ext": custom_build_ext, + "sdist": custom_sdist} SOURCES = [] @@ -308,33 +273,11 @@ source_files = glob.glob(os.path.join(project_information.module_name, "*.c")) SOURCES.extend(source_files) -# Add the LICENSE file to the distribution. -copying_file = os.path.join("COPYING") -license_file = "LICENSE.{0:s}".format(project_information.module_name) -shutil.copyfile(copying_file, license_file) - -LIBRARY_DATA_FILES = [license_file] - # TODO: find a way to detect missing python.h # e.g. on Ubuntu python-dev is not installed by python-pip -# TODO: what about description and platform in egg file - -setup( - name=project_information.package_name, - url=project_information.project_url, - version=project_information.library_version, - description=project_information.package_description, - long_description=project_information.package_description, - author="Joachim Metz", - author_email="joachim.metz@gmail.com", - license="GNU Lesser General Public License v3 or later (LGPLv3+)", - cmdclass={ - "build_ext": custom_build_ext, - "bdist_msi": custom_bdist_msi, - "bdist_rpm": custom_bdist_rpm, - "sdist": custom_sdist, - }, +setup_args = dict( + cmdclass=CMDCLASS, ext_modules=[ Extension( project_information.module_name, @@ -342,11 +285,9 @@ include_dirs=project_information.include_directories, libraries=[], library_dirs=[], - sources=SOURCES, - ), - ], - data_files=[(PYTHON_LIBRARY_DIRECTORY, LIBRARY_DATA_FILES)], + sources=SOURCES + ) + ] ) - -os.remove(license_file) +setup(**setup_args) diff -Nru libbde-20190102/test-driver libbde-20240223/test-driver --- libbde-20190102/test-driver 2019-01-02 15:57:52.000000000 +0000 +++ libbde-20240223/test-driver 2024-02-23 03:03:51.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,11 +42,13 @@ { cat <$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -Nru libbde-20190102/tests/Makefile.am libbde-20240223/tests/Makefile.am --- libbde-20190102/tests/Makefile.am 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/Makefile.am 2024-02-23 02:48:06.000000000 +0000 @@ -1,3 +1,5 @@ +AUTOMAKE_OPTIONS = subdir-objects + AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @@ -12,7 +14,6 @@ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ - @LIBFDATA_CPPFLAGS@ \ @LIBFDATETIME_CPPFLAGS@ \ @LIBFGUID_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @@ -28,6 +29,7 @@ TESTS = \ test_library.sh \ + test_tools.sh \ test_bdeinfo.sh \ $(TESTS_PYBDE) @@ -36,27 +38,38 @@ pybde_test_volume.py \ test_bdeinfo.sh \ test_library.sh \ + test_manpage.sh \ test_python_module.sh \ - test_runner.sh + test_runner.sh \ + test_tools.sh EXTRA_DIST = \ $(check_SCRIPTS) check_PROGRAMS = \ bde_test_aes_ccm_encrypted_key \ + bde_test_encryption_context \ bde_test_error \ bde_test_external_key \ bde_test_io_handle \ bde_test_key \ bde_test_key_protector \ bde_test_metadata \ + bde_test_metadata_block_header \ bde_test_metadata_entry \ + bde_test_metadata_header \ bde_test_notify \ + bde_test_password \ bde_test_password_keep \ bde_test_sector_data \ + bde_test_sector_data_vector \ bde_test_stretch_key \ bde_test_support \ + bde_test_tools_info_handle \ + bde_test_tools_output \ + bde_test_tools_signal \ bde_test_volume \ + bde_test_volume_header \ bde_test_volume_master_key bde_test_aes_ccm_encrypted_key_SOURCES = \ @@ -71,6 +84,18 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_encryption_context_SOURCES = \ + bde_test_encryption_context.c \ + bde_test_libbde.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_unused.h + +bde_test_encryption_context_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_error_SOURCES = \ bde_test_error.c \ bde_test_libbde.h \ @@ -140,6 +165,28 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_metadata_block_header_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbde.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_metadata_block_header.c \ + bde_test_unused.h + +bde_test_metadata_block_header_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_metadata_entry_SOURCES = \ bde_test_libbde.h \ bde_test_libcerror.h \ @@ -152,6 +199,28 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_metadata_header_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbde.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_metadata_header.c \ + bde_test_unused.h + +bde_test_metadata_header_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_notify_SOURCES = \ bde_test_libbde.h \ bde_test_libcnotify.h \ @@ -163,6 +232,17 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_password_SOURCES = \ + bde_test_libbde.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_password.c \ + bde_test_unused.h + +bde_test_password_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_password_keep_SOURCES = \ bde_test_libbde.h \ bde_test_libcerror.h \ @@ -176,7 +256,9 @@ @LIBCERROR_LIBADD@ bde_test_sector_data_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ bde_test_libbde.h \ + bde_test_libbfio.h \ bde_test_libcerror.h \ bde_test_macros.h \ bde_test_memory.c bde_test_memory.h \ @@ -184,6 +266,36 @@ bde_test_unused.h bde_test_sector_data_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + +bde_test_sector_data_vector_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbde.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_sector_data_vector.c \ + bde_test_unused.h + +bde_test_sector_data_vector_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ @@ -225,6 +337,52 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_tools_info_handle_SOURCES = \ + ../bdetools/bdetools_input.c ../bdetools/bdetools_input.h \ + ../bdetools/byte_size_string.c ../bdetools/byte_size_string.h \ + ../bdetools/info_handle.c ../bdetools/info_handle.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_tools_info_handle.c \ + bde_test_unused.h + +bde_test_tools_info_handle_LDADD = \ + @LIBFGUID_LIBADD@ \ + @LIBFDATETIME_LIBADD@ \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + +bde_test_tools_output_SOURCES = \ + ../bdetools/bdetools_output.c ../bdetools/bdetools_output.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_tools_output.c \ + bde_test_unused.h + +bde_test_tools_output_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + +bde_test_tools_signal_SOURCES = \ + ../bdetools/bdetools_signal.c ../bdetools/bdetools_signal.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_tools_signal.c \ + bde_test_unused.h + +bde_test_tools_signal_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_volume_SOURCES = \ bde_test_functions.c bde_test_functions.h \ bde_test_getopt.c bde_test_getopt.h \ @@ -253,6 +411,28 @@ @LIBCERROR_LIBADD@ \ @PTHREAD_LIBADD@ +bde_test_volume_header_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_libbde.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_unused.h \ + bde_test_volume_header.c + +bde_test_volume_header_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_volume_master_key_SOURCES = \ bde_test_libbde.h \ bde_test_libcerror.h \ @@ -269,5 +449,5 @@ Makefile.in distclean: clean - /bin/rm -f Makefile + -rm -f Makefile diff -Nru libbde-20190102/tests/Makefile.in libbde-20240223/tests/Makefile.in --- libbde-20190102/tests/Makefile.in 2019-01-02 15:57:52.000000000 +0000 +++ libbde-20240223/tests/Makefile.in 2024-02-23 03:03:51.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -88,26 +88,34 @@ build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = bde_test_aes_ccm_encrypted_key$(EXEEXT) \ - bde_test_error$(EXEEXT) bde_test_external_key$(EXEEXT) \ - bde_test_io_handle$(EXEEXT) bde_test_key$(EXEEXT) \ - bde_test_key_protector$(EXEEXT) bde_test_metadata$(EXEEXT) \ - bde_test_metadata_entry$(EXEEXT) bde_test_notify$(EXEEXT) \ - bde_test_password_keep$(EXEEXT) bde_test_sector_data$(EXEEXT) \ + bde_test_encryption_context$(EXEEXT) bde_test_error$(EXEEXT) \ + bde_test_external_key$(EXEEXT) bde_test_io_handle$(EXEEXT) \ + bde_test_key$(EXEEXT) bde_test_key_protector$(EXEEXT) \ + bde_test_metadata$(EXEEXT) \ + bde_test_metadata_block_header$(EXEEXT) \ + bde_test_metadata_entry$(EXEEXT) \ + bde_test_metadata_header$(EXEEXT) bde_test_notify$(EXEEXT) \ + bde_test_password$(EXEEXT) bde_test_password_keep$(EXEEXT) \ + bde_test_sector_data$(EXEEXT) \ + bde_test_sector_data_vector$(EXEEXT) \ bde_test_stretch_key$(EXEEXT) bde_test_support$(EXEEXT) \ - bde_test_volume$(EXEEXT) bde_test_volume_master_key$(EXEEXT) + bde_test_tools_info_handle$(EXEEXT) \ + bde_test_tools_output$(EXEEXT) bde_test_tools_signal$(EXEEXT) \ + bde_test_volume$(EXEEXT) bde_test_volume_header$(EXEEXT) \ + bde_test_volume_master_key$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libbfio.m4 $(top_srcdir)/m4/libcaes.m4 \ - $(top_srcdir)/m4/libcdata.m4 $(top_srcdir)/m4/libcerror.m4 \ - $(top_srcdir)/m4/libcfile.m4 $(top_srcdir)/m4/libclocale.m4 \ - $(top_srcdir)/m4/libcnotify.m4 $(top_srcdir)/m4/libcpath.m4 \ - $(top_srcdir)/m4/libcrypto.m4 $(top_srcdir)/m4/libcsplit.m4 \ - $(top_srcdir)/m4/libcthreads.m4 $(top_srcdir)/m4/libfcache.m4 \ - $(top_srcdir)/m4/libfdata.m4 $(top_srcdir)/m4/libfdatetime.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libbfio.m4 \ + $(top_srcdir)/m4/libcaes.m4 $(top_srcdir)/m4/libcdata.m4 \ + $(top_srcdir)/m4/libcerror.m4 $(top_srcdir)/m4/libcfile.m4 \ + $(top_srcdir)/m4/libclocale.m4 $(top_srcdir)/m4/libcnotify.m4 \ + $(top_srcdir)/m4/libcpath.m4 $(top_srcdir)/m4/libcrypto.m4 \ + $(top_srcdir)/m4/libcsplit.m4 $(top_srcdir)/m4/libcthreads.m4 \ + $(top_srcdir)/m4/libfcache.m4 $(top_srcdir)/m4/libfdatetime.m4 \ $(top_srcdir)/m4/libfguid.m4 $(top_srcdir)/m4/libfuse.m4 \ $(top_srcdir)/m4/libfvalue.m4 $(top_srcdir)/m4/libhmac.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/libuna.m4 \ @@ -135,6 +143,12 @@ am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +am_bde_test_encryption_context_OBJECTS = \ + bde_test_encryption_context.$(OBJEXT) \ + bde_test_memory.$(OBJEXT) +bde_test_encryption_context_OBJECTS = \ + $(am_bde_test_encryption_context_OBJECTS) +bde_test_encryption_context_DEPENDENCIES = ../libbde/libbde.la am_bde_test_error_OBJECTS = bde_test_error.$(OBJEXT) bde_test_error_OBJECTS = $(am_bde_test_error_OBJECTS) bde_test_error_DEPENDENCIES = ../libbde/libbde.la @@ -158,22 +172,42 @@ bde_test_metadata.$(OBJEXT) bde_test_metadata_OBJECTS = $(am_bde_test_metadata_OBJECTS) bde_test_metadata_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_metadata_block_header_OBJECTS = \ + bde_test_functions.$(OBJEXT) bde_test_memory.$(OBJEXT) \ + bde_test_metadata_block_header.$(OBJEXT) +bde_test_metadata_block_header_OBJECTS = \ + $(am_bde_test_metadata_block_header_OBJECTS) +bde_test_metadata_block_header_DEPENDENCIES = ../libbde/libbde.la am_bde_test_metadata_entry_OBJECTS = bde_test_memory.$(OBJEXT) \ bde_test_metadata_entry.$(OBJEXT) bde_test_metadata_entry_OBJECTS = \ $(am_bde_test_metadata_entry_OBJECTS) bde_test_metadata_entry_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_metadata_header_OBJECTS = bde_test_functions.$(OBJEXT) \ + bde_test_memory.$(OBJEXT) bde_test_metadata_header.$(OBJEXT) +bde_test_metadata_header_OBJECTS = \ + $(am_bde_test_metadata_header_OBJECTS) +bde_test_metadata_header_DEPENDENCIES = ../libbde/libbde.la am_bde_test_notify_OBJECTS = bde_test_notify.$(OBJEXT) bde_test_notify_OBJECTS = $(am_bde_test_notify_OBJECTS) bde_test_notify_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_password_OBJECTS = bde_test_password.$(OBJEXT) +bde_test_password_OBJECTS = $(am_bde_test_password_OBJECTS) +bde_test_password_DEPENDENCIES = ../libbde/libbde.la am_bde_test_password_keep_OBJECTS = bde_test_memory.$(OBJEXT) \ bde_test_password_keep.$(OBJEXT) bde_test_password_keep_OBJECTS = $(am_bde_test_password_keep_OBJECTS) bde_test_password_keep_DEPENDENCIES = ../libbde/libbde.la -am_bde_test_sector_data_OBJECTS = bde_test_memory.$(OBJEXT) \ - bde_test_sector_data.$(OBJEXT) +am_bde_test_sector_data_OBJECTS = bde_test_functions.$(OBJEXT) \ + bde_test_memory.$(OBJEXT) bde_test_sector_data.$(OBJEXT) bde_test_sector_data_OBJECTS = $(am_bde_test_sector_data_OBJECTS) bde_test_sector_data_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_sector_data_vector_OBJECTS = bde_test_functions.$(OBJEXT) \ + bde_test_memory.$(OBJEXT) \ + bde_test_sector_data_vector.$(OBJEXT) +bde_test_sector_data_vector_OBJECTS = \ + $(am_bde_test_sector_data_vector_OBJECTS) +bde_test_sector_data_vector_DEPENDENCIES = ../libbde/libbde.la am_bde_test_stretch_key_OBJECTS = bde_test_memory.$(OBJEXT) \ bde_test_stretch_key.$(OBJEXT) bde_test_stretch_key_OBJECTS = $(am_bde_test_stretch_key_OBJECTS) @@ -183,11 +217,34 @@ bde_test_support.$(OBJEXT) bde_test_support_OBJECTS = $(am_bde_test_support_OBJECTS) bde_test_support_DEPENDENCIES = ../libbde/libbde.la +am__dirstamp = $(am__leading_dot)dirstamp +am_bde_test_tools_info_handle_OBJECTS = \ + ../bdetools/bdetools_input.$(OBJEXT) \ + ../bdetools/byte_size_string.$(OBJEXT) \ + ../bdetools/info_handle.$(OBJEXT) bde_test_memory.$(OBJEXT) \ + bde_test_tools_info_handle.$(OBJEXT) +bde_test_tools_info_handle_OBJECTS = \ + $(am_bde_test_tools_info_handle_OBJECTS) +bde_test_tools_info_handle_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_tools_output_OBJECTS = \ + ../bdetools/bdetools_output.$(OBJEXT) \ + bde_test_tools_output.$(OBJEXT) +bde_test_tools_output_OBJECTS = $(am_bde_test_tools_output_OBJECTS) +bde_test_tools_output_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_tools_signal_OBJECTS = \ + ../bdetools/bdetools_signal.$(OBJEXT) \ + bde_test_tools_signal.$(OBJEXT) +bde_test_tools_signal_OBJECTS = $(am_bde_test_tools_signal_OBJECTS) +bde_test_tools_signal_DEPENDENCIES = ../libbde/libbde.la am_bde_test_volume_OBJECTS = bde_test_functions.$(OBJEXT) \ bde_test_getopt.$(OBJEXT) bde_test_memory.$(OBJEXT) \ bde_test_volume.$(OBJEXT) bde_test_volume_OBJECTS = $(am_bde_test_volume_OBJECTS) bde_test_volume_DEPENDENCIES = ../libbde/libbde.la +am_bde_test_volume_header_OBJECTS = bde_test_functions.$(OBJEXT) \ + bde_test_memory.$(OBJEXT) bde_test_volume_header.$(OBJEXT) +bde_test_volume_header_OBJECTS = $(am_bde_test_volume_header_OBJECTS) +bde_test_volume_header_DEPENDENCIES = ../libbde/libbde.la am_bde_test_volume_master_key_OBJECTS = bde_test_memory.$(OBJEXT) \ bde_test_volume_master_key.$(OBJEXT) bde_test_volume_master_key_OBJECTS = \ @@ -208,7 +265,13 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/common depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/bde_test_aes_ccm_encrypted_key.Po \ +am__depfiles_remade = ../bdetools/$(DEPDIR)/bdetools_input.Po \ + ../bdetools/$(DEPDIR)/bdetools_output.Po \ + ../bdetools/$(DEPDIR)/bdetools_signal.Po \ + ../bdetools/$(DEPDIR)/byte_size_string.Po \ + ../bdetools/$(DEPDIR)/info_handle.Po \ + ./$(DEPDIR)/bde_test_aes_ccm_encrypted_key.Po \ + ./$(DEPDIR)/bde_test_encryption_context.Po \ ./$(DEPDIR)/bde_test_error.Po \ ./$(DEPDIR)/bde_test_external_key.Po \ ./$(DEPDIR)/bde_test_functions.Po \ @@ -217,12 +280,21 @@ ./$(DEPDIR)/bde_test_key_protector.Po \ ./$(DEPDIR)/bde_test_memory.Po \ ./$(DEPDIR)/bde_test_metadata.Po \ + ./$(DEPDIR)/bde_test_metadata_block_header.Po \ ./$(DEPDIR)/bde_test_metadata_entry.Po \ + ./$(DEPDIR)/bde_test_metadata_header.Po \ ./$(DEPDIR)/bde_test_notify.Po \ + ./$(DEPDIR)/bde_test_password.Po \ ./$(DEPDIR)/bde_test_password_keep.Po \ ./$(DEPDIR)/bde_test_sector_data.Po \ + ./$(DEPDIR)/bde_test_sector_data_vector.Po \ ./$(DEPDIR)/bde_test_stretch_key.Po \ - ./$(DEPDIR)/bde_test_support.Po ./$(DEPDIR)/bde_test_volume.Po \ + ./$(DEPDIR)/bde_test_support.Po \ + ./$(DEPDIR)/bde_test_tools_info_handle.Po \ + ./$(DEPDIR)/bde_test_tools_output.Po \ + ./$(DEPDIR)/bde_test_tools_signal.Po \ + ./$(DEPDIR)/bde_test_volume.Po \ + ./$(DEPDIR)/bde_test_volume_header.Po \ ./$(DEPDIR)/bde_test_volume_master_key.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -244,30 +316,45 @@ am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(bde_test_aes_ccm_encrypted_key_SOURCES) \ + $(bde_test_encryption_context_SOURCES) \ $(bde_test_error_SOURCES) $(bde_test_external_key_SOURCES) \ $(bde_test_io_handle_SOURCES) $(bde_test_key_SOURCES) \ $(bde_test_key_protector_SOURCES) $(bde_test_metadata_SOURCES) \ - $(bde_test_metadata_entry_SOURCES) $(bde_test_notify_SOURCES) \ - $(bde_test_password_keep_SOURCES) \ + $(bde_test_metadata_block_header_SOURCES) \ + $(bde_test_metadata_entry_SOURCES) \ + $(bde_test_metadata_header_SOURCES) $(bde_test_notify_SOURCES) \ + $(bde_test_password_SOURCES) $(bde_test_password_keep_SOURCES) \ $(bde_test_sector_data_SOURCES) \ + $(bde_test_sector_data_vector_SOURCES) \ $(bde_test_stretch_key_SOURCES) $(bde_test_support_SOURCES) \ - $(bde_test_volume_SOURCES) \ + $(bde_test_tools_info_handle_SOURCES) \ + $(bde_test_tools_output_SOURCES) \ + $(bde_test_tools_signal_SOURCES) $(bde_test_volume_SOURCES) \ + $(bde_test_volume_header_SOURCES) \ $(bde_test_volume_master_key_SOURCES) DIST_SOURCES = $(bde_test_aes_ccm_encrypted_key_SOURCES) \ + $(bde_test_encryption_context_SOURCES) \ $(bde_test_error_SOURCES) $(bde_test_external_key_SOURCES) \ $(bde_test_io_handle_SOURCES) $(bde_test_key_SOURCES) \ $(bde_test_key_protector_SOURCES) $(bde_test_metadata_SOURCES) \ - $(bde_test_metadata_entry_SOURCES) $(bde_test_notify_SOURCES) \ - $(bde_test_password_keep_SOURCES) \ + $(bde_test_metadata_block_header_SOURCES) \ + $(bde_test_metadata_entry_SOURCES) \ + $(bde_test_metadata_header_SOURCES) $(bde_test_notify_SOURCES) \ + $(bde_test_password_SOURCES) $(bde_test_password_keep_SOURCES) \ $(bde_test_sector_data_SOURCES) \ + $(bde_test_sector_data_vector_SOURCES) \ $(bde_test_stretch_key_SOURCES) $(bde_test_support_SOURCES) \ - $(bde_test_volume_SOURCES) \ + $(bde_test_tools_info_handle_SOURCES) \ + $(bde_test_tools_output_SOURCES) \ + $(bde_test_tools_signal_SOURCES) $(bde_test_volume_SOURCES) \ + $(bde_test_volume_header_SOURCES) \ $(bde_test_volume_master_key_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__extra_recursive_targets = sources-recursive splint-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -285,8 +372,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -469,6 +554,7 @@ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -508,6 +594,12 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -519,8 +611,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ @@ -538,7 +632,6 @@ HAVE_LIBCSPLIT = @HAVE_LIBCSPLIT@ HAVE_LIBCTHREADS = @HAVE_LIBCTHREADS@ HAVE_LIBFCACHE = @HAVE_LIBFCACHE@ -HAVE_LIBFDATA = @HAVE_LIBFDATA@ HAVE_LIBFDATETIME = @HAVE_LIBFDATETIME@ HAVE_LIBFGUID = @HAVE_LIBFGUID@ HAVE_LIBFUSE = @HAVE_LIBFUSE@ @@ -556,7 +649,6 @@ HAVE_LOCAL_LIBCSPLIT = @HAVE_LOCAL_LIBCSPLIT@ HAVE_LOCAL_LIBCTHREADS = @HAVE_LOCAL_LIBCTHREADS@ HAVE_LOCAL_LIBFCACHE = @HAVE_LOCAL_LIBFCACHE@ -HAVE_LOCAL_LIBFDATA = @HAVE_LOCAL_LIBFDATA@ HAVE_LOCAL_LIBFDATETIME = @HAVE_LOCAL_LIBFDATETIME@ HAVE_LOCAL_LIBFGUID = @HAVE_LOCAL_LIBFGUID@ HAVE_LOCAL_LIBFVALUE = @HAVE_LOCAL_LIBFVALUE@ @@ -610,8 +702,6 @@ LIBDL_LIBADD = @LIBDL_LIBADD@ LIBFCACHE_CPPFLAGS = @LIBFCACHE_CPPFLAGS@ LIBFCACHE_LIBADD = @LIBFCACHE_LIBADD@ -LIBFDATA_CPPFLAGS = @LIBFDATA_CPPFLAGS@ -LIBFDATA_LIBADD = @LIBFDATA_LIBADD@ LIBFDATETIME_CPPFLAGS = @LIBFDATETIME_CPPFLAGS@ LIBFDATETIME_LIBADD = @LIBFDATETIME_LIBADD@ LIBFGUID_CPPFLAGS = @LIBFGUID_CPPFLAGS@ @@ -630,6 +720,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBUNA_CPPFLAGS = @LIBUNA_CPPFLAGS@ LIBUNA_LIBADD = @LIBUNA_LIBADD@ +LIB_FUZZING_ENGINE = @LIB_FUZZING_ENGINE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ @@ -640,8 +731,8 @@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -664,26 +755,6 @@ PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@ PTHREAD_LIBADD = @PTHREAD_LIBADD@ PYTHON = @PYTHON@ -PYTHON2 = @PYTHON2@ -PYTHON2_CONFIG = @PYTHON2_CONFIG@ -PYTHON2_CPPFLAGS = @PYTHON2_CPPFLAGS@ -PYTHON2_EXEC_PREFIX = @PYTHON2_EXEC_PREFIX@ -PYTHON2_LDFLAGS = @PYTHON2_LDFLAGS@ -PYTHON2_LIBRARY_DIR = @PYTHON2_LIBRARY_DIR@ -PYTHON2_PACKAGE_DIR = @PYTHON2_PACKAGE_DIR@ -PYTHON2_PLATFORM = @PYTHON2_PLATFORM@ -PYTHON2_PREFIX = @PYTHON2_PREFIX@ -PYTHON2_VERSION = @PYTHON2_VERSION@ -PYTHON3 = @PYTHON3@ -PYTHON3_CONFIG = @PYTHON3_CONFIG@ -PYTHON3_CPPFLAGS = @PYTHON3_CPPFLAGS@ -PYTHON3_EXEC_PREFIX = @PYTHON3_EXEC_PREFIX@ -PYTHON3_LDFLAGS = @PYTHON3_LDFLAGS@ -PYTHON3_LIBRARY_DIR = @PYTHON3_LIBRARY_DIR@ -PYTHON3_PACKAGE_DIR = @PYTHON3_PACKAGE_DIR@ -PYTHON3_PLATFORM = @PYTHON3_PLATFORM@ -PYTHON3_PREFIX = @PYTHON3_PREFIX@ -PYTHON3_VERSION = @PYTHON3_VERSION@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ @@ -692,7 +763,6 @@ PYTHON_PACKAGE_DIR = @PYTHON_PACKAGE_DIR@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -711,6 +781,7 @@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -753,9 +824,6 @@ ax_libfcache_pc_libs_private = @ax_libfcache_pc_libs_private@ ax_libfcache_spec_build_requires = @ax_libfcache_spec_build_requires@ ax_libfcache_spec_requires = @ax_libfcache_spec_requires@ -ax_libfdata_pc_libs_private = @ax_libfdata_pc_libs_private@ -ax_libfdata_spec_build_requires = @ax_libfdata_spec_build_requires@ -ax_libfdata_spec_requires = @ax_libfdata_spec_requires@ ax_libfdatetime_pc_libs_private = @ax_libfdatetime_pc_libs_private@ ax_libfdatetime_spec_build_requires = @ax_libfdatetime_spec_build_requires@ ax_libfdatetime_spec_requires = @ax_libfdatetime_spec_requires@ @@ -824,8 +892,6 @@ libexecdir = @libexecdir@ libfcache_CFLAGS = @libfcache_CFLAGS@ libfcache_LIBS = @libfcache_LIBS@ -libfdata_CFLAGS = @libfdata_CFLAGS@ -libfdata_LIBS = @libfdata_LIBS@ libfdatetime_CFLAGS = @libfdatetime_CFLAGS@ libfdatetime_LIBS = @libfdatetime_LIBS@ libfguid_CFLAGS = @libfguid_CFLAGS@ @@ -848,11 +914,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ -pyexecdir2 = @pyexecdir2@ -pyexecdir3 = @pyexecdir3@ pythondir = @pythondir@ -pythondir2 = @pythondir2@ -pythondir3 = @pythondir3@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -861,6 +924,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ @@ -875,7 +939,6 @@ @LIBCPATH_CPPFLAGS@ \ @LIBBFIO_CPPFLAGS@ \ @LIBFCACHE_CPPFLAGS@ \ - @LIBFDATA_CPPFLAGS@ \ @LIBFDATETIME_CPPFLAGS@ \ @LIBFGUID_CPPFLAGS@ \ @LIBFVALUE_CPPFLAGS@ \ @@ -889,6 +952,7 @@ TESTS = \ test_library.sh \ + test_tools.sh \ test_bdeinfo.sh \ $(TESTS_PYBDE) @@ -897,8 +961,10 @@ pybde_test_volume.py \ test_bdeinfo.sh \ test_library.sh \ + test_manpage.sh \ test_python_module.sh \ - test_runner.sh + test_runner.sh \ + test_tools.sh EXTRA_DIST = \ $(check_SCRIPTS) @@ -915,6 +981,18 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_encryption_context_SOURCES = \ + bde_test_encryption_context.c \ + bde_test_libbde.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_unused.h + +bde_test_encryption_context_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_error_SOURCES = \ bde_test_error.c \ bde_test_libbde.h \ @@ -984,6 +1062,28 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_metadata_block_header_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbde.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_metadata_block_header.c \ + bde_test_unused.h + +bde_test_metadata_block_header_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_metadata_entry_SOURCES = \ bde_test_libbde.h \ bde_test_libcerror.h \ @@ -996,6 +1096,28 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_metadata_header_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbde.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_metadata_header.c \ + bde_test_unused.h + +bde_test_metadata_header_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_notify_SOURCES = \ bde_test_libbde.h \ bde_test_libcnotify.h \ @@ -1007,6 +1129,17 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_password_SOURCES = \ + bde_test_libbde.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_password.c \ + bde_test_unused.h + +bde_test_password_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_password_keep_SOURCES = \ bde_test_libbde.h \ bde_test_libcerror.h \ @@ -1020,7 +1153,9 @@ @LIBCERROR_LIBADD@ bde_test_sector_data_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ bde_test_libbde.h \ + bde_test_libbfio.h \ bde_test_libcerror.h \ bde_test_macros.h \ bde_test_memory.c bde_test_memory.h \ @@ -1028,6 +1163,36 @@ bde_test_unused.h bde_test_sector_data_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + +bde_test_sector_data_vector_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbde.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_sector_data_vector.c \ + bde_test_unused.h + +bde_test_sector_data_vector_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ @@ -1069,6 +1234,52 @@ ../libbde/libbde.la \ @LIBCERROR_LIBADD@ +bde_test_tools_info_handle_SOURCES = \ + ../bdetools/bdetools_input.c ../bdetools/bdetools_input.h \ + ../bdetools/byte_size_string.c ../bdetools/byte_size_string.h \ + ../bdetools/info_handle.c ../bdetools/info_handle.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_tools_info_handle.c \ + bde_test_unused.h + +bde_test_tools_info_handle_LDADD = \ + @LIBFGUID_LIBADD@ \ + @LIBFDATETIME_LIBADD@ \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + +bde_test_tools_output_SOURCES = \ + ../bdetools/bdetools_output.c ../bdetools/bdetools_output.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_tools_output.c \ + bde_test_unused.h + +bde_test_tools_output_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + +bde_test_tools_signal_SOURCES = \ + ../bdetools/bdetools_signal.c ../bdetools/bdetools_signal.h \ + bde_test_libcerror.h \ + bde_test_macros.h \ + bde_test_tools_signal.c \ + bde_test_unused.h + +bde_test_tools_signal_LDADD = \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_volume_SOURCES = \ bde_test_functions.c bde_test_functions.h \ bde_test_getopt.c bde_test_getopt.h \ @@ -1097,6 +1308,28 @@ @LIBCERROR_LIBADD@ \ @PTHREAD_LIBADD@ +bde_test_volume_header_SOURCES = \ + bde_test_functions.c bde_test_functions.h \ + bde_test_libbfio.h \ + bde_test_libcerror.h \ + bde_test_libbde.h \ + bde_test_macros.h \ + bde_test_memory.c bde_test_memory.h \ + bde_test_unused.h \ + bde_test_volume_header.c + +bde_test_volume_header_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ + @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ + @LIBCNOTIFY_LIBADD@ \ + @LIBCLOCALE_LIBADD@ \ + @LIBCDATA_LIBADD@ \ + ../libbde/libbde.la \ + @LIBCERROR_LIBADD@ + bde_test_volume_master_key_SOURCES = \ bde_test_libbde.h \ bde_test_libcerror.h \ @@ -1159,6 +1392,10 @@ @rm -f bde_test_aes_ccm_encrypted_key$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_aes_ccm_encrypted_key_OBJECTS) $(bde_test_aes_ccm_encrypted_key_LDADD) $(LIBS) +bde_test_encryption_context$(EXEEXT): $(bde_test_encryption_context_OBJECTS) $(bde_test_encryption_context_DEPENDENCIES) $(EXTRA_bde_test_encryption_context_DEPENDENCIES) + @rm -f bde_test_encryption_context$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_encryption_context_OBJECTS) $(bde_test_encryption_context_LDADD) $(LIBS) + bde_test_error$(EXEEXT): $(bde_test_error_OBJECTS) $(bde_test_error_DEPENDENCIES) $(EXTRA_bde_test_error_DEPENDENCIES) @rm -f bde_test_error$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_error_OBJECTS) $(bde_test_error_LDADD) $(LIBS) @@ -1183,14 +1420,26 @@ @rm -f bde_test_metadata$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_metadata_OBJECTS) $(bde_test_metadata_LDADD) $(LIBS) +bde_test_metadata_block_header$(EXEEXT): $(bde_test_metadata_block_header_OBJECTS) $(bde_test_metadata_block_header_DEPENDENCIES) $(EXTRA_bde_test_metadata_block_header_DEPENDENCIES) + @rm -f bde_test_metadata_block_header$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_metadata_block_header_OBJECTS) $(bde_test_metadata_block_header_LDADD) $(LIBS) + bde_test_metadata_entry$(EXEEXT): $(bde_test_metadata_entry_OBJECTS) $(bde_test_metadata_entry_DEPENDENCIES) $(EXTRA_bde_test_metadata_entry_DEPENDENCIES) @rm -f bde_test_metadata_entry$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_metadata_entry_OBJECTS) $(bde_test_metadata_entry_LDADD) $(LIBS) +bde_test_metadata_header$(EXEEXT): $(bde_test_metadata_header_OBJECTS) $(bde_test_metadata_header_DEPENDENCIES) $(EXTRA_bde_test_metadata_header_DEPENDENCIES) + @rm -f bde_test_metadata_header$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_metadata_header_OBJECTS) $(bde_test_metadata_header_LDADD) $(LIBS) + bde_test_notify$(EXEEXT): $(bde_test_notify_OBJECTS) $(bde_test_notify_DEPENDENCIES) $(EXTRA_bde_test_notify_DEPENDENCIES) @rm -f bde_test_notify$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_notify_OBJECTS) $(bde_test_notify_LDADD) $(LIBS) +bde_test_password$(EXEEXT): $(bde_test_password_OBJECTS) $(bde_test_password_DEPENDENCIES) $(EXTRA_bde_test_password_DEPENDENCIES) + @rm -f bde_test_password$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_password_OBJECTS) $(bde_test_password_LDADD) $(LIBS) + bde_test_password_keep$(EXEEXT): $(bde_test_password_keep_OBJECTS) $(bde_test_password_keep_DEPENDENCIES) $(EXTRA_bde_test_password_keep_DEPENDENCIES) @rm -f bde_test_password_keep$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_password_keep_OBJECTS) $(bde_test_password_keep_LDADD) $(LIBS) @@ -1199,6 +1448,10 @@ @rm -f bde_test_sector_data$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_sector_data_OBJECTS) $(bde_test_sector_data_LDADD) $(LIBS) +bde_test_sector_data_vector$(EXEEXT): $(bde_test_sector_data_vector_OBJECTS) $(bde_test_sector_data_vector_DEPENDENCIES) $(EXTRA_bde_test_sector_data_vector_DEPENDENCIES) + @rm -f bde_test_sector_data_vector$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_sector_data_vector_OBJECTS) $(bde_test_sector_data_vector_LDADD) $(LIBS) + bde_test_stretch_key$(EXEEXT): $(bde_test_stretch_key_OBJECTS) $(bde_test_stretch_key_DEPENDENCIES) $(EXTRA_bde_test_stretch_key_DEPENDENCIES) @rm -f bde_test_stretch_key$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_stretch_key_OBJECTS) $(bde_test_stretch_key_LDADD) $(LIBS) @@ -1206,22 +1459,61 @@ bde_test_support$(EXEEXT): $(bde_test_support_OBJECTS) $(bde_test_support_DEPENDENCIES) $(EXTRA_bde_test_support_DEPENDENCIES) @rm -f bde_test_support$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_support_OBJECTS) $(bde_test_support_LDADD) $(LIBS) +../bdetools/$(am__dirstamp): + @$(MKDIR_P) ../bdetools + @: > ../bdetools/$(am__dirstamp) +../bdetools/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ../bdetools/$(DEPDIR) + @: > ../bdetools/$(DEPDIR)/$(am__dirstamp) +../bdetools/bdetools_input.$(OBJEXT): ../bdetools/$(am__dirstamp) \ + ../bdetools/$(DEPDIR)/$(am__dirstamp) +../bdetools/byte_size_string.$(OBJEXT): ../bdetools/$(am__dirstamp) \ + ../bdetools/$(DEPDIR)/$(am__dirstamp) +../bdetools/info_handle.$(OBJEXT): ../bdetools/$(am__dirstamp) \ + ../bdetools/$(DEPDIR)/$(am__dirstamp) + +bde_test_tools_info_handle$(EXEEXT): $(bde_test_tools_info_handle_OBJECTS) $(bde_test_tools_info_handle_DEPENDENCIES) $(EXTRA_bde_test_tools_info_handle_DEPENDENCIES) + @rm -f bde_test_tools_info_handle$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_tools_info_handle_OBJECTS) $(bde_test_tools_info_handle_LDADD) $(LIBS) +../bdetools/bdetools_output.$(OBJEXT): ../bdetools/$(am__dirstamp) \ + ../bdetools/$(DEPDIR)/$(am__dirstamp) + +bde_test_tools_output$(EXEEXT): $(bde_test_tools_output_OBJECTS) $(bde_test_tools_output_DEPENDENCIES) $(EXTRA_bde_test_tools_output_DEPENDENCIES) + @rm -f bde_test_tools_output$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_tools_output_OBJECTS) $(bde_test_tools_output_LDADD) $(LIBS) +../bdetools/bdetools_signal.$(OBJEXT): ../bdetools/$(am__dirstamp) \ + ../bdetools/$(DEPDIR)/$(am__dirstamp) + +bde_test_tools_signal$(EXEEXT): $(bde_test_tools_signal_OBJECTS) $(bde_test_tools_signal_DEPENDENCIES) $(EXTRA_bde_test_tools_signal_DEPENDENCIES) + @rm -f bde_test_tools_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_tools_signal_OBJECTS) $(bde_test_tools_signal_LDADD) $(LIBS) bde_test_volume$(EXEEXT): $(bde_test_volume_OBJECTS) $(bde_test_volume_DEPENDENCIES) $(EXTRA_bde_test_volume_DEPENDENCIES) @rm -f bde_test_volume$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_volume_OBJECTS) $(bde_test_volume_LDADD) $(LIBS) +bde_test_volume_header$(EXEEXT): $(bde_test_volume_header_OBJECTS) $(bde_test_volume_header_DEPENDENCIES) $(EXTRA_bde_test_volume_header_DEPENDENCIES) + @rm -f bde_test_volume_header$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bde_test_volume_header_OBJECTS) $(bde_test_volume_header_LDADD) $(LIBS) + bde_test_volume_master_key$(EXEEXT): $(bde_test_volume_master_key_OBJECTS) $(bde_test_volume_master_key_DEPENDENCIES) $(EXTRA_bde_test_volume_master_key_DEPENDENCIES) @rm -f bde_test_volume_master_key$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bde_test_volume_master_key_OBJECTS) $(bde_test_volume_master_key_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) + -rm -f ../bdetools/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@../bdetools/$(DEPDIR)/bdetools_input.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@../bdetools/$(DEPDIR)/bdetools_output.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@../bdetools/$(DEPDIR)/bdetools_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@../bdetools/$(DEPDIR)/byte_size_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@../bdetools/$(DEPDIR)/info_handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_aes_ccm_encrypted_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_encryption_context.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_external_key.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_functions.Po@am__quote@ # am--include-marker @@ -1231,13 +1523,21 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_key_protector.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_memory.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_metadata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_metadata_block_header.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_metadata_entry.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_metadata_header.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_notify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_password.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_password_keep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_sector_data.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_sector_data_vector.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_stretch_key.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_support.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_tools_info_handle.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_tools_output.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_tools_signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_volume.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_volume_header.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bde_test_volume_master_key.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @@ -1247,22 +1547,25 @@ am--depfiles: $(am__depfiles_remade) .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @@ -1272,6 +1575,8 @@ clean-libtool: -rm -rf .libs _libs +sources-local: +splint-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -1432,7 +1737,7 @@ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -1473,6 +1778,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test_tools.sh.log: test_tools.sh + @p='test_tools.sh'; \ + b='test_tools.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test_bdeinfo.sh.log: test_bdeinfo.sh @p='test_bdeinfo.sh'; \ b='test_bdeinfo.sh'; \ @@ -1501,7 +1813,6 @@ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -1570,6 +1881,8 @@ distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f ../bdetools/$(DEPDIR)/$(am__dirstamp) + -rm -f ../bdetools/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -1624,7 +1937,13 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/bde_test_aes_ccm_encrypted_key.Po + -rm -f ../bdetools/$(DEPDIR)/bdetools_input.Po + -rm -f ../bdetools/$(DEPDIR)/bdetools_output.Po + -rm -f ../bdetools/$(DEPDIR)/bdetools_signal.Po + -rm -f ../bdetools/$(DEPDIR)/byte_size_string.Po + -rm -f ../bdetools/$(DEPDIR)/info_handle.Po + -rm -f ./$(DEPDIR)/bde_test_aes_ccm_encrypted_key.Po + -rm -f ./$(DEPDIR)/bde_test_encryption_context.Po -rm -f ./$(DEPDIR)/bde_test_error.Po -rm -f ./$(DEPDIR)/bde_test_external_key.Po -rm -f ./$(DEPDIR)/bde_test_functions.Po @@ -1634,13 +1953,21 @@ -rm -f ./$(DEPDIR)/bde_test_key_protector.Po -rm -f ./$(DEPDIR)/bde_test_memory.Po -rm -f ./$(DEPDIR)/bde_test_metadata.Po + -rm -f ./$(DEPDIR)/bde_test_metadata_block_header.Po -rm -f ./$(DEPDIR)/bde_test_metadata_entry.Po + -rm -f ./$(DEPDIR)/bde_test_metadata_header.Po -rm -f ./$(DEPDIR)/bde_test_notify.Po + -rm -f ./$(DEPDIR)/bde_test_password.Po -rm -f ./$(DEPDIR)/bde_test_password_keep.Po -rm -f ./$(DEPDIR)/bde_test_sector_data.Po + -rm -f ./$(DEPDIR)/bde_test_sector_data_vector.Po -rm -f ./$(DEPDIR)/bde_test_stretch_key.Po -rm -f ./$(DEPDIR)/bde_test_support.Po + -rm -f ./$(DEPDIR)/bde_test_tools_info_handle.Po + -rm -f ./$(DEPDIR)/bde_test_tools_output.Po + -rm -f ./$(DEPDIR)/bde_test_tools_signal.Po -rm -f ./$(DEPDIR)/bde_test_volume.Po + -rm -f ./$(DEPDIR)/bde_test_volume_header.Po -rm -f ./$(DEPDIR)/bde_test_volume_master_key.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -1658,6 +1985,14 @@ ps-am: +sources: sources-am + +sources-am: sources-local + +splint: splint-am + +splint-am: splint-local + uninstall-am: .MAKE: check-am install-am install-strip @@ -1674,13 +2009,14 @@ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am + recheck sources-am sources-local splint-am splint-local tags \ + tags-am uninstall uninstall-am .PRECIOUS: Makefile distclean: clean - /bin/rm -f Makefile + -rm -f Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru libbde-20190102/tests/bde_test_aes_ccm_encrypted_key.c libbde-20240223/tests/bde_test_aes_ccm_encrypted_key.c --- libbde-20190102/tests/bde_test_aes_ccm_encrypted_key.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_aes_ccm_encrypted_key.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library aes_ccm_encrypted_key type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &aes_ccm_encrypted_key, &error ); + aes_ccm_encrypted_key = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - aes_ccm_encrypted_key = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/bde_test_encryption_context.c libbde-20240223/tests/bde_test_encryption_context.c --- libbde-20190102/tests/bde_test_encryption_context.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_encryption_context.c 2024-02-23 02:48:06.000000000 +0000 @@ -0,0 +1,321 @@ +/* + * Library encryption_context type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_libbde.h" +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_memory.h" +#include "bde_test_unused.h" + +#include "../libbde/libbde_definitions.h" +#include "../libbde/libbde_encryption_context.h" + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_encryption_context_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_encryption_context_initialize( + void ) +{ + libbde_encryption_context_t *encryption_context = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libbde_encryption_context_initialize( + &encryption_context, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "encryption_context", + encryption_context ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_encryption_context_free( + &encryption_context, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "encryption_context", + encryption_context ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_encryption_context_initialize( + NULL, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + encryption_context = (libbde_encryption_context_t *) 0x12345678UL; + + result = libbde_encryption_context_initialize( + &encryption_context, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER, + &error ); + + encryption_context = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libbde_encryption_context_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = libbde_encryption_context_initialize( + &encryption_context, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( encryption_context != NULL ) + { + libbde_encryption_context_free( + &encryption_context, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "encryption_context", + encryption_context ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libbde_encryption_context_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = libbde_encryption_context_initialize( + &encryption_context, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC_DIFFUSER, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( encryption_context != NULL ) + { + libbde_encryption_context_free( + &encryption_context, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "encryption_context", + encryption_context ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( encryption_context != NULL ) + { + libbde_encryption_context_free( + &encryption_context, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_encryption_context_free function + * Returns 1 if successful or 0 if not + */ +int bde_test_encryption_context_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = libbde_encryption_context_free( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN( + "libbde_encryption_context_initialize", + bde_test_encryption_context_initialize ); + + BDE_TEST_RUN( + "libbde_encryption_context_free", + bde_test_encryption_context_free ); + + /* TODO: add tests for libbde_encryption_set_keys */ + + /* TODO: add tests for libbde_encryption_crypt */ + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +on_error: + return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ +} + diff -Nru libbde-20190102/tests/bde_test_error.c libbde-20240223/tests/bde_test_error.c --- libbde-20190102/tests/bde_test_error.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_error.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library error functions test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -28,7 +28,6 @@ #endif #include "bde_test_libbde.h" -#include "bde_test_libcerror.h" #include "bde_test_macros.h" #include "bde_test_unused.h" diff -Nru libbde-20190102/tests/bde_test_external_key.c libbde-20240223/tests/bde_test_external_key.c --- libbde-20190102/tests/bde_test_external_key.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_external_key.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library external_key type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &external_key, &error ); + external_key = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - external_key = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/bde_test_functions.c libbde-20240223/tests/bde_test_functions.c --- libbde-20190102/tests/bde_test_functions.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_functions.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Functions for testing * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/tests/bde_test_functions.h libbde-20240223/tests/bde_test_functions.h --- libbde-20190102/tests/bde_test_functions.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_functions.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Functions for testing * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_FUNCTIONS_H ) diff -Nru libbde-20190102/tests/bde_test_getopt.c libbde-20240223/tests/bde_test_getopt.c --- libbde-20190102/tests/bde_test_getopt.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_getopt.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * GetOpt functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/tests/bde_test_getopt.h libbde-20240223/tests/bde_test_getopt.h --- libbde-20190102/tests/bde_test_getopt.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_getopt.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * GetOpt functions * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_GETOPT_H ) diff -Nru libbde-20190102/tests/bde_test_io_handle.c libbde-20240223/tests/bde_test_io_handle.c --- libbde-20190102/tests/bde_test_io_handle.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_io_handle.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library io_handle type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &io_handle, &error ); + io_handle = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - io_handle = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; @@ -332,6 +332,36 @@ libcerror_error_free( &error ); +#if defined( HAVE_BDE_TEST_MEMORY ) + + /* Test libbde_io_handle_clear with memset failing + */ + bde_test_memset_attempts_before_fail = 0; + + result = libbde_io_handle_clear( + io_handle, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + /* Clean up */ result = libbde_io_handle_free( diff -Nru libbde-20190102/tests/bde_test_key.c libbde-20240223/tests/bde_test_key.c --- libbde-20190102/tests/bde_test_key.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_key.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library key type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &key, &error ); + key = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - key = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; @@ -303,7 +303,11 @@ return( EXIT_SUCCESS ); +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + on_error: return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ } diff -Nru libbde-20190102/tests/bde_test_key_protector.c libbde-20240223/tests/bde_test_key_protector.c --- libbde-20190102/tests/bde_test_key_protector.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_key_protector.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library key_protector type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/tests/bde_test_libbde.h libbde-20240223/tests/bde_test_libbde.h --- libbde-20190102/tests/bde_test_libbde.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_libbde.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libbde header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_LIBBDE_H ) diff -Nru libbde-20190102/tests/bde_test_libbfio.h libbde-20240223/tests/bde_test_libbfio.h --- libbde-20190102/tests/bde_test_libbfio.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_libbfio.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_LIBBFIO_H ) diff -Nru libbde-20190102/tests/bde_test_libcerror.h libbde-20240223/tests/bde_test_libcerror.h --- libbde-20190102/tests/bde_test_libcerror.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_libcerror.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcerror header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_LIBCERROR_H ) diff -Nru libbde-20190102/tests/bde_test_libclocale.h libbde-20240223/tests/bde_test_libclocale.h --- libbde-20190102/tests/bde_test_libclocale.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_libclocale.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libclocale header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_LIBCLOCALE_H ) diff -Nru libbde-20190102/tests/bde_test_libcnotify.h libbde-20240223/tests/bde_test_libcnotify.h --- libbde-20190102/tests/bde_test_libcnotify.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_libcnotify.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libcnotify header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_LIBCNOTIFY_H ) diff -Nru libbde-20190102/tests/bde_test_libuna.h libbde-20240223/tests/bde_test_libuna.h --- libbde-20190102/tests/bde_test_libuna.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_libuna.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * The libuna header wrapper * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_LIBUNA_H ) diff -Nru libbde-20190102/tests/bde_test_macros.h libbde-20240223/tests/bde_test_macros.h --- libbde-20190102/tests/bde_test_macros.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_macros.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Macros for testing * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_MACROS_H ) @@ -99,6 +99,13 @@ goto on_error; \ } +#define BDE_TEST_ASSERT_NOT_EQUAL_SSIZE( name, value, expected_value ) \ + if( value == expected_value ) \ + { \ + fprintf( stdout, "%s:%d %s (%" PRIzd ") == %" PRIzd "\n", __FILE__, __LINE__, name, value, expected_value ); \ + goto on_error; \ + } + #define BDE_TEST_ASSERT_EQUAL_INT8( name, value, expected_value ) \ if( value != expected_value ) \ { \ @@ -172,14 +179,14 @@ #define BDE_TEST_ASSERT_EQUAL_UINT32( name, value, expected_value ) \ if( value != expected_value ) \ { \ - fprintf( stdout, "%s:%d %s (%" PRIi32 ") != %" PRIu32 "\n", __FILE__, __LINE__, name, value, expected_value ); \ + fprintf( stdout, "%s:%d %s (%" PRIu32 ") != %" PRIu32 "\n", __FILE__, __LINE__, name, value, expected_value ); \ goto on_error; \ } #define BDE_TEST_ASSERT_LESS_THAN_UINT32( name, value, expected_value ) \ if( value >= expected_value ) \ { \ - fprintf( stdout, "%s:%d %s (%" PRIi32 ") >= %" PRIu32 "\n", __FILE__, __LINE__, name, value, expected_value ); \ + fprintf( stdout, "%s:%d %s (%" PRIu32 ") >= %" PRIu32 "\n", __FILE__, __LINE__, name, value, expected_value ); \ goto on_error; \ } diff -Nru libbde-20190102/tests/bde_test_memory.c libbde-20240223/tests/bde_test_memory.c --- libbde-20190102/tests/bde_test_memory.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_memory.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory allocation functions for testing * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -35,15 +35,15 @@ #if defined( HAVE_BDE_TEST_MEMORY ) -static void *(*bde_test_real_malloc)(size_t) = NULL; -static void *(*bde_test_real_memcpy)(void *, void *, size_t) = NULL; -static void *(*bde_test_real_memset)(void *, int, size_t) = NULL; -static void *(*bde_test_real_realloc)(void *, size_t) = NULL; - -int bde_test_malloc_attempts_before_fail = -1; -int bde_test_memcpy_attempts_before_fail = -1; -int bde_test_memset_attempts_before_fail = -1; -int bde_test_realloc_attempts_before_fail = -1; +static void *(*bde_test_real_malloc)(size_t) = NULL; +static void *(*bde_test_real_memcpy)(void *, const void *, size_t) = NULL; +static void *(*bde_test_real_memset)(void *, int, size_t) = NULL; +static void *(*bde_test_real_realloc)(void *, size_t) = NULL; + +int bde_test_malloc_attempts_before_fail = -1; +int bde_test_memcpy_attempts_before_fail = -1; +int bde_test_memset_attempts_before_fail = -1; +int bde_test_realloc_attempts_before_fail = -1; /* Custom malloc for testing memory error cases * Note this function might fail if compiled with optimation @@ -82,7 +82,7 @@ */ void *memcpy( void *destination, - void *source, + const void *source, size_t size ) { if( bde_test_real_memcpy == NULL ) diff -Nru libbde-20190102/tests/bde_test_memory.h libbde-20240223/tests/bde_test_memory.h --- libbde-20190102/tests/bde_test_memory.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_memory.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Memory allocation functions for testing * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_MEMORY_H ) @@ -28,7 +28,7 @@ extern "C" { #endif -#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && !defined( __sparc__ ) && !defined( HAVE_ASAN ) +#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __loongarch__ ) && !defined( __mips__ ) && !defined( __riscv ) && !defined( __sparc__ ) && !defined( HAVE_ASAN ) #define HAVE_BDE_TEST_MEMORY 1 #endif diff -Nru libbde-20190102/tests/bde_test_metadata.c libbde-20240223/tests/bde_test_metadata.c --- libbde-20190102/tests/bde_test_metadata.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_metadata.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library metadata type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &metadata, &error ); + metadata = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - metadata = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/bde_test_metadata_block_header.c libbde-20240223/tests/bde_test_metadata_block_header.c --- libbde-20190102/tests/bde_test_metadata_block_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_metadata_block_header.c 2024-02-23 02:48:06.000000000 +0000 @@ -0,0 +1,819 @@ +/* + * Library metadata_block_header type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_functions.h" +#include "bde_test_libbde.h" +#include "bde_test_libbfio.h" +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_memory.h" +#include "bde_test_unused.h" + +#include "../libbde/libbde_metadata_block_header.h" + +uint8_t bde_test_metadata_block_header_data1[ 64 ] = { + 0x2d, 0x46, 0x56, 0x45, 0x2d, 0x46, 0x53, 0x2d, 0x2f, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x00, 0x00, 0xa0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x28, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xd5, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xa8, 0x5a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x2b, 0x0d, 0x00, 0x00, 0x00, 0x00 }; + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_metadata_block_header_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_block_header_initialize( + void ) +{ + libbde_metadata_block_header_t *metadata_block_header = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libbde_metadata_block_header_initialize( + &metadata_block_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_metadata_block_header_free( + &metadata_block_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_metadata_block_header_initialize( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + metadata_block_header = (libbde_metadata_block_header_t *) 0x12345678UL; + + result = libbde_metadata_block_header_initialize( + &metadata_block_header, + &error ); + + metadata_block_header = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libbde_metadata_block_header_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = libbde_metadata_block_header_initialize( + &metadata_block_header, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( metadata_block_header != NULL ) + { + libbde_metadata_block_header_free( + &metadata_block_header, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libbde_metadata_block_header_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = libbde_metadata_block_header_initialize( + &metadata_block_header, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( metadata_block_header != NULL ) + { + libbde_metadata_block_header_free( + &metadata_block_header, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( metadata_block_header != NULL ) + { + libbde_metadata_block_header_free( + &metadata_block_header, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_metadata_block_header_free function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_block_header_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = libbde_metadata_block_header_free( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* Tests the libbde_metadata_block_header_read_file_io_handle function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_block_header_read_file_io_handle( + void ) +{ + libbde_metadata_block_header_t *metadata_block_header = NULL; + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_metadata_block_header_initialize( + &metadata_block_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Initialize file IO handle + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_metadata_block_header_data1, + 64, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_metadata_block_header_read_file_io_handle( + metadata_block_header, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_metadata_block_header_read_file_io_handle( + NULL, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_block_header_read_file_io_handle( + metadata_block_header, + NULL, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up file IO handle + */ + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test data too small + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_metadata_block_header_data1, + 8, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_metadata_block_header_read_file_io_handle( + metadata_block_header, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test invalid format version + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_metadata_block_header_data1, + 64, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + byte_stream_copy_from_uint16_little_endian( + &( bde_test_metadata_block_header_data1[ 10 ] ), + 0xffff ); + + result = libbde_metadata_block_header_read_file_io_handle( + metadata_block_header, + file_io_handle, + 0, + &error ); + + byte_stream_copy_from_uint16_little_endian( + &( bde_test_metadata_block_header_data1[ 10 ] ), + 0x0002 ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Clean up + */ + result = libbde_metadata_block_header_free( + &metadata_block_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } + if( metadata_block_header != NULL ) + { + libbde_metadata_block_header_free( + &metadata_block_header, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_metadata_block_header_read_data function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_block_header_read_data( + void ) +{ + libbde_metadata_block_header_t *metadata_block_header = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_metadata_block_header_initialize( + &metadata_block_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_metadata_block_header_read_data( + metadata_block_header, + bde_test_metadata_block_header_data1, + 64, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_metadata_block_header_read_data( + NULL, + bde_test_metadata_block_header_data1, + 64, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_block_header_read_data( + metadata_block_header, + NULL, + 64, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_block_header_read_data( + metadata_block_header, + bde_test_metadata_block_header_data1, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_block_header_read_data( + metadata_block_header, + bde_test_metadata_block_header_data1, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + /* Test bde_test_metadata_block_header_read_data with memcpy failing + */ + bde_test_memcpy_attempts_before_fail = 0; + + result = libbde_metadata_block_header_read_data( + metadata_block_header, + bde_test_metadata_block_header_data1, + 64, + &error ); + + if( bde_test_memcpy_attempts_before_fail != -1 ) + { + bde_test_memcpy_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + /* Test invalid format version + */ + byte_stream_copy_from_uint16_little_endian( + &( bde_test_metadata_block_header_data1[ 10 ] ), + 0xffff ); + + result = libbde_metadata_block_header_read_data( + metadata_block_header, + bde_test_metadata_block_header_data1, + 64, + &error ); + + byte_stream_copy_from_uint16_little_endian( + &( bde_test_metadata_block_header_data1[ 10 ] ), + 0x0002 ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up + */ + result = libbde_metadata_block_header_free( + &metadata_block_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_block_header", + metadata_block_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( metadata_block_header != NULL ) + { + libbde_metadata_block_header_free( + &metadata_block_header, + NULL ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN( + "libbde_metadata_block_header_initialize", + bde_test_metadata_block_header_initialize ); + + BDE_TEST_RUN( + "libbde_metadata_block_header_free", + bde_test_metadata_block_header_free ); + + BDE_TEST_RUN( + "libbde_metadata_block_header_read_file_io_handle", + bde_test_metadata_block_header_read_file_io_handle ); + + BDE_TEST_RUN( + "libbde_metadata_block_header_read_data", + bde_test_metadata_block_header_read_data ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +on_error: + return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ +} + diff -Nru libbde-20190102/tests/bde_test_metadata_entry.c libbde-20240223/tests/bde_test_metadata_entry.c --- libbde-20190102/tests/bde_test_metadata_entry.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_metadata_entry.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library metadata_entry type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &metadata_entry, &error ); + metadata_entry = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - metadata_entry = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/bde_test_metadata_header.c libbde-20240223/tests/bde_test_metadata_header.c --- libbde-20190102/tests/bde_test_metadata_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_metadata_header.c 2024-02-23 02:48:06.000000000 +0000 @@ -0,0 +1,873 @@ +/* + * Library metadata_header type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_functions.h" +#include "bde_test_libbde.h" +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_memory.h" +#include "bde_test_unused.h" + +#include "../libbde/libbde_metadata_header.h" + +uint8_t bde_test_metadata_header_data1[ 48 ] = { + 0xa8, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xa8, 0x02, 0x00, 0x00, + 0x03, 0x0d, 0x59, 0x3a, 0x5e, 0x5c, 0xe1, 0x4b, 0x90, 0xb0, 0x37, 0xaf, 0x00, 0x83, 0x2e, 0xcf, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xd7, 0x98, 0xc0, 0x54, 0x5b, 0x53, 0xcc, 0x01 }; + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_metadata_header_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_header_initialize( + void ) +{ + libbde_metadata_header_t *metadata_header = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libbde_metadata_header_initialize( + &metadata_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_metadata_header_free( + &metadata_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_metadata_header_initialize( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + metadata_header = (libbde_metadata_header_t *) 0x12345678UL; + + result = libbde_metadata_header_initialize( + &metadata_header, + &error ); + + metadata_header = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libbde_metadata_header_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = libbde_metadata_header_initialize( + &metadata_header, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( metadata_header != NULL ) + { + libbde_metadata_header_free( + &metadata_header, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libbde_metadata_header_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = libbde_metadata_header_initialize( + &metadata_header, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( metadata_header != NULL ) + { + libbde_metadata_header_free( + &metadata_header, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( metadata_header != NULL ) + { + libbde_metadata_header_free( + &metadata_header, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_metadata_header_free function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_header_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = libbde_metadata_header_free( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* Tests the libbde_metadata_header_read_file_io_handle function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_header_read_file_io_handle( + void ) +{ + libbde_metadata_header_t *metadata_header = NULL; + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_metadata_header_initialize( + &metadata_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Initialize file IO handle + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_metadata_header_data1, + 48, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_metadata_header_read_file_io_handle( + metadata_header, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_metadata_header_read_file_io_handle( + NULL, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_header_read_file_io_handle( + metadata_header, + NULL, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up file IO handle + */ + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test data too small + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_metadata_header_data1, + 8, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_metadata_header_read_file_io_handle( + metadata_header, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test invalid format version + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_metadata_header_data1, + 48, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 4 ] ), + 0xffffffffUL ); + + result = libbde_metadata_header_read_file_io_handle( + metadata_header, + file_io_handle, + 0, + &error ); + + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 4 ] ), + 0x00000001UL ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Clean up + */ + result = libbde_metadata_header_free( + &metadata_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } + if( metadata_header != NULL ) + { + libbde_metadata_header_free( + &metadata_header, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_metadata_header_read_data function + * Returns 1 if successful or 0 if not + */ +int bde_test_metadata_header_read_data( + void ) +{ + libbde_metadata_header_t *metadata_header = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_metadata_header_initialize( + &metadata_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + 48, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_metadata_header_read_data( + NULL, + bde_test_metadata_header_data1, + 48, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_header_read_data( + metadata_header, + NULL, + 48, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + /* Test bde_test_metadata_header_read_data with memcpy failing + */ + bde_test_memcpy_attempts_before_fail = 0; + + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + 48, + &error ); + + if( bde_test_memcpy_attempts_before_fail != -1 ) + { + bde_test_memcpy_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + /* Test invalid format version + */ + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 4 ] ), + 0xffffffffUL ); + + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + 48, + &error ); + + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 4 ] ), + 0x00000001UL ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Test invalid header size + */ + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 8 ] ), + 0xffffffffUL ); + + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + 48, + &error ); + + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 8 ] ), + 0x00000030UL ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Test metadata size and copy mismatch + */ + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 12 ] ), + 0xffffffffUL ); + + result = libbde_metadata_header_read_data( + metadata_header, + bde_test_metadata_header_data1, + 48, + &error ); + + byte_stream_copy_from_uint32_little_endian( + &( bde_test_metadata_header_data1[ 12 ] ), + 0x000002a8UL ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up + */ + result = libbde_metadata_header_free( + &metadata_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "metadata_header", + metadata_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( metadata_header != NULL ) + { + libbde_metadata_header_free( + &metadata_header, + NULL ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN( + "libbde_metadata_header_initialize", + bde_test_metadata_header_initialize ); + + BDE_TEST_RUN( + "libbde_metadata_header_free", + bde_test_metadata_header_free ); + + BDE_TEST_RUN( + "libbde_metadata_header_read_file_io_handle", + bde_test_metadata_header_read_file_io_handle ); + + BDE_TEST_RUN( + "libbde_metadata_header_read_data", + bde_test_metadata_header_read_data ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +on_error: + return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ +} + diff -Nru libbde-20190102/tests/bde_test_notify.c libbde-20240223/tests/bde_test_notify.c --- libbde-20190102/tests/bde_test_notify.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_notify.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library notification functions test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include diff -Nru libbde-20190102/tests/bde_test_password.c libbde-20240223/tests/bde_test_password.c --- libbde-20190102/tests/bde_test_password.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_password.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,350 @@ +/* + * Library password type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_libbde.h" +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_unused.h" + +#include "../libbde/libbde_password.h" + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_utf8_password_calculate_hash function + * Returns 1 if successful or 0 if not + */ +int bde_test_utf8_password_calculate_hash( + void ) +{ + uint8_t expected_password_hash[ 32 ] = { + 0xf8, 0x55, 0x9b, 0x5a, 0xcf, 0xab, 0x54, 0x09, 0xc1, 0x26, 0xe8, 0xac, 0x8a, 0x59, 0x39, 0xbf, + 0xfa, 0xa8, 0x93, 0xf6, 0x2a, 0xe8, 0x37, 0x3b, 0x68, 0x9c, 0xee, 0xa6, 0x4b, 0xd4, 0x75, 0x69 }; + + uint8_t password[ 5 ] = { + 'T', 'e', 'S', 't', 0 }; + + uint8_t password_hash[ 32 ] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = libbde_utf8_password_calculate_hash( + password, + 5, + password_hash, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = memory_compare( + expected_password_hash, + password_hash, + 32 ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + /* Test error cases + */ + result = libbde_utf8_password_calculate_hash( + NULL, + 4, + password_hash, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_utf8_password_calculate_hash( + password, + (size_t) SSIZE_MAX + 1, + password_hash, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_utf8_password_calculate_hash( + password, + 4, + NULL, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_utf8_password_calculate_hash( + password, + 4, + password_hash, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* Tests the libbde_utf16_password_calculate_hash function + * Returns 1 if successful or 0 if not + */ +int bde_test_utf16_password_calculate_hash( + void ) +{ + uint8_t expected_password_hash[ 32 ] = { + 0xf8, 0x55, 0x9b, 0x5a, 0xcf, 0xab, 0x54, 0x09, 0xc1, 0x26, 0xe8, 0xac, 0x8a, 0x59, 0x39, 0xbf, + 0xfa, 0xa8, 0x93, 0xf6, 0x2a, 0xe8, 0x37, 0x3b, 0x68, 0x9c, 0xee, 0xa6, 0x4b, 0xd4, 0x75, 0x69 }; + + uint16_t password[ 5 ] = { + 'T', 'e', 'S', 't', 0 }; + + uint8_t password_hash[ 32 ] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = libbde_utf16_password_calculate_hash( + password, + 5, + password_hash, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = memory_compare( + expected_password_hash, + password_hash, + 32 ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + /* Test error cases + */ + result = libbde_utf16_password_calculate_hash( + NULL, + 4, + password_hash, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_utf16_password_calculate_hash( + password, + (size_t) SSIZE_MAX + 1, + password_hash, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_utf16_password_calculate_hash( + password, + 4, + NULL, + 32, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_utf16_password_calculate_hash( + password, + 4, + password_hash, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN( + "libbde_utf8_password_calculate_hash", + bde_test_utf8_password_calculate_hash ); + + BDE_TEST_RUN( + "libbde_utf16_password_calculate_hash", + bde_test_utf16_password_calculate_hash ); + + /* TODO add tests for libbde_password_calculate_key */ + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +on_error: + return( EXIT_FAILURE ); +} + diff -Nru libbde-20190102/tests/bde_test_password_keep.c libbde-20240223/tests/bde_test_password_keep.c --- libbde-20190102/tests/bde_test_password_keep.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_password_keep.c 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library password_keep type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &password_keep, &error ); + password_keep = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - password_keep = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/bde_test_sector_data.c libbde-20240223/tests/bde_test_sector_data.c --- libbde-20190102/tests/bde_test_sector_data.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_sector_data.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library sector_data type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -27,16 +27,289 @@ #include #endif +#include "bde_test_functions.h" #include "bde_test_libbde.h" +#include "bde_test_libbfio.h" #include "bde_test_libcerror.h" #include "bde_test_macros.h" #include "bde_test_memory.h" #include "bde_test_unused.h" +#include "../libbde/libbde_definitions.h" +#include "../libbde/libbde_encryption_context.h" +#include "../libbde/libbde_io_handle.h" #include "../libbde/libbde_sector_data.h" +uint8_t bde_test_sector_data_data1[ 512 ] = { + 0xb1, 0x24, 0x3d, 0xf3, 0x34, 0x83, 0x9c, 0x86, 0xc9, 0xad, 0x52, 0xc3, 0xa1, 0x9d, 0x02, 0x2b, + 0x26, 0x8d, 0xde, 0xfb, 0x7b, 0x20, 0x0a, 0x40, 0x86, 0xfd, 0x61, 0xa6, 0xdf, 0x9c, 0x68, 0x73, + 0x6d, 0x01, 0x96, 0x4e, 0x49, 0xe1, 0x98, 0xfd, 0x21, 0x9b, 0xba, 0xcc, 0xa0, 0xc9, 0x60, 0x49, + 0xe7, 0x9c, 0x44, 0xd9, 0x92, 0x42, 0x50, 0x17, 0x3f, 0x46, 0xd5, 0x36, 0x3e, 0xb6, 0x38, 0xd6, + 0x62, 0x08, 0xa1, 0xc4, 0x2c, 0xca, 0xf6, 0x08, 0x84, 0x13, 0x90, 0x71, 0x40, 0x66, 0xd2, 0x5d, + 0x39, 0xc4, 0x38, 0xe4, 0x69, 0xb2, 0x86, 0xcc, 0xd9, 0x4b, 0x2b, 0x9d, 0xbf, 0xdc, 0x56, 0x12, + 0xa2, 0xd1, 0x83, 0x70, 0xa1, 0xd1, 0x45, 0xad, 0x87, 0xcd, 0x37, 0x7a, 0x17, 0x85, 0x5f, 0x2f, + 0x72, 0xd2, 0x85, 0x87, 0xc0, 0x0c, 0x9c, 0xd1, 0x65, 0x01, 0x2d, 0xc1, 0x2d, 0xe0, 0xd1, 0xa9, + 0xf6, 0x94, 0xc2, 0x96, 0xa9, 0xb3, 0x35, 0xc5, 0x29, 0x2d, 0x11, 0x28, 0x01, 0x0f, 0x77, 0xef, + 0x45, 0x27, 0x0b, 0x9a, 0x2e, 0x58, 0xc5, 0x96, 0xf8, 0x5c, 0x01, 0xa7, 0x53, 0x2d, 0x0b, 0xbb, + 0xc9, 0x40, 0x6f, 0x26, 0x39, 0xb0, 0x7d, 0x08, 0x7d, 0x2f, 0xe2, 0xa1, 0xc3, 0x47, 0x52, 0x27, + 0x03, 0x38, 0x8b, 0xe7, 0x7d, 0x6c, 0x2f, 0x6a, 0x71, 0xb4, 0x4f, 0xa8, 0x66, 0xd3, 0x49, 0x90, + 0xeb, 0x67, 0xbb, 0xd2, 0xdb, 0xb5, 0xc2, 0x76, 0x2c, 0x26, 0xc2, 0x3b, 0xc7, 0xec, 0xaf, 0x23, + 0x31, 0xe3, 0xa3, 0xb4, 0x11, 0xdb, 0x99, 0x90, 0x0b, 0xee, 0xeb, 0x8d, 0x0d, 0xc3, 0xc4, 0x53, + 0xbb, 0xb8, 0xf8, 0x17, 0xcc, 0x15, 0x67, 0x84, 0x9e, 0xa0, 0x33, 0xec, 0x53, 0xd1, 0x48, 0x84, + 0xc7, 0xad, 0x6d, 0x95, 0x2c, 0x2f, 0x36, 0x8d, 0x40, 0xf6, 0xd3, 0x16, 0xd5, 0x66, 0xf6, 0xac, + 0x02, 0x9a, 0x5c, 0xa1, 0x29, 0x35, 0x05, 0xb1, 0xd8, 0xc0, 0x4b, 0x5e, 0x83, 0x60, 0x29, 0xfa, + 0x09, 0xf9, 0x86, 0x57, 0xe4, 0xca, 0x29, 0x40, 0xeb, 0xde, 0x5c, 0x94, 0x89, 0xaf, 0xd5, 0xc0, + 0xeb, 0x0f, 0x94, 0xf0, 0x60, 0x6c, 0xe9, 0x31, 0xfe, 0x3a, 0xe8, 0x9b, 0xf5, 0x93, 0xa5, 0xfd, + 0xc1, 0x68, 0xd3, 0xd4, 0x04, 0xab, 0xa5, 0x62, 0x5d, 0x74, 0x23, 0xe6, 0xfa, 0x2c, 0x8e, 0xda, + 0x6e, 0xd6, 0x92, 0xf6, 0x85, 0xc1, 0x07, 0x61, 0x2a, 0xce, 0x23, 0xd7, 0x2b, 0x46, 0x32, 0xe2, + 0xf5, 0xc1, 0xc6, 0x65, 0xa5, 0x19, 0x71, 0x23, 0xf1, 0x2e, 0x4d, 0x76, 0x8a, 0xe4, 0xd3, 0x79, + 0x7c, 0x6a, 0x4c, 0x80, 0x06, 0x5c, 0xef, 0x6c, 0x0b, 0x55, 0x17, 0xdc, 0x8e, 0x35, 0xff, 0x05, + 0x3d, 0x4c, 0x99, 0x3e, 0x3e, 0x56, 0x85, 0x70, 0x2f, 0x6a, 0xcf, 0x86, 0x51, 0xca, 0xb2, 0x60, + 0x65, 0xe4, 0xf9, 0xb2, 0xe9, 0x87, 0x98, 0xc5, 0x10, 0x5e, 0xc5, 0x91, 0x8b, 0x25, 0xcf, 0x8f, + 0x3a, 0x47, 0xb1, 0xb3, 0x1d, 0x97, 0x44, 0xa7, 0x18, 0x9f, 0xa5, 0xd4, 0x41, 0x6b, 0x40, 0xa8, + 0xea, 0x3f, 0xf5, 0x3f, 0xc5, 0x08, 0xd8, 0xf2, 0x9a, 0xd1, 0x26, 0x0f, 0xf1, 0x1d, 0xf4, 0x64, + 0xcf, 0x79, 0xea, 0xb4, 0x93, 0x85, 0x1d, 0xc8, 0x71, 0x47, 0x0f, 0x7e, 0xe5, 0x74, 0xff, 0x63, + 0xb9, 0x0d, 0x6f, 0xbc, 0x48, 0x5c, 0xec, 0x31, 0x32, 0xc6, 0x33, 0x7f, 0xa5, 0x47, 0xa2, 0x5e, + 0xa2, 0xca, 0x3e, 0xd1, 0x82, 0x45, 0x01, 0xa6, 0x1d, 0x6b, 0x83, 0x51, 0x86, 0x33, 0x8a, 0x8b, + 0xf1, 0xad, 0x85, 0xb8, 0xb5, 0x63, 0xc6, 0x9e, 0x60, 0x79, 0xd1, 0x77, 0xb3, 0xd9, 0x4a, 0x9c, + 0xd7, 0x2b, 0x29, 0x2f, 0x53, 0x61, 0x50, 0x59, 0x41, 0xdb, 0x84, 0x6f, 0x56, 0x35, 0x25, 0xc8 }; + #if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) +/* Tests the libbde_sector_data_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_sector_data_initialize( + void ) +{ + libbde_sector_data_t *sector_data = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 2; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libbde_sector_data_initialize( + §or_data, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "sector_data", + sector_data ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_sector_data_free( + §or_data, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data", + sector_data ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_sector_data_initialize( + NULL, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + sector_data = (libbde_sector_data_t *) 0x12345678UL; + + result = libbde_sector_data_initialize( + §or_data, + 512, + &error ); + + sector_data = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_sector_data_initialize( + §or_data, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_sector_data_initialize( + §or_data, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libbde_sector_data_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = libbde_sector_data_initialize( + §or_data, + 512, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( sector_data != NULL ) + { + libbde_sector_data_free( + §or_data, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data", + sector_data ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libbde_sector_data_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = libbde_sector_data_initialize( + §or_data, + 512, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( sector_data != NULL ) + { + libbde_sector_data_free( + §or_data, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data", + sector_data ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( sector_data != NULL ) + { + libbde_sector_data_free( + §or_data, + NULL ); + } + return( 0 ); +} + /* Tests the libbde_sector_data_free function * Returns 1 if successful or 0 if not */ @@ -75,6 +348,402 @@ return( 0 ); } +/* Tests the libbde_sector_data_read_file_io_handle function + * Returns 1 if successful or 0 if not + */ +int bde_test_sector_data_read_file_io_handle( + void ) +{ + uint8_t key_data[ 16 ] = { + 0x54, 0xe6, 0x30, 0x48, 0x2e, 0xb9, 0xdb, 0x51, 0x53, 0x33, 0xc4, 0x1e, 0x4a, 0x5a, 0xe8, 0xa6 }; + + libbde_encryption_context_t *encryption_context = NULL; + libbde_io_handle_t *io_handle = NULL; + libbde_sector_data_t *sector_data = NULL; + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_sector_data_initialize( + §or_data, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "sector_data", + sector_data ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_io_handle_initialize( + &io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "io_handle", + io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_encryption_context_initialize( + &encryption_context, + LIBBDE_ENCRYPTION_METHOD_AES_128_CBC, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "encryption_context", + encryption_context ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_encryption_context_set_keys( + encryption_context, + key_data, + 16, + NULL, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Initialize file IO handle + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_sector_data_data1, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_sector_data_read_file_io_handle( + sector_data, + io_handle, + file_io_handle, + 0, + encryption_context, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_sector_data_read_file_io_handle( + NULL, + io_handle, + file_io_handle, + 0, + encryption_context, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_sector_data_read_file_io_handle( + sector_data, + NULL, + file_io_handle, + 0, + encryption_context, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_sector_data_read_file_io_handle( + sector_data, + io_handle, + NULL, + 0, + encryption_context, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_sector_data_read_file_io_handle( + sector_data, + io_handle, + file_io_handle, + -1, + encryption_context, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_sector_data_read_file_io_handle( + sector_data, + io_handle, + file_io_handle, + 0, + NULL, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +/* TODO add more tests */ + + /* Clean up file IO handle + */ + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test data too small + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_sector_data_data1, + 8, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_sector_data_read_file_io_handle( + sector_data, + io_handle, + file_io_handle, + 0, + encryption_context, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Clean up + */ + result = libbde_encryption_context_free( + &encryption_context, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "encryption_context", + encryption_context ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_io_handle_free( + &io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "io_handle", + io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_sector_data_free( + §or_data, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data", + sector_data ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } + if( encryption_context != NULL ) + { + libbde_encryption_context_free( + &encryption_context, + NULL ); + } + if( io_handle != NULL ) + { + libbde_io_handle_free( + &io_handle, + NULL ); + } + if( sector_data != NULL ) + { + libbde_sector_data_free( + §or_data, + NULL ); + } + return( 0 ); +} + #endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ /* The main program @@ -94,19 +763,27 @@ #if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) - /* TODO: add tests for libbde_sector_data_initialize */ + BDE_TEST_RUN( + "libbde_sector_data_initialize", + bde_test_sector_data_initialize ); BDE_TEST_RUN( "libbde_sector_data_free", bde_test_sector_data_free ); - /* TODO: add tests for libbde_sector_data_read */ + BDE_TEST_RUN( + "libbde_sector_data_read_file_io_handle", + bde_test_sector_data_read_file_io_handle ); #endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ return( EXIT_SUCCESS ); +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + on_error: return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ } diff -Nru libbde-20190102/tests/bde_test_sector_data_vector.c libbde-20240223/tests/bde_test_sector_data_vector.c --- libbde-20190102/tests/bde_test_sector_data_vector.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_sector_data_vector.c 2024-02-23 02:48:06.000000000 +0000 @@ -0,0 +1,332 @@ +/* + * Library sector_data_vector type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_functions.h" +#include "bde_test_libbde.h" +#include "bde_test_libbfio.h" +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_memory.h" +#include "bde_test_unused.h" + +#include "../libbde/libbde_definitions.h" +#include "../libbde/libbde_sector_data_vector.h" + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_sector_data_vector_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_sector_data_vector_initialize( + void ) +{ + libbde_sector_data_vector_t *sector_data_vector = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libbde_sector_data_vector_initialize( + §or_data_vector, + 512, + 0, + 4096, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "sector_data_vector", + sector_data_vector ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_sector_data_vector_free( + §or_data_vector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data_vector", + sector_data_vector ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_sector_data_vector_initialize( + NULL, + 512, + 0, + 4096, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + sector_data_vector = (libbde_sector_data_vector_t *) 0x12345678UL; + + result = libbde_sector_data_vector_initialize( + §or_data_vector, + 512, + 0, + 4096, + &error ); + + sector_data_vector = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libbde_sector_data_vector_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = libbde_sector_data_vector_initialize( + §or_data_vector, + 512, + 0, + 4096, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( sector_data_vector != NULL ) + { + libbde_sector_data_vector_free( + §or_data_vector, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data_vector", + sector_data_vector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libbde_sector_data_vector_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = libbde_sector_data_vector_initialize( + §or_data_vector, + 512, + 0, + 4096, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( sector_data_vector != NULL ) + { + libbde_sector_data_vector_free( + §or_data_vector, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "sector_data_vector", + sector_data_vector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( sector_data_vector != NULL ) + { + libbde_sector_data_vector_free( + §or_data_vector, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_sector_data_vector_free function + * Returns 1 if successful or 0 if not + */ +int bde_test_sector_data_vector_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = libbde_sector_data_vector_free( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN( + "libbde_sector_data_vector_initialize", + bde_test_sector_data_vector_initialize ); + + BDE_TEST_RUN( + "libbde_sector_data_vector_free", + bde_test_sector_data_vector_free ); + + /* TODO add tests for libbde_sector_data_vector_get_sector_data_at_offset */ + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +on_error: + return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ +} + diff -Nru libbde-20190102/tests/bde_test_stretch_key.c libbde-20240223/tests/bde_test_stretch_key.c --- libbde-20190102/tests/bde_test_stretch_key.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_stretch_key.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library stretch_key type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &stretch_key, &error ); + stretch_key = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - stretch_key = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/bde_test_support.c libbde-20240223/tests/bde_test_support.c --- libbde-20190102/tests/bde_test_support.c 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_support.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library support functions test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -736,7 +736,7 @@ while( ( option = bde_test_getopt( argc, argv, - _SYSTEM_STRING( "o:p:r:" ) ) ) != (system_integer_t) -1 ) + _SYSTEM_STRING( "o:p:r:s:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { @@ -756,6 +756,7 @@ case (system_integer_t) 'p': case (system_integer_t) 'r': + case (system_integer_t) 's': break; } } diff -Nru libbde-20190102/tests/bde_test_tools_info_handle.c libbde-20240223/tests/bde_test_tools_info_handle.c --- libbde-20190102/tests/bde_test_tools_info_handle.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_tools_info_handle.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,304 @@ +/* + * Tools info_handle type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_memory.h" +#include "bde_test_unused.h" + +#include "../bdetools/info_handle.h" + +/* Tests the info_handle_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_tools_info_handle_initialize( + void ) +{ + info_handle_t *info_handle = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = info_handle_initialize( + &info_handle, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "info_handle", + info_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = info_handle_free( + &info_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "info_handle", + info_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = info_handle_initialize( + NULL, + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + info_handle = (info_handle_t *) 0x12345678UL; + + result = info_handle_initialize( + &info_handle, + 1, + &error ); + + info_handle = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test info_handle_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = info_handle_initialize( + &info_handle, + 1, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( info_handle != NULL ) + { + info_handle_free( + &info_handle, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "info_handle", + info_handle ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test info_handle_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = info_handle_initialize( + &info_handle, + 1, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( info_handle != NULL ) + { + info_handle_free( + &info_handle, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "info_handle", + info_handle ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( info_handle != NULL ) + { + info_handle_free( + &info_handle, + NULL ); + } + return( 0 ); +} + +/* Tests the info_handle_free function + * Returns 1 if successful or 0 if not + */ +int bde_test_tools_info_handle_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = info_handle_free( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + + BDE_TEST_RUN( + "info_handle_initialize", + bde_test_tools_info_handle_initialize ); + + BDE_TEST_RUN( + "info_handle_free", + bde_test_tools_info_handle_free ); + + return( EXIT_SUCCESS ); + +on_error: + return( EXIT_FAILURE ); +} + diff -Nru libbde-20190102/tests/bde_test_tools_output.c libbde-20240223/tests/bde_test_tools_output.c --- libbde-20190102/tests/bde_test_tools_output.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_tools_output.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Tools output functions test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include + +#if defined( HAVE_IO_H ) || defined( WINAPI ) +#include +#endif + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_unused.h" + +#include "../bdetools/bdetools_output.h" + +/* Tests the bdetools_output_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_tools_output_initialize( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + result = bdetools_output_initialize( + _IONBF, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + + BDE_TEST_RUN( + "bdetools_output_initialize", + bde_test_tools_output_initialize ) + + /* TODO add tests for bdetools_output_copyright_fprint */ + + /* TODO add tests for bdetools_output_version_fprint */ + + /* TODO add tests for bdetools_output_version_detailed_fprint */ + + return( EXIT_SUCCESS ); + +on_error: + return( EXIT_FAILURE ); +} + diff -Nru libbde-20190102/tests/bde_test_tools_signal.c libbde-20240223/tests/bde_test_tools_signal.c --- libbde-20190102/tests/bde_test_tools_signal.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_tools_signal.c 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,213 @@ +/* + * Tools signal functions test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_libcerror.h" +#include "bde_test_macros.h" +#include "bde_test_unused.h" + +#include "../bdetools/bdetools_signal.h" + +void bde_test_tools_signal_handler_function( + bdetools_signal_t signal BDE_TEST_ATTRIBUTE_UNUSED ) +{ + BDE_TEST_UNREFERENCED_PARAMETER( signal ) +} + +#if defined( WINAPI ) + +/* Tests the bdetools_signal_handler function + * Returns 1 if successful or 0 if not + */ +int bde_test_tools_signal_handler( + void ) +{ + BOOL result = 0; + + /* Test regular cases + */ + result = bdetools_signal_handler( + CTRL_C_EVENT ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + (int) TRUE ); + + result = bdetools_signal_handler( + CTRL_LOGOFF_EVENT ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + (int) FALSE ); + + return( 1 ); + +on_error: + return( 0 ); +} + +#if defined( _MSC_VER ) + + /* TODO add tests for bdetools_signal_initialize_memory_debug */ + +#endif /* defined( _MSC_VER ) */ + +#endif /* defined( WINAPI ) */ + +/* Tests the bdetools_signal_attach function + * Returns 1 if successful or 0 if not + */ +int bde_test_tools_signal_attach( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = bdetools_signal_attach( + bde_test_tools_signal_handler_function, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = bdetools_signal_attach( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* Tests the bdetools_signal_detach function + * Returns 1 if successful or 0 if not + */ +int bde_test_tools_signal_detach( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = bdetools_signal_detach( + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( WINAPI ) + + BDE_TEST_RUN( + "bdetools_signal_handler", + bde_test_tools_signal_handler ) + +#if defined( _MSC_VER ) + + /* TODO add tests for bdetools_signal_initialize_memory_debug */ + +#endif /* defined( _MSC_VER ) */ + +#endif /* defined( WINAPI ) */ + + BDE_TEST_RUN( + "bdetools_signal_attach", + bde_test_tools_signal_attach ) + + BDE_TEST_RUN( + "bdetools_signal_detach", + bde_test_tools_signal_detach ) + + return( EXIT_SUCCESS ); + +on_error: + return( EXIT_FAILURE ); +} + diff -Nru libbde-20190102/tests/bde_test_unused.h libbde-20240223/tests/bde_test_unused.h --- libbde-20190102/tests/bde_test_unused.h 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/bde_test_unused.h 2024-02-23 02:47:19.000000000 +0000 @@ -1,22 +1,22 @@ /* * Definitions to silence compiler warnings about unused function attributes/parameters. * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #if !defined( _BDE_TEST_UNUSED_H ) diff -Nru libbde-20190102/tests/bde_test_volume.c libbde-20240223/tests/bde_test_volume.c --- libbde-20190102/tests/bde_test_volume.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_volume.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library volume type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -30,6 +30,12 @@ #include #endif +#if defined( HAVE_SYS_TIME_H ) +#include +#endif + +#include + #include "bde_test_functions.h" #include "bde_test_getopt.h" #include "bde_test_libbde.h" @@ -37,10 +43,19 @@ #include "bde_test_libcerror.h" #include "bde_test_macros.h" #include "bde_test_memory.h" -#include "bde_test_unused.h" #include "../libbde/libbde_volume.h" +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 +#error Unsupported size of wchar_t +#endif + +/* Define to make bde_test_volume generate verbose output +#define BDE_TEST_VOLUME_VERBOSE + */ + +#define BDE_TEST_VOLUME_READ_BUFFER_SIZE 4096 + #if !defined( LIBBDE_HAVE_BFIO ) LIBBDE_EXTERN \ @@ -57,14 +72,6 @@ #endif /* !defined( LIBBDE_HAVE_BFIO ) */ -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 -#error Unsupported size of wchar_t -#endif - -/* Define to make bde_test_volume generate verbose output -#define BDE_TEST_VOLUME_VERBOSE - */ - /* Creates and opens a source volume * Returns 1 if successful or -1 on error */ @@ -73,6 +80,7 @@ libbfio_handle_t *file_io_handle, const system_character_t *password, const system_character_t *recovery_password, + const system_character_t *startup_key, libcerror_error_t **error ) { static char *function = "bde_test_volume_open_source"; @@ -174,6 +182,31 @@ goto on_error; } } + if( startup_key != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libbde_volume_read_startup_key_wide( + *volume, + startup_key, + error ); +#else + result = libbde_volume_read_startup_key( + *volume, + startup_key, + error ); +#endif + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_IO, + LIBCERROR_IO_ERROR_READ_FAILED, + "%s: unable to read startup key.", + function ); + + goto on_error; + } + } result = libbde_volume_open_file_io_handle( *volume, file_io_handle, @@ -329,6 +362,8 @@ &volume, &error ); + volume = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -341,8 +376,6 @@ libcerror_error_free( &error ); - volume = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; @@ -492,7 +525,8 @@ int bde_test_volume_open( const system_character_t *source, const system_character_t *password, - const system_character_t *recovery_password ) + const system_character_t *recovery_password, + const system_character_t *startup_key ) { char narrow_source[ 256 ]; @@ -589,6 +623,28 @@ "error", error ); } + if( startup_key != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libbde_volume_read_startup_key_wide( + volume, + startup_key, + &error ); +#else + result = libbde_volume_read_startup_key( + volume, + startup_key, + &error ); +#endif + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } /* Test open */ result = libbde_volume_open( @@ -726,7 +782,8 @@ int bde_test_volume_open_wide( const system_character_t *source, const system_character_t *password, - const system_character_t *recovery_password ) + const system_character_t *recovery_password, + const system_character_t *startup_key ) { wchar_t wide_source[ 256 ]; @@ -823,6 +880,28 @@ "error", error ); } + if( startup_key != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libbde_volume_read_startup_key_wide( + volume, + startup_key, + &error ); +#else + result = libbde_volume_read_startup_key( + volume, + startup_key, + &error ); +#endif + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } /* Test open */ result = libbde_volume_open_wide( @@ -960,7 +1039,8 @@ int bde_test_volume_open_file_io_handle( const system_character_t *source, const system_character_t *password, - const system_character_t *recovery_password ) + const system_character_t *recovery_password, + const system_character_t *startup_key ) { libbde_volume_t *volume = NULL; libbfio_handle_t *file_io_handle = NULL; @@ -979,13 +1059,13 @@ result, 1 ); - BDE_TEST_ASSERT_IS_NOT_NULL( - "file_io_handle", - file_io_handle ); - - BDE_TEST_ASSERT_IS_NULL( - "error", - error ); + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); string_length = system_string_length( source ); @@ -1008,9 +1088,9 @@ result, 1 ); - BDE_TEST_ASSERT_IS_NULL( - "error", - error ); + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); result = libbde_volume_initialize( &volume, @@ -1083,6 +1163,28 @@ "error", error ); } + if( startup_key != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libbde_volume_read_startup_key_wide( + volume, + startup_key, + &error ); +#else + result = libbde_volume_read_startup_key( + volume, + startup_key, + &error ); +#endif + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } /* Test open */ result = libbde_volume_open_file_io_handle( @@ -1205,12 +1307,12 @@ 1 ); BDE_TEST_ASSERT_IS_NULL( - "file_io_handle", - file_io_handle ); + "file_io_handle", + file_io_handle ); - BDE_TEST_ASSERT_IS_NULL( - "error", - error ); + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); return( 1 ); @@ -1279,7 +1381,8 @@ int bde_test_volume_open_close( const system_character_t *source, const system_character_t *password, - const system_character_t *recovery_password ) + const system_character_t *recovery_password, + const system_character_t *startup_key ) { libbde_volume_t *volume = NULL; libcerror_error_t *error = NULL; @@ -1359,6 +1462,28 @@ "error", error ); } + if( startup_key != NULL ) + { +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libbde_volume_read_startup_key_wide( + volume, + startup_key, + &error ); +#else + result = libbde_volume_read_startup_key( + volume, + startup_key, + &error ); +#endif + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } /* Test open and close */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) @@ -1524,19 +1649,81 @@ return( 0 ); } -/* Tests the libbde_volume_read_buffer function +/* Tests the libbde_volume_is_locked function * Returns 1 if successful or 0 if not */ -int bde_test_volume_read_buffer( +int bde_test_volume_is_locked( libbde_volume_t *volume ) { - uint8_t buffer[ 16 ]; + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = libbde_volume_is_locked( + volume, + &error ); + + BDE_TEST_ASSERT_NOT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_volume_is_locked( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_internal_volume_read_buffer_from_file_io_handle function + * Returns 1 if successful or 0 if not + */ +int bde_test_internal_volume_read_buffer_from_file_io_handle( + libbde_volume_t *volume ) +{ + uint8_t buffer[ BDE_TEST_VOLUME_READ_BUFFER_SIZE ]; libcerror_error_t *error = NULL; + time_t timestamp = 0; + size64_t remaining_size = 0; size64_t size = 0; + size_t read_size = 0; ssize_t read_count = 0; off64_t offset = 0; + off64_t read_offset = 0; + int number_of_tests = 1024; + int random_number = 0; int result = 0; + int test_number = 0; /* Determine size */ @@ -1573,23 +1760,362 @@ /* Test regular cases */ - if( size > 16 ) + read_size = BDE_TEST_VOLUME_READ_BUFFER_SIZE; + + if( size < BDE_TEST_VOLUME_READ_BUFFER_SIZE ) { - read_count = libbde_volume_read_buffer( - volume, + read_size = (size_t) size; + } + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + (libbde_internal_volume_t *) volume, + ( (libbde_internal_volume_t *) volume )->file_io_handle, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) read_size ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + if( size > 8 ) + { + /* Set offset to size - 8 + */ + offset = libbde_volume_seek_offset( + volume, + -8, + SEEK_END, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) size - 8 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Read buffer on size boundary + */ + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + (libbde_internal_volume_t *) volume, + ( (libbde_internal_volume_t *) volume )->file_io_handle, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 8 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Read buffer beyond size boundary + */ + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + (libbde_internal_volume_t *) volume, + ( (libbde_internal_volume_t *) volume )->file_io_handle, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } + /* Stress test read buffer + */ + timestamp = time( + NULL ); + + srand( + (unsigned int) timestamp ); + + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + remaining_size = size; + + for( test_number = 0; + test_number < number_of_tests; + test_number++ ) + { + random_number = rand(); + + BDE_TEST_ASSERT_GREATER_THAN_INT( + "random_number", + random_number, + -1 ); + + read_size = (size_t) random_number % BDE_TEST_VOLUME_READ_BUFFER_SIZE; + +#if defined( BDE_TEST_VOLUME_VERBOSE ) + fprintf( + stdout, + "libbde_volume_read_buffer: at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIzd "\n", + read_offset, + read_offset, + read_size ); +#endif + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + (libbde_internal_volume_t *) volume, + ( (libbde_internal_volume_t *) volume )->file_io_handle, buffer, - 16, + read_size, &error ); + if( read_size > remaining_size ) + { + read_size = (size_t) remaining_size; + } BDE_TEST_ASSERT_EQUAL_SSIZE( "read_count", read_count, - (ssize_t) 16 ); + (ssize_t) read_size ); BDE_TEST_ASSERT_IS_NULL( "error", error ); + read_offset += read_count; + + result = libbde_volume_get_offset( + volume, + &offset, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + read_offset ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + remaining_size -= read_count; + + if( remaining_size == 0 ) + { + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + read_offset = 0; + + remaining_size = size; + } + } + /* Reset offset to 0 + */ + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + NULL, + ( (libbde_internal_volume_t *) volume )->file_io_handle, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + (libbde_internal_volume_t *) volume, + ( (libbde_internal_volume_t *) volume )->file_io_handle, + NULL, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + read_count = libbde_internal_volume_read_buffer_from_file_io_handle( + (libbde_internal_volume_t *) volume, + ( (libbde_internal_volume_t *) volume )->file_io_handle, + buffer, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* Tests the libbde_volume_read_buffer function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_read_buffer( + libbde_volume_t *volume ) +{ + uint8_t buffer[ BDE_TEST_VOLUME_READ_BUFFER_SIZE ]; + + libcerror_error_t *error = NULL; + time_t timestamp = 0; + size64_t remaining_size = 0; + size64_t size = 0; + size_t read_size = 0; + ssize_t read_count = 0; + off64_t offset = 0; + off64_t read_offset = 0; + int number_of_tests = 1024; + int random_number = 0; + int result = 0; + int test_number = 0; + + /* Determine size + */ + result = libbde_volume_get_size( + volume, + &size, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Reset offset to 0 + */ + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + read_size = BDE_TEST_VOLUME_READ_BUFFER_SIZE; + + if( size < BDE_TEST_VOLUME_READ_BUFFER_SIZE ) + { + read_size = (size_t) size; + } + read_count = libbde_volume_read_buffer( + volume, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) read_size ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + if( size > 8 ) + { /* Set offset to size - 8 */ offset = libbde_volume_seek_offset( @@ -1612,7 +2138,7 @@ read_count = libbde_volume_read_buffer( volume, buffer, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, &error ); BDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1629,7 +2155,7 @@ read_count = libbde_volume_read_buffer( volume, buffer, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, &error ); BDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1640,30 +2166,140 @@ BDE_TEST_ASSERT_IS_NULL( "error", error ); + } + /* Stress test read buffer + */ + timestamp = time( + NULL ); - /* Reset offset to 0 - */ - offset = libbde_volume_seek_offset( + srand( + (unsigned int) timestamp ); + + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + remaining_size = size; + + for( test_number = 0; + test_number < number_of_tests; + test_number++ ) + { + random_number = rand(); + + BDE_TEST_ASSERT_GREATER_THAN_INT( + "random_number", + random_number, + -1 ); + + read_size = (size_t) random_number % BDE_TEST_VOLUME_READ_BUFFER_SIZE; + +#if defined( BDE_TEST_VOLUME_VERBOSE ) + fprintf( + stdout, + "libbde_volume_read_buffer: at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIzd "\n", + read_offset, + read_offset, + read_size ); +#endif + read_count = libbde_volume_read_buffer( + volume, + buffer, + read_size, + &error ); + + if( read_size > remaining_size ) + { + read_size = (size_t) remaining_size; + } + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) read_size ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + read_offset += read_count; + + result = libbde_volume_get_offset( volume, - 0, - SEEK_SET, + &offset, &error ); + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + BDE_TEST_ASSERT_EQUAL_INT64( "offset", offset, - (int64_t) 0 ); + read_offset ); BDE_TEST_ASSERT_IS_NULL( "error", error ); + + remaining_size -= read_count; + + if( remaining_size == 0 ) + { + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + read_offset = 0; + + remaining_size = size; + } } + /* Reset offset to 0 + */ + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + /* Test error cases */ read_count = libbde_volume_read_buffer( NULL, buffer, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, &error ); BDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1681,7 +2317,7 @@ read_count = libbde_volume_read_buffer( volume, NULL, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, &error ); BDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1714,6 +2350,66 @@ libcerror_error_free( &error ); +#if defined( HAVE_BDE_TEST_RWLOCK ) + + /* Test libbde_volume_read_buffer with pthread_rwlock_wrlock failing in libcthreads_read_write_lock_grab_for_write + */ + bde_test_pthread_rwlock_wrlock_attempts_before_fail = 0; + + read_count = libbde_volume_read_buffer( + volume, + buffer, + BDE_TEST_PARTITION_READ_BUFFER_SIZE, + &error ); + + if( bde_test_pthread_rwlock_wrlock_attempts_before_fail != -1 ) + { + bde_test_pthread_rwlock_wrlock_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + /* Test libbde_volume_read_buffer with pthread_rwlock_unlock failing in libcthreads_read_write_lock_release_for_write + */ + bde_test_pthread_rwlock_unlock_attempts_before_fail = 0; + + read_count = libbde_volume_read_buffer( + volume, + buffer, + BDE_TEST_PARTITION_READ_BUFFER_SIZE, + &error ); + + if( bde_test_pthread_rwlock_unlock_attempts_before_fail != -1 ) + { + bde_test_pthread_rwlock_unlock_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } +#endif /* defined( HAVE_BDE_TEST_RWLOCK ) */ + return( 1 ); on_error: @@ -1731,12 +2427,20 @@ int bde_test_volume_read_buffer_at_offset( libbde_volume_t *volume ) { - uint8_t buffer[ 16 ]; + uint8_t buffer[ BDE_TEST_VOLUME_READ_BUFFER_SIZE ]; libcerror_error_t *error = NULL; + time_t timestamp = 0; + size64_t remaining_size = 0; size64_t size = 0; + size_t read_size = 0; ssize_t read_count = 0; + off64_t offset = 0; + off64_t read_offset = 0; + int number_of_tests = 1024; + int random_number = 0; int result = 0; + int test_number = 0; /* Determine size */ @@ -1756,55 +2460,137 @@ /* Test regular cases */ - if( size > 16 ) + read_size = BDE_TEST_VOLUME_READ_BUFFER_SIZE; + + if( size < BDE_TEST_VOLUME_READ_BUFFER_SIZE ) { + read_size = (size_t) size; + } + read_count = libbde_volume_read_buffer_at_offset( + volume, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) read_size ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + if( size > 8 ) + { + /* Read buffer on size boundary + */ read_count = libbde_volume_read_buffer_at_offset( volume, buffer, - 16, - 0, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + size - 8, &error ); BDE_TEST_ASSERT_EQUAL_SSIZE( "read_count", read_count, - (ssize_t) 16 ); + (ssize_t) 8 ); BDE_TEST_ASSERT_IS_NULL( "error", error ); - /* Read buffer on size boundary + /* Read buffer beyond size boundary */ read_count = libbde_volume_read_buffer_at_offset( volume, buffer, - 16, - size - 8, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + size + 8, &error ); BDE_TEST_ASSERT_EQUAL_SSIZE( "read_count", read_count, - (ssize_t) 8 ); + (ssize_t) 0 ); BDE_TEST_ASSERT_IS_NULL( "error", error ); + } + /* Stress test read buffer + */ + timestamp = time( + NULL ); - /* Read buffer beyond size boundary - */ + srand( + (unsigned int) timestamp ); + + for( test_number = 0; + test_number < number_of_tests; + test_number++ ) + { + random_number = rand(); + + BDE_TEST_ASSERT_GREATER_THAN_INT( + "random_number", + random_number, + -1 ); + + if( size > 0 ) + { + read_offset = (off64_t) random_number % size; + } + read_size = (size_t) random_number % BDE_TEST_VOLUME_READ_BUFFER_SIZE; + +#if defined( BDE_TEST_VOLUME_VERBOSE ) + fprintf( + stdout, + "libbde_volume_read_buffer_at_offset: at offset: %" PRIi64 " (0x%08" PRIx64 ") of size: %" PRIzd "\n", + read_offset, + read_offset, + read_size ); +#endif read_count = libbde_volume_read_buffer_at_offset( volume, buffer, - 16, - size + 8, + read_size, + read_offset, &error ); + remaining_size = size - read_offset; + + if( read_size > remaining_size ) + { + read_size = (size_t) remaining_size; + } BDE_TEST_ASSERT_EQUAL_SSIZE( "read_count", read_count, - (ssize_t) 0 ); + (ssize_t) read_size ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + read_offset += read_count; + + result = libbde_volume_get_offset( + volume, + &offset, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + read_offset ); BDE_TEST_ASSERT_IS_NULL( "error", @@ -1815,7 +2601,7 @@ read_count = libbde_volume_read_buffer_at_offset( NULL, buffer, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, 0, &error ); @@ -1834,7 +2620,7 @@ read_count = libbde_volume_read_buffer_at_offset( volume, NULL, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, 0, &error ); @@ -1872,7 +2658,7 @@ read_count = libbde_volume_read_buffer_at_offset( volume, buffer, - 16, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, -1, &error ); @@ -1888,6 +2674,68 @@ libcerror_error_free( &error ); +#if defined( HAVE_BDE_TEST_RWLOCK ) + + /* Test libbde_volume_read_buffer_at_offset with pthread_rwlock_wrlock failing in libcthreads_read_write_lock_grab_for_write + */ + bde_test_pthread_rwlock_wrlock_attempts_before_fail = 0; + + read_count = libbde_volume_read_buffer_at_offset( + volume, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + 0, + &error ); + + if( bde_test_pthread_rwlock_wrlock_attempts_before_fail != -1 ) + { + bde_test_pthread_rwlock_wrlock_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + /* Test libbde_volume_read_buffer_at_offset with pthread_rwlock_unlock failing in libcthreads_read_write_lock_release_for_write + */ + bde_test_pthread_rwlock_unlock_attempts_before_fail = 0; + + read_count = libbde_volume_read_buffer_at_offset( + volume, + buffer, + BDE_TEST_VOLUME_READ_BUFFER_SIZE, + 0, + &error ); + + if( bde_test_pthread_rwlock_unlock_attempts_before_fail != -1 ) + { + bde_test_pthread_rwlock_unlock_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } +#endif /* defined( HAVE_BDE_TEST_RWLOCK ) */ + return( 1 ); on_error: @@ -2061,6 +2909,66 @@ libcerror_error_free( &error ); +#if defined( HAVE_BDE_TEST_RWLOCK ) + + /* Test libbde_volume_seek_offset with pthread_rwlock_wrlock failing in libcthreads_read_write_lock_grab_for_write + */ + bde_test_pthread_rwlock_wrlock_attempts_before_fail = 0; + + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + if( bde_test_pthread_rwlock_wrlock_attempts_before_fail != -1 ) + { + bde_test_pthread_rwlock_wrlock_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + (int64_t) offset, + (int64_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + /* Test libbde_volume_seek_offset with pthread_rwlock_unlock failing in libcthreads_read_write_lock_release_for_write + */ + bde_test_pthread_rwlock_unlock_attempts_before_fail = 0; + + offset = libbde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + if( bde_test_pthread_rwlock_unlock_attempts_before_fail != -1 ) + { + bde_test_pthread_rwlock_unlock_attempts_before_fail = -1; + } + else + { + BDE_TEST_ASSERT_EQUAL_INT64( + "offset", + (int64_t) offset, + (int64_t) -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } +#endif /* defined( HAVE_BDE_TEST_RWLOCK ) */ + return( 1 ); on_error: @@ -2080,7 +2988,6 @@ { libcerror_error_t *error = NULL; off64_t offset = 0; - int offset_is_set = 0; int result = 0; /* Test regular cases @@ -2090,17 +2997,15 @@ &offset, &error ); - BDE_TEST_ASSERT_NOT_EQUAL_INT( + BDE_TEST_ASSERT_EQUAL_INT( "result", result, - -1 ); + 1 ); BDE_TEST_ASSERT_IS_NULL( "error", error ); - offset_is_set = result; - /* Test error cases */ result = libbde_volume_get_offset( @@ -2120,25 +3025,23 @@ libcerror_error_free( &error ); - if( offset_is_set != 0 ) - { - result = libbde_volume_get_offset( - volume, - NULL, - &error ); + result = libbde_volume_get_offset( + volume, + NULL, + &error ); - BDE_TEST_ASSERT_EQUAL_INT( - "result", - result, - -1 ); + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); - BDE_TEST_ASSERT_IS_NOT_NULL( - "error", - error ); + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); - libcerror_error_free( - &error ); - } return( 1 ); on_error: @@ -2167,10 +3070,10 @@ &size, &error ); - BDE_TEST_ASSERT_NOT_EQUAL_INT( + BDE_TEST_ASSERT_EQUAL_INT( "result", result, - -1 ); + 1 ); BDE_TEST_ASSERT_IS_NULL( "error", @@ -2229,10 +3132,9 @@ int bde_test_volume_get_encryption_method( libbde_volume_t *volume ) { - libcerror_error_t *error = NULL; - uint16_t encryption_method = 0; - int encryption_method_is_set = 0; - int result = 0; + libcerror_error_t *error = NULL; + uint16_t encryption_method = 0; + int result = 0; /* Test regular cases */ @@ -2241,17 +3143,15 @@ &encryption_method, &error ); - BDE_TEST_ASSERT_NOT_EQUAL_INT( + BDE_TEST_ASSERT_EQUAL_INT( "result", result, - -1 ); + 1 ); BDE_TEST_ASSERT_IS_NULL( "error", error ); - encryption_method_is_set = result; - /* Test error cases */ result = libbde_volume_get_encryption_method( @@ -2271,25 +3171,23 @@ libcerror_error_free( &error ); - if( encryption_method_is_set != 0 ) - { - result = libbde_volume_get_encryption_method( - volume, - NULL, - &error ); + result = libbde_volume_get_encryption_method( + volume, + NULL, + &error ); - BDE_TEST_ASSERT_EQUAL_INT( - "result", - result, - -1 ); + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); - BDE_TEST_ASSERT_IS_NOT_NULL( - "error", - error ); + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); - libcerror_error_free( - &error ); - } return( 1 ); on_error: @@ -2309,7 +3207,6 @@ { libcerror_error_t *error = NULL; uint64_t creation_time = 0; - int creation_time_is_set = 0; int result = 0; /* Test regular cases @@ -2319,17 +3216,15 @@ &creation_time, &error ); - BDE_TEST_ASSERT_NOT_EQUAL_INT( + BDE_TEST_ASSERT_EQUAL_INT( "result", result, - -1 ); + 1 ); BDE_TEST_ASSERT_IS_NULL( "error", error ); - creation_time_is_set = result; - /* Test error cases */ result = libbde_volume_get_creation_time( @@ -2349,25 +3244,23 @@ libcerror_error_free( &error ); - if( creation_time_is_set != 0 ) - { - result = libbde_volume_get_creation_time( - volume, - NULL, - &error ); + result = libbde_volume_get_creation_time( + volume, + NULL, + &error ); - BDE_TEST_ASSERT_EQUAL_INT( - "result", - result, - -1 ); + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); - BDE_TEST_ASSERT_IS_NOT_NULL( - "error", - error ); + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); - libcerror_error_free( - &error ); - } return( 1 ); on_error: @@ -2788,10 +3681,10 @@ &number_of_key_protectors, &error ); - BDE_TEST_ASSERT_NOT_EQUAL_INT( + BDE_TEST_ASSERT_EQUAL_INT( "result", result, - -1 ); + 1 ); BDE_TEST_ASSERT_IS_NULL( "error", @@ -2844,6 +3737,264 @@ return( 0 ); } +/* Tests the libbde_volume_get_key_protector_by_index function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_get_key_protector_by_index( + libbde_volume_t *volume ) +{ + libbde_key_protector_t *key_protector = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = libbde_volume_get_key_protector_by_index( + volume, + 0, + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "key_protector", + key_protector ); + + result = libbde_key_protector_free( + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_volume_get_key_protector_by_index( + NULL, + 0, + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "key_protector", + key_protector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_get_key_protector_by_index( + volume, + -1, + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "key_protector", + key_protector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_get_key_protector_by_index( + volume, + 0, + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "key_protector", + key_protector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( key_protector != NULL ) + { + libbde_key_protector_free( + &key_protector, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_volume_get_key_protector function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_get_key_protector( + libbde_volume_t *volume ) +{ + libbde_key_protector_t *key_protector = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Test regular cases + */ + result = libbde_volume_get_key_protector( + volume, + 0, + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "key_protector", + key_protector ); + + result = libbde_key_protector_free( + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_volume_get_key_protector( + NULL, + 0, + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "key_protector", + key_protector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_get_key_protector( + volume, + -1, + &key_protector, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "key_protector", + key_protector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_get_key_protector( + volume, + 0, + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "key_protector", + key_protector ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( key_protector != NULL ) + { + libbde_key_protector_free( + &key_protector, + NULL ); + } + return( 0 ); +} + /* The main program */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) @@ -2862,6 +4013,7 @@ system_character_t *option_offset = NULL; system_character_t *option_password = NULL; system_character_t *option_recovery_password = NULL; + system_character_t *option_startup_key = NULL; system_character_t *source = NULL; system_integer_t option = 0; size_t string_length = 0; @@ -2871,7 +4023,7 @@ while( ( option = bde_test_getopt( argc, argv, - _SYSTEM_STRING( "o:p:r:" ) ) ) != (system_integer_t) -1 ) + _SYSTEM_STRING( "o:p:r:s:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { @@ -2898,6 +4050,11 @@ option_recovery_password = optarg; break; + + case (system_integer_t) 's': + option_startup_key = optarg; + + break; } } if( optind < argc ) @@ -3021,7 +4178,8 @@ bde_test_volume_open, source, option_password, - option_recovery_password ); + option_recovery_password, + option_startup_key ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) @@ -3030,7 +4188,8 @@ bde_test_volume_open_wide, source, option_password, - option_recovery_password ); + option_recovery_password, + option_startup_key ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ @@ -3039,7 +4198,8 @@ bde_test_volume_open_file_io_handle, source, option_password, - option_recovery_password ); + option_recovery_password, + option_startup_key ); BDE_TEST_RUN( "libbde_volume_close", @@ -3050,7 +4210,9 @@ bde_test_volume_open_close, source, option_password, - option_recovery_password ); + option_recovery_password, + option_startup_key ); + } if( result != 0 ) { @@ -3061,6 +4223,7 @@ file_io_handle, option_password, option_recovery_password, + option_startup_key, &error ); BDE_TEST_ASSERT_EQUAL_INT( @@ -3089,7 +4252,19 @@ #endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ - /* TODO: add tests for libbde_volume_is_locked */ + BDE_TEST_RUN_WITH_ARGS( + "libbde_volume_is_locked", + bde_test_volume_is_locked, + volume ); + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN_WITH_ARGS( + "libbde_internal_volume_read_buffer_from_file_io_handle", + bde_test_internal_volume_read_buffer_from_file_io_handle, + volume ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ BDE_TEST_RUN_WITH_ARGS( "libbde_volume_read_buffer", @@ -3105,6 +4280,12 @@ /* TODO: add tests for libbde_volume_write_buffer_at_offset */ +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + /* TODO: add tests for libbde_internal_volume_seek_offset */ + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + BDE_TEST_RUN_WITH_ARGS( "libbde_volume_seek_offset", bde_test_volume_seek_offset, @@ -3157,7 +4338,15 @@ bde_test_volume_get_number_of_key_protectors, volume ); - /* TODO: add tests for libbde_volume_get_key_protector */ + BDE_TEST_RUN_WITH_ARGS( + "libbde_volume_get_key_protector_by_index", + bde_test_volume_get_key_protector_by_index, + volume ); + + BDE_TEST_RUN_WITH_ARGS( + "libbde_volume_get_key_protector", + bde_test_volume_get_key_protector, + volume ); /* TODO: add tests for libbde_volume_set_keys */ @@ -3171,8 +4360,12 @@ /* TODO: add tests for libbde_volume_read_startup_key */ +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + /* TODO: add tests for libbde_volume_read_startup_key_wide */ +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + /* TODO: add tests for libbde_volume_read_startup_key_file_io_handle */ /* Clean up @@ -3193,7 +4386,9 @@ BDE_TEST_ASSERT_IS_NULL( "error", error ); - + } + if( file_io_handle != NULL ) + { result = libbfio_handle_free( &file_io_handle, &error ); diff -Nru libbde-20190102/tests/bde_test_volume_header.c libbde-20240223/tests/bde_test_volume_header.c --- libbde-20190102/tests/bde_test_volume_header.c 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/bde_test_volume_header.c 2024-02-23 02:48:06.000000000 +0000 @@ -0,0 +1,751 @@ +/* + * Library volume_header type test program + * + * Copyright (C) 2011-2024, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "bde_test_functions.h" +#include "bde_test_libbfio.h" +#include "bde_test_libcerror.h" +#include "bde_test_libbde.h" +#include "bde_test_macros.h" +#include "bde_test_memory.h" +#include "bde_test_unused.h" + +#include "../libbde/libbde_volume_header.h" + +uint8_t bde_test_volume_header_data1[ 512 ] = { + 0xeb, 0x58, 0x90, 0x2d, 0x46, 0x56, 0x45, 0x2d, 0x46, 0x53, 0x2d, 0x00, 0x02, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x3f, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x20, + 0x20, 0x20, 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xf4, + 0x7b, 0x8e, 0xc1, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0xa0, 0xfb, 0x7d, 0xb4, 0x7d, 0x8b, 0xf0, 0xac, + 0x98, 0x40, 0x74, 0x0c, 0x48, 0x74, 0x0e, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xef, + 0xa0, 0xfd, 0x7d, 0xeb, 0xe6, 0xcd, 0x16, 0xcd, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0xd6, 0x67, 0x49, 0x29, 0x2e, 0xd8, 0x4a, 0x83, 0x99, 0xf6, 0xa3, 0x39, 0xe3, 0xd0, 0x01, + 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x95, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xa0, 0x1a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x73, 0x20, 0x6f, + 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2e, 0xff, 0x0d, + 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x50, 0x72, + 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, + 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0x2c, 0x55, 0xaa }; + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +/* Tests the libbde_volume_header_initialize function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_header_initialize( + void ) +{ + libbde_volume_header_t *volume_header = NULL; + libcerror_error_t *error = NULL; + int result = 0; + +#if defined( HAVE_BDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libbde_volume_header_initialize( + &volume_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_volume_header_free( + &volume_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_volume_header_initialize( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + volume_header = (libbde_volume_header_t *) 0x12345678UL; + + result = libbde_volume_header_initialize( + &volume_header, + &error ); + + volume_header = NULL; + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +#if defined( HAVE_BDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libbde_volume_header_initialize with malloc failing + */ + bde_test_malloc_attempts_before_fail = test_number; + + result = libbde_volume_header_initialize( + &volume_header, + &error ); + + if( bde_test_malloc_attempts_before_fail != -1 ) + { + bde_test_malloc_attempts_before_fail = -1; + + if( volume_header != NULL ) + { + libbde_volume_header_free( + &volume_header, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libbde_volume_header_initialize with memset failing + */ + bde_test_memset_attempts_before_fail = test_number; + + result = libbde_volume_header_initialize( + &volume_header, + &error ); + + if( bde_test_memset_attempts_before_fail != -1 ) + { + bde_test_memset_attempts_before_fail = -1; + + if( volume_header != NULL ) + { + libbde_volume_header_free( + &volume_header, + NULL ); + } + } + else + { + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_BDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( volume_header != NULL ) + { + libbde_volume_header_free( + &volume_header, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_volume_header_free function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_header_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = libbde_volume_header_free( + NULL, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* Tests the libbde_volume_header_read_data function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_header_read_data( + void ) +{ + libbde_volume_header_t *volume_header = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_volume_header_initialize( + &volume_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_volume_header_read_data( + volume_header, + bde_test_volume_header_data1, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_volume_header_read_data( + NULL, + bde_test_volume_header_data1, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_header_read_data( + volume_header, + NULL, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_header_read_data( + volume_header, + bde_test_volume_header_data1, + (size_t) SSIZE_MAX + 1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_header_read_data( + volume_header, + bde_test_volume_header_data1, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + +/* TODO: add test for error case where signature is invalid + */ + + /* Clean up + */ + result = libbde_volume_header_free( + &volume_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( volume_header != NULL ) + { + libbde_volume_header_free( + &volume_header, + NULL ); + } + return( 0 ); +} + +/* Tests the libbde_volume_header_read_file_io_handle function + * Returns 1 if successful or 0 if not + */ +int bde_test_volume_header_read_file_io_handle( + void ) +{ + libbde_volume_header_t *volume_header = NULL; + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; + int result = 0; + + /* Initialize test + */ + result = libbde_volume_header_initialize( + &volume_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Initialize file IO handle + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_volume_header_data1, + 512, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + result = libbde_volume_header_read_file_io_handle( + volume_header, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libbde_volume_header_read_file_io_handle( + NULL, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_header_read_file_io_handle( + volume_header, + NULL, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libbde_volume_header_read_file_io_handle( + volume_header, + file_io_handle, + -1, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up file IO handle + */ + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test data too small + */ + result = bde_test_open_file_io_handle( + &file_io_handle, + bde_test_volume_header_data1, + 8, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbde_volume_header_read_file_io_handle( + volume_header, + file_io_handle, + 0, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + BDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = bde_test_close_file_io_handle( + &file_io_handle, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 0 ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + +/* TODO: add test for data invalid + */ + + /* Clean up + */ + result = libbde_volume_header_free( + &volume_header, + &error ); + + BDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + BDE_TEST_ASSERT_IS_NULL( + "volume_header", + volume_header ); + + BDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } + if( volume_header != NULL ) + { + libbde_volume_header_free( + &volume_header, + NULL ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc BDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] BDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + BDE_TEST_UNREFERENCED_PARAMETER( argc ) + BDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + + BDE_TEST_RUN( + "libbde_volume_header_initialize", + bde_test_volume_header_initialize ); + + BDE_TEST_RUN( + "libbde_volume_header_free", + bde_test_volume_header_free ); + + BDE_TEST_RUN( + "libbde_volume_header_read_data", + bde_test_volume_header_read_data ); + + BDE_TEST_RUN( + "libbde_volume_header_read_file_io_handle", + bde_test_volume_header_read_file_io_handle ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +#if defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) + +on_error: + return( EXIT_FAILURE ); + +#endif /* defined( __GNUC__ ) && !defined( LIBBDE_DLL_IMPORT ) */ +} + diff -Nru libbde-20190102/tests/bde_test_volume_master_key.c libbde-20240223/tests/bde_test_volume_master_key.c --- libbde-20190102/tests/bde_test_volume_master_key.c 2019-01-02 14:15:53.000000000 +0000 +++ libbde-20240223/tests/bde_test_volume_master_key.c 2024-02-23 02:48:06.000000000 +0000 @@ -1,22 +1,22 @@ /* * Library volume_master_key type test program * - * Copyright (C) 2011-2019, Joachim Metz + * Copyright (C) 2011-2024, Joachim Metz * * Refer to AUTHORS for acknowledgements. * - * This software is free software: you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This software is distributed in the hope that it will be useful, + * This program 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 General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . + * along with this program. If not, see . */ #include @@ -113,6 +113,8 @@ &volume_master_key, &error ); + volume_master_key = NULL; + BDE_TEST_ASSERT_EQUAL_INT( "result", result, @@ -125,8 +127,6 @@ libcerror_error_free( &error ); - volume_master_key = NULL; - #if defined( HAVE_BDE_TEST_MEMORY ) for( test_number = 0; diff -Nru libbde-20190102/tests/pybde_test_support.py libbde-20240223/tests/pybde_test_support.py --- libbde-20190102/tests/pybde_test_support.py 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/pybde_test_support.py 2024-02-23 02:48:27.000000000 +0000 @@ -2,23 +2,26 @@ # # Python-bindings support functions test script # -# Copyright (C) 2011-2019, Joachim Metz +# Copyright (C) 2011-2024, Joachim Metz # # Refer to AUTHORS for acknowledgements. # -# This software is free software: you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# This software is distributed in the hope that it will be useful, +# This program 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 General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License -# along with this software. If not, see . +# along with this program. If not, see . +import argparse +import os +import sys import unittest import pybde @@ -30,10 +33,76 @@ def test_get_version(self): """Tests the get_version function.""" version = pybde.get_version() + self.assertIsNotNone(version) - # TODO: check version. - # self.assertEqual(version, "00000000") + def test_check_volume_signature(self): + """Tests the check_volume_signature function.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + result = pybde.check_volume_signature(test_source) + self.assertTrue(result) + + def test_check_volume_signature_file_object(self): + """Tests the check_volume_signature_file_object function.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + with open(test_source, "rb") as file_object: + result = pybde.check_volume_signature_file_object(file_object) + self.assertTrue(result) + + def test_open(self): + """Tests the open function.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.open(test_source) + self.assertIsNotNone(bde_volume) + + bde_volume.close() + + with self.assertRaises(TypeError): + pybde.open(None) + + with self.assertRaises(ValueError): + pybde.open(test_source, mode="w") + + def test_open_file_object(self): + """Tests the open_file_object function.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + if not os.path.isfile(test_source): + raise unittest.SkipTest("source not a regular file") + + with open(test_source, "rb") as file_object: + bde_volume = pybde.open_file_object(file_object) + self.assertIsNotNone(bde_volume) + + bde_volume.close() + + with self.assertRaises(TypeError): + pybde.open_file_object(None) + + with self.assertRaises(ValueError): + pybde.open_file_object(file_object, mode="w") if __name__ == "__main__": - unittest.main(verbosity=2) + argument_parser = argparse.ArgumentParser() + + argument_parser.add_argument( + "source", nargs="?", action="store", metavar="PATH", + default=None, help="path of the source file.") + + options, unknown_options = argument_parser.parse_known_args() + unknown_options.insert(0, sys.argv[0]) + + setattr(unittest, "source", options.source) + + unittest.main(argv=unknown_options, verbosity=2) diff -Nru libbde-20190102/tests/pybde_test_volume.py libbde-20240223/tests/pybde_test_volume.py --- libbde-20190102/tests/pybde_test_volume.py 2019-01-02 14:17:03.000000000 +0000 +++ libbde-20240223/tests/pybde_test_volume.py 2024-02-23 02:48:27.000000000 +0000 @@ -2,31 +2,151 @@ # # Python-bindings volume type test script # -# Copyright (C) 2011-2019, Joachim Metz +# Copyright (C) 2011-2024, Joachim Metz # # Refer to AUTHORS for acknowledgements. # -# This software is free software: you can redistribute it and/or modify +# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# This software is distributed in the hope that it will be useful, +# This program 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 General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License -# along with this software. If not, see . +# along with this program. If not, see . import argparse import os +import random import sys import unittest import pybde +class DataRangeFileObject(object): + """File-like object that maps an in-file data range.""" + + def __init__(self, path, range_offset, range_size): + """Initializes a file-like object. + + Args: + path (str): path of the file that contains the data range. + range_offset (int): offset where the data range starts. + range_size (int): size of the data range starts, or None to indicate + the range should continue to the end of the parent file-like object. + """ + super(DataRangeFileObject, self).__init__() + self._current_offset = 0 + self._file_object = open(path, "rb") + self._range_offset = range_offset + self._range_size = range_size + + def __enter__(self): + """Enters a with statement.""" + return self + + def __exit__(self, unused_type, unused_value, unused_traceback): + """Exits a with statement.""" + return + + def close(self): + """Closes the file-like object.""" + if self._file_object: + self._file_object.close() + self._file_object = None + + def get_offset(self): + """Retrieves the current offset into the file-like object. + + Returns: + int: current offset in the data range. + """ + return self._current_offset + + def get_size(self): + """Retrieves the size of the file-like object. + + Returns: + int: size of the data range. + """ + return self._range_size + + def read(self, size=None): + """Reads a byte string from the file-like object at the current offset. + + The function will read a byte string of the specified size or + all of the remaining data if no size was specified. + + Args: + size (Optional[int]): number of bytes to read, where None is all + remaining data. + + Returns: + bytes: data read. + + Raises: + IOError: if the read failed. + """ + if (self._range_offset < 0 or + (self._range_size is not None and self._range_size < 0)): + raise IOError("Invalid data range.") + + if self._current_offset < 0: + raise IOError( + "Invalid current offset: {0:d} value less than zero.".format( + self._current_offset)) + + if (self._range_size is not None and + self._current_offset >= self._range_size): + return b"" + + if size is None: + size = self._range_size + if self._range_size is not None and self._current_offset + size > self._range_size: + size = self._range_size - self._current_offset + + self._file_object.seek( + self._range_offset + self._current_offset, os.SEEK_SET) + + data = self._file_object.read(size) + + self._current_offset += len(data) + + return data + + def seek(self, offset, whence=os.SEEK_SET): + """Seeks to an offset within the file-like object. + + Args: + offset (int): offset to seek to. + whence (Optional(int)): value that indicates whether offset is an absolute + or relative position within the file. + + Raises: + IOError: if the seek failed. + """ + if self._current_offset < 0: + raise IOError( + "Invalid current offset: {0:d} value less than zero.".format( + self._current_offset)) + + if whence == os.SEEK_CUR: + offset += self._current_offset + elif whence == os.SEEK_END: + offset += self._range_size + elif whence != os.SEEK_SET: + raise IOError("Unsupported whence.") + if offset < 0: + raise IOError("Invalid offset value less than zero.") + + self._current_offset = offset + + class VolumeTypeTests(unittest.TestCase): """Tests the volume type.""" @@ -38,21 +158,32 @@ def test_open(self): """Tests the open function.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + test_offset = getattr(unittest, "offset", None) + if test_offset: + raise unittest.SkipTest("source defines offset") bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) - bde_volume.open(unittest.source) + bde_volume.open(test_source) with self.assertRaises(IOError): - bde_volume.open(unittest.source) + bde_volume.open(test_source) bde_volume.close() @@ -60,122 +191,247 @@ bde_volume.open(None) with self.assertRaises(ValueError): - bde_volume.open(unittest.source, mode="w") + bde_volume.open(test_source, mode="w") def test_open_file_object(self): """Tests the open_file_object function.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") - file_object = open(unittest.source, "rb") + if not os.path.isfile(test_source): + raise unittest.SkipTest("source not a regular file") bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) - bde_volume.open_file_object(file_object) + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) - # TODO: fix - # with self.assertRaises(IOError): - # bde_volume.open_file_object(file_object) + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) - bde_volume.close() + test_offset = getattr(unittest, "offset", None) - # TODO: change IOError into TypeError - with self.assertRaises(IOError): - bde_volume.open_file_object(None) + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: - with self.assertRaises(ValueError): - bde_volume.open_file_object(file_object, mode="w") + bde_volume.open_file_object(file_object) + + with self.assertRaises(IOError): + bde_volume.open_file_object(file_object) + + bde_volume.close() + + with self.assertRaises(TypeError): + bde_volume.open_file_object(None) + + with self.assertRaises(ValueError): + bde_volume.open_file_object(file_object, mode="w") def test_close(self): """Tests the close function.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") bde_volume = pybde.volume() - # TODO: fix - # with self.assertRaises(IOError): - # bde_volume.close() + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + with self.assertRaises(IOError): + bde_volume.close() def test_open_close(self): """Tests the open and close functions.""" - if not unittest.source: + test_source = getattr(unittest, "source", None) + if not test_source: return + test_offset = getattr(unittest, "offset", None) + if test_offset: + raise unittest.SkipTest("source defines offset") + bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) # Test open and close. - bde_volume.open(unittest.source) + bde_volume.open(test_source) bde_volume.close() # Test open and close a second time to validate clean up on close. - bde_volume.open(unittest.source) + bde_volume.open(test_source) bde_volume.close() - file_object = open(unittest.source, "rb") + if os.path.isfile(test_source): + with open(test_source, "rb") as file_object: - # Test open_file_object and close. - bde_volume.open_file_object(file_object) - bde_volume.close() + # Test open_file_object and close. + bde_volume.open_file_object(file_object) + bde_volume.close() + + # Test open_file_object and close a second time to validate clean up on close. + bde_volume.open_file_object(file_object) + bde_volume.close() + + # Test open_file_object and close and dereferencing file_object. + bde_volume.open_file_object(file_object) + del file_object + bde_volume.close() + + def test_is_locked(self): + """Tests the is_locked function.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + test_offset = getattr(unittest, "offset", None) + if test_offset: + raise unittest.SkipTest("source defines offset") - # Test open_file_object and close a second time to validate clean up on close. - bde_volume.open_file_object(file_object) - bde_volume.close() + bde_volume = pybde.volume() + + bde_volume.open(test_source) + + result = bde_volume.is_locked() + self.assertTrue(result) - # Test open_file_object and close and dereferencing file_object. - bde_volume.open_file_object(file_object) - del file_object bde_volume.close() + password = getattr(unittest, "password", None) + recovery_password = getattr(unittest, "recovery_password", None) + + if password or recovery_password: + bde_volume = pybde.volume() + + if password: + bde_volume.set_password(password) + + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + bde_volume.open(test_source) + + result = bde_volume.is_locked() + self.assertFalse(result) + + bde_volume.close() + def test_read_buffer(self): """Tests the read_buffer function.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + test_offset = getattr(unittest, "offset", None) + if test_offset: + raise unittest.SkipTest("source defines offset") bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) - bde_volume.open(unittest.source) + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) - file_size = bde_volume.get_size() + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) - # Test normal read. - data = bde_volume.read_buffer(size=4096) + bde_volume.open(test_source) - self.assertIsNotNone(data) - self.assertEqual(len(data), min(file_size, 4096)) + size = bde_volume.get_size() + + if size < 4096: + # Test read without maximum size. + bde_volume.seek_offset(0, os.SEEK_SET) - if file_size < 4096: data = bde_volume.read_buffer() self.assertIsNotNone(data) - self.assertEqual(len(data), file_size) + self.assertEqual(len(data), size) - # Test read beyond file size. - if file_size > 16: - bde_volume.seek_offset(-16, os.SEEK_END) + # Test read with maximum size. + bde_volume.seek_offset(0, os.SEEK_SET) + + data = bde_volume.read_buffer(size=4096) + + self.assertIsNotNone(data) + self.assertEqual(len(data), min(size, 4096)) + + if size > 8: + bde_volume.seek_offset(-8, os.SEEK_END) + + # Read buffer on size boundary. + data = bde_volume.read_buffer(size=4096) + + self.assertIsNotNone(data) + self.assertEqual(len(data), 8) + # Read buffer beyond size boundary. data = bde_volume.read_buffer(size=4096) self.assertIsNotNone(data) - self.assertEqual(len(data), 16) + self.assertEqual(len(data), 0) + + # Stress test read buffer. + bde_volume.seek_offset(0, os.SEEK_SET) + + remaining_size = size + + for _ in range(1024): + read_size = int(random.random() * 4096) + + data = bde_volume.read_buffer(size=read_size) + + self.assertIsNotNone(data) + + data_size = len(data) + + if read_size > remaining_size: + read_size = remaining_size + + self.assertEqual(data_size, read_size) + + remaining_size -= data_size + + if not remaining_size: + bde_volume.seek_offset(0, os.SEEK_SET) + + remaining_size = size with self.assertRaises(ValueError): bde_volume.read_buffer(size=-1) @@ -188,60 +444,114 @@ def test_read_buffer_file_object(self): """Tests the read_buffer function on a file-like object.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") - file_object = open(unittest.source, "rb") + if not os.path.isfile(test_source): + raise unittest.SkipTest("source not a regular file") bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) - bde_volume.open_file_object(file_object) + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) - file_size = bde_volume.get_size() + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) - # Test normal read. - data = bde_volume.read_buffer(size=4096) + test_offset = getattr(unittest, "offset", None) - self.assertIsNotNone(data) - self.assertEqual(len(data), min(file_size, 4096)) + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + bde_volume.open_file_object(file_object) - bde_volume.close() + size = bde_volume.get_size() + + # Test normal read. + data = bde_volume.read_buffer(size=4096) + + self.assertIsNotNone(data) + self.assertEqual(len(data), min(size, 4096)) + + bde_volume.close() def test_read_buffer_at_offset(self): """Tests the read_buffer_at_offset function.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + test_offset = getattr(unittest, "offset", None) + if test_offset: + raise unittest.SkipTest("source defines offset") bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) - bde_volume.open(unittest.source) + bde_volume.open(test_source) - file_size = bde_volume.get_size() + size = bde_volume.get_size() # Test normal read. data = bde_volume.read_buffer_at_offset(4096, 0) self.assertIsNotNone(data) - self.assertEqual(len(data), min(file_size, 4096)) + self.assertEqual(len(data), min(size, 4096)) - # Test read beyond file size. - if file_size > 16: - data = bde_volume.read_buffer_at_offset(4096, file_size - 16) + if size > 8: + # Read buffer on size boundary. + data = bde_volume.read_buffer_at_offset(4096, size - 8) self.assertIsNotNone(data) - self.assertEqual(len(data), 16) + self.assertEqual(len(data), 8) + + # Read buffer beyond size boundary. + data = bde_volume.read_buffer_at_offset(4096, size + 8) + + self.assertIsNotNone(data) + self.assertEqual(len(data), 0) + + # Stress test read buffer. + for _ in range(1024): + random_number = random.random() + + media_offset = int(random_number * size) + read_size = int(random_number * 4096) + + data = bde_volume.read_buffer_at_offset(read_size, media_offset) + + self.assertIsNotNone(data) + + remaining_size = size - media_offset + + data_size = len(data) + + if read_size > remaining_size: + read_size = remaining_size + + self.assertEqual(data_size, read_size) + + remaining_size -= data_size + + if not remaining_size: + bde_volume.seek_offset(0, os.SEEK_SET) with self.assertRaises(ValueError): bde_volume.read_buffer_at_offset(-1, 0) @@ -257,20 +567,31 @@ def test_seek_offset(self): """Tests the seek_offset function.""" - if not unittest.source: - return + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + test_offset = getattr(unittest, "offset", None) + if test_offset: + raise unittest.SkipTest("source defines offset") bde_volume = pybde.volume() - if unittest.password: - bde_volume.set_password(unittest.password) - if unittest.recovery_password: - bde_volume.set_recovery_password( - unittest.recovery_password) + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) - bde_volume.open(unittest.source) + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) - file_size = bde_volume.get_size() + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + bde_volume.open(test_source) + + size = bde_volume.get_size() bde_volume.seek_offset(16, os.SEEK_SET) @@ -287,15 +608,16 @@ offset = bde_volume.get_offset() self.assertEqual(offset, 16) - bde_volume.seek_offset(-16, os.SEEK_END) + if size > 16: + bde_volume.seek_offset(-16, os.SEEK_END) - offset = bde_volume.get_offset() - self.assertEqual(offset, file_size - 16) + offset = bde_volume.get_offset() + self.assertEqual(offset, size - 16) bde_volume.seek_offset(16, os.SEEK_END) offset = bde_volume.get_offset() - self.assertEqual(offset, file_size + 16) + self.assertEqual(offset, size + 16) # TODO: change IOError into ValueError with self.assertRaises(IOError): @@ -303,11 +625,11 @@ # TODO: change IOError into ValueError with self.assertRaises(IOError): - bde_volume.seek_offset(-32 - file_size, os.SEEK_CUR) + bde_volume.seek_offset(-32 - size, os.SEEK_CUR) # TODO: change IOError into ValueError with self.assertRaises(IOError): - bde_volume.seek_offset(-32 - file_size, os.SEEK_END) + bde_volume.seek_offset(-32 - size, os.SEEK_END) # TODO: change IOError into ValueError with self.assertRaises(IOError): @@ -319,27 +641,243 @@ with self.assertRaises(IOError): bde_volume.seek_offset(16, os.SEEK_SET) + def test_get_offset(self): + """Tests the get_offset function.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.volume() + + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + test_offset = getattr(unittest, "offset", None) + + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + + bde_volume.open_file_object(file_object) + + offset = bde_volume.get_offset() + self.assertIsNotNone(offset) + + bde_volume.close() + + def test_get_size(self): + """Tests the get_size function and size property.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.volume() + + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + test_offset = getattr(unittest, "offset", None) + + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + + bde_volume.open_file_object(file_object) + + size = bde_volume.get_size() + self.assertIsNotNone(size) + + self.assertIsNotNone(bde_volume.size) + + bde_volume.close() + + def test_get_encryption_method(self): + """Tests the get_encryption_method function and encryption_method property.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.volume() + + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + test_offset = getattr(unittest, "offset", None) + + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + + bde_volume.open_file_object(file_object) + + encryption_method = bde_volume.get_encryption_method() + self.assertIsNotNone(encryption_method) + + self.assertIsNotNone(bde_volume.encryption_method) + + bde_volume.close() + + def test_get_creation_time(self): + """Tests the get_creation_time function and creation_time property.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.volume() + + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + test_offset = getattr(unittest, "offset", None) + + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + + bde_volume.open_file_object(file_object) + + creation_time = bde_volume.get_creation_time() + self.assertIsNotNone(creation_time) + + self.assertIsNotNone(bde_volume.creation_time) + + bde_volume.close() + + def test_get_description(self): + """Tests the get_description function and description property.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.volume() + + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + test_offset = getattr(unittest, "offset", None) + + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + + bde_volume.open_file_object(file_object) + + description = bde_volume.get_description() + self.assertIsNotNone(description) + + self.assertIsNotNone(bde_volume.description) + + bde_volume.close() + + def test_get_number_of_key_protectors(self): + """Tests the get_number_of_key_protectors function and number_of_key_protectors property.""" + test_source = getattr(unittest, "source", None) + if not test_source: + raise unittest.SkipTest("missing source") + + bde_volume = pybde.volume() + + password = getattr(unittest, "password", None) + if password: + bde_volume.set_password(password) + + recovery_password = getattr(unittest, "recovery_password", None) + if recovery_password: + bde_volume.set_recovery_password(recovery_password) + + startup_key = getattr(unittest, "startup_key", None) + if startup_key: + bde_volume.read_startup_key(startup_key) + + test_offset = getattr(unittest, "offset", None) + + with DataRangeFileObject( + test_source, test_offset or 0, None) as file_object: + + bde_volume.open_file_object(file_object) + + number_of_key_protectors = bde_volume.get_number_of_key_protectors() + self.assertIsNotNone(number_of_key_protectors) + + self.assertIsNotNone(bde_volume.number_of_key_protectors) + + bde_volume.close() + if __name__ == "__main__": argument_parser = argparse.ArgumentParser() argument_parser.add_argument( - "source", nargs="?", action="store", metavar="PATH", - default=None, help="The path of the source file.") + "-o", "--offset", dest="offset", action="store", default=None, + type=int, help="offset of the source file.") - argument_parser.add_argument( - "-p", dest="password", action="store", metavar="PASSWORD", - default=None, help="The password.") - - argument_parser.add_argument( - "-r", dest="recovery_password", action="store", metavar="PASSWORD", - default=None, help="The recovery password.") + argument_parser.add_argument( + "-p", "--password", dest="password", action="store", metavar="PASSWORD", + default=None, type=str, help="password to unlock the source file.") + + argument_parser.add_argument( + "-r", "--recovery-password", "--recovery_password", + dest="recovery_password", action="store", metavar="PASSWORD", + default=None, type=str, help=( + "recovery password to unlock the source file.")) + + argument_parser.add_argument( + "-s", "--startup-key", "--startup_key", dest="startup_key", + action="store", metavar="PATH", default=None, type=str, help=( + "path of the file containing the startup key to unlock the source " + "file.")) + + argument_parser.add_argument( + "source", nargs="?", action="store", metavar="PATH", + default=None, help="path of the source file.") options, unknown_options = argument_parser.parse_known_args() unknown_options.insert(0, sys.argv[0]) + setattr(unittest, "offset", options.offset) setattr(unittest, "password", options.password) - setattr(unittest, "source", options.source) setattr(unittest, "recovery_password", options.recovery_password) + setattr(unittest, "startup_key", options.startup_key) + setattr(unittest, "source", options.source) unittest.main(argv=unknown_options, verbosity=2) diff -Nru libbde-20190102/tests/test_bdeinfo.sh libbde-20240223/tests/test_bdeinfo.sh --- libbde-20190102/tests/test_bdeinfo.sh 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/tests/test_bdeinfo.sh 2024-02-23 02:47:19.000000000 +0000 @@ -1,18 +1,19 @@ -#!/bin/bash +#!/usr/bin/env bash # Info tool testing script # -# Version: 20190101 +# Version: 20231005 EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; -OPTION_SETS="password recovery_password"; -OPTIONS=(); +PROFILES=("bdeinfo"); +OPTIONS_PER_PROFILE=(""); +OPTION_SETS=("keys" "password" "recovery_password" "startup_key"); INPUT_GLOB="*"; -if ! test -z ${SKIP_TOOLS_TESTS}; +if test -n "${SKIP_TOOLS_TESTS}" || test -n "${SKIP_TOOLS_END_TO_END_TESTS}"; then exit ${EXIT_IGNORE}; fi @@ -49,74 +50,99 @@ if ! test -d "input"; then - echo "Test input directory: input not found."; + echo "Test input directory not found."; - return ${EXIT_IGNORE}; + exit ${EXIT_IGNORE}; fi RESULT=`ls input/* | tr ' ' '\n' | wc -l`; if test ${RESULT} -eq ${EXIT_SUCCESS}; then - echo "No files or directories found in the test input directory: input"; + echo "No files or directories found in the test input directory"; - return ${EXIT_IGNORE}; + exit ${EXIT_IGNORE}; fi -TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "bdeinfo"); +for PROFILE_INDEX in ${!PROFILES[*]}; +do + TEST_PROFILE=${PROFILES[${PROFILE_INDEX}]}; -IGNORE_LIST=$(read_ignore_list "${TEST_PROFILE_DIRECTORY}"); + TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "${TEST_PROFILE}"); -RESULT=${EXIT_SUCCESS}; + IGNORE_LIST=$(read_ignore_list "${TEST_PROFILE_DIRECTORY}"); -for TEST_SET_INPUT_DIRECTORY in input/*; -do - if ! test -d "${TEST_SET_INPUT_DIRECTORY}"; - then - continue; - fi - if check_for_directory_in_ignore_list "${TEST_SET_INPUT_DIRECTORY}" "${IGNORE_LIST}"; - then - continue; - fi - - TEST_SET_DIRECTORY=$(get_test_set_directory "${TEST_PROFILE_DIRECTORY}" "${TEST_SET_INPUT_DIRECTORY}"); - - OLDIFS=${IFS}; - - # IFS="\n"; is not supported by all platforms. - IFS=" -"; - - if test -f "${TEST_SET_DIRECTORY}/files"; - then - for INPUT_FILE in `cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"`; + IFS=" " read -a PROFILE_OPTIONS <<< ${OPTIONS_PER_PROFILE[${PROFILE_INDEX}]}; + + RESULT=${EXIT_SUCCESS}; + + for TEST_SET_INPUT_DIRECTORY in input/*; + do + if ! test -d "${TEST_SET_INPUT_DIRECTORY}"; + then + continue; + fi + TEST_SET=`basename ${TEST_SET_INPUT_DIRECTORY}`; + + if check_for_test_set_in_ignore_list "${TEST_SET}" "${IGNORE_LIST}"; + then + continue; + fi + TEST_SET_DIRECTORY=$(get_test_set_directory "${TEST_PROFILE_DIRECTORY}" "${TEST_SET_INPUT_DIRECTORY}"); + + RESULT=${EXIT_SUCCESS}; + + if test -f "${TEST_SET_DIRECTORY}/files"; + then + IFS="" read -a INPUT_FILES <<< $(cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"); + else + IFS="" read -a INPUT_FILES <<< $(ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}); + fi + for INPUT_FILE in "${INPUT_FILES[@]}"; do - run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "bdeinfo" "with_stdout_reference" "${OPTION_SETS}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${OPTIONS[@]}"; - RESULT=$?; + TESTED_WITH_OPTIONS=0; - if test ${RESULT} -ne ${EXIT_SUCCESS}; + for OPTION_SET in ${OPTION_SETS[@]}; + do + TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + + if test -f ${TEST_DATA_OPTION_FILE}; + then + TESTED_WITH_OPTIONS=1; + + IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + + run_test_on_input_file "${TEST_SET_DIRECTORY}" "bdeinfo" "with_stdout_reference" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}" "${OPTIONS[@]}"; + RESULT=$?; + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + fi + done + + if test ${TESTED_WITH_OPTIONS} -eq 0; then - break; + run_test_on_input_file "${TEST_SET_DIRECTORY}" "bdeinfo" "with_stdout_reference" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${PROFILE_OPTIONS[@]}"; + RESULT=$?; fi - done - else - for INPUT_FILE in `ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}`; - do - run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "bdeinfo" "with_stdout_reference" "${OPTION_SETS}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${OPTIONS[@]}"; - RESULT=$?; if test ${RESULT} -ne ${EXIT_SUCCESS}; then break; fi done - fi - IFS=${OLDIFS}; - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - break; - fi + # Ignore failures due to corrupted data. + if test "${TEST_SET}" = "corrupted"; + then + RESULT=${EXIT_SUCCESS}; + fi + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + done done exit ${RESULT}; diff -Nru libbde-20190102/tests/test_library.sh libbde-20240223/tests/test_library.sh --- libbde-20190102/tests/test_library.sh 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/tests/test_library.sh 2024-02-23 02:48:27.000000000 +0000 @@ -1,15 +1,15 @@ -#!/bin/bash -# Tests C library functions and types. +#!/usr/bin/env bash +# Tests library functions and types. # -# Version: 20190101 +# Version: 20231007 EXIT_SUCCESS=0; EXIT_FAILURE=1; EXIT_IGNORE=77; -LIBRARY_TESTS="aes_ccm_encrypted_key error external_key io_handle key key_protector metadata metadata_entry notify password_keep sector_data stretch_key volume_master_key"; +LIBRARY_TESTS="aes_ccm_encrypted_key encryption_context error external_key io_handle key key_protector metadata metadata_block_header metadata_entry metadata_header notify password password_keep sector_data sector_data_vector stretch_key volume_header volume_master_key"; LIBRARY_TESTS_WITH_INPUT="support volume"; -OPTION_SETS="password recovery_password"; +OPTION_SETS=("password" "recovery_password" "startup_key"); INPUT_GLOB="*"; @@ -46,7 +46,7 @@ if ! test -d "input"; then - echo "Test input directory: input not found."; + echo "Test input directory not found."; return ${EXIT_IGNORE}; fi @@ -54,7 +54,7 @@ if test ${RESULT} -eq ${EXIT_SUCCESS}; then - echo "No files or directories found in the test input directory: input"; + echo "No files or directories found in the test input directory"; return ${EXIT_IGNORE}; fi @@ -78,47 +78,54 @@ local TEST_SET_DIRECTORY=$(get_test_set_directory "${TEST_PROFILE_DIRECTORY}" "${TEST_SET_INPUT_DIRECTORY}"); - local OLDIFS=${IFS}; - - # IFS="\n" is not supported by all platforms. - IFS=" -"; - if test -f "${TEST_SET_DIRECTORY}/files"; then - for INPUT_FILE in `cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"`; + IFS="" read -a INPUT_FILES <<< $(cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"); + else + IFS="" read -a INPUT_FILES <<< $(ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}); + fi + for INPUT_FILE in "${INPUT_FILES[@]}"; + do + OPTION_INPUT_FILE="${INPUT_FILE}"; + + if test "${OSTYPE}" = "msys"; + then + # A test executable built with MinGW expects a Windows path. + INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`; + fi + local TESTED_WITH_OPTIONS=0; + + for OPTION_SET in ${OPTION_SETS[@]}; do - if test "${OSTYPE}" = "msys"; - then - # A test executable built with MinGW expects a Windows path. - INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`; - fi - run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SETS}" "${TEST_EXECUTABLE}" "${INPUT_FILE}"; - RESULT=$?; + local TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${OPTION_INPUT_FILE}" "${OPTION_SET}"); - if test ${RESULT} -ne ${EXIT_SUCCESS}; + if test -f ${TEST_DATA_OPTION_FILE}; then - break; + TESTED_WITH_OPTIONS=1; + + IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + + run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${OPTIONS[@]}"; + RESULT=$?; + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi fi done - else - for INPUT_FILE in `ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}`; - do - if test "${OSTYPE}" = "msys"; - then - # A test executable built with MinGW expects a Windows path. - INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`; - fi - run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SETS}" "${TEST_EXECUTABLE}" "${INPUT_FILE}"; + + if test ${TESTED_WITH_OPTIONS} -eq 0; + then + run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}"; RESULT=$?; + fi - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - break; - fi - done - fi - IFS=${OLDIFS}; + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + done if test ${RESULT} -ne ${EXIT_SUCCESS}; then @@ -129,7 +136,7 @@ return ${RESULT}; } -if ! test -z ${SKIP_LIBRARY_TESTS}; +if test -n "${SKIP_LIBRARY_TESTS}"; then exit ${EXIT_IGNORE}; fi diff -Nru libbde-20190102/tests/test_manpage.sh libbde-20240223/tests/test_manpage.sh --- libbde-20190102/tests/test_manpage.sh 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/test_manpage.sh 2024-02-23 02:47:19.000000000 +0000 @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# Tests man pages. +# +# Version: 20230410 + +EXIT_SUCCESS=0; +EXIT_FAILURE=1; +EXIT_IGNORE=77; + +run_test() +{ + local INPUT_FILE=$1; + local RESULT=0 + + TEST_NAME=`basename ${INPUT_FILE}`; + echo -n "Testing man with input: ${TEST_NAME}"; + + LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z ${INPUT_FILE} > /dev/null 2> ${TMPDIR}/${TEST_NAME}.warnings; + RESULT=$?; + + # For now line break warnings are ignored. + if test -f ${TMPDIR}/${TEST_NAME}.warnings; + then + sed "/can't break line/ d" -i ${TMPDIR}/${TEST_NAME}.warnings; + fi + if test -s ${TMPDIR}/${TEST_NAME}.warnings; + then + RESULT=${EXIT_FAILURE}; + fi + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + echo " (FAIL)"; + else + echo " (PASS)"; + fi + if test -s ${TMPDIR}/${TEST_NAME}.warnings; + then + cat ${TMPDIR}/${TEST_NAME}.warnings; + fi + return ${RESULT}; +} + +if test "${OSTYPE}" = "msys"; +then + exit ${EXIT_IGNORE}; +fi + +TEST_RUNNER="tests/test_runner.sh"; + +if ! test -f "${TEST_RUNNER}"; +then + TEST_RUNNER="./test_runner.sh"; +fi + +if ! test -f "${TEST_RUNNER}"; +then + echo "Missing test runner: ${TEST_RUNNER}"; + + exit ${EXIT_FAILURE}; +fi + +source ${TEST_RUNNER}; + +assert_availability_binary man; + +RESULT=${EXIT_IGNORE}; + +TMPDIR="tmp$$"; + +rm -rf ${TMPDIR}; +mkdir ${TMPDIR}; + +MANUALS_PATH="../manuals"; + +if ! test -d ${MANUALS_PATH}; +then + MANUALS_PATH="manuals"; +fi + +if ! test -d ${MANUALS_PATH}; +then + echo "Manuals directory not found."; + + exit ${EXIT_IGNORE}; +fi + +for INPUT_FILE in ${MANUALS_PATH}/*.[13]; +do + run_test "${INPUT_FILE}"; + RESULT=$?; + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi +done + +rm -rf ${TMPDIR}; + +exit ${RESULT}; + diff -Nru libbde-20190102/tests/test_python_module.sh libbde-20240223/tests/test_python_module.sh --- libbde-20190102/tests/test_python_module.sh 2019-01-02 14:42:40.000000000 +0000 +++ libbde-20240223/tests/test_python_module.sh 2024-02-23 02:47:19.000000000 +0000 @@ -1,15 +1,16 @@ -#!/bin/bash +#!/usr/bin/env bash # Tests Python module functions and types. # -# Version: 20190101 +# Version: 20240120 EXIT_SUCCESS=0; EXIT_FAILURE=1; +EXIT_NO_TESTS_RAN=5; EXIT_IGNORE=77; TEST_FUNCTIONS="support"; TEST_FUNCTIONS_WITH_INPUT="volume"; -OPTION_SETS="password recovery_password"; +OPTION_SETS=("password" "recovery_password" "startup_key"); TEST_TOOL_DIRECTORY="."; INPUT_GLOB="*"; @@ -36,7 +37,7 @@ if ! test -d "input"; then - echo "Test input directory: input not found."; + echo "Test input directory not found."; return ${EXIT_IGNORE}; fi @@ -44,7 +45,7 @@ if test ${RESULT} -eq ${EXIT_SUCCESS}; then - echo "No files or directories found in the test input directory: input"; + echo "No files or directories found in the test input directory"; return ${EXIT_IGNORE}; fi @@ -68,37 +69,47 @@ local TEST_SET_DIRECTORY=$(get_test_set_directory "${TEST_PROFILE_DIRECTORY}" "${TEST_SET_INPUT_DIRECTORY}"); - local OLDIFS=${IFS}; - - # IFS="\n"; is not supported by all platforms. - IFS=" -"; - if test -f "${TEST_SET_DIRECTORY}/files"; then - for INPUT_FILE in `cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"`; + IFS="" read -a INPUT_FILES <<< $(cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"); + else + IFS="" read -a INPUT_FILES <<< $(ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}); + fi + for INPUT_FILE in "${INPUT_FILES[@]}"; + do + local TESTED_WITH_OPTIONS=0; + + for OPTION_SET in ${OPTION_SETS[@]}; do - run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SETS}" "${TEST_SCRIPT}" "${INPUT_FILE}"; - RESULT=$?; + local TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); - if test ${RESULT} -ne ${EXIT_SUCCESS}; + if test -f ${TEST_DATA_OPTION_FILE}; then - break; + TESTED_WITH_OPTIONS=1; + + IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + + run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SET}" "${TEST_SCRIPT}" "${INPUT_FILE}" "${OPTIONS[@]}"; + RESULT=$?; + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi fi done - else - for INPUT_FILE in `ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}`; - do - run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SETS}" "${TEST_SCRIPT}" "${INPUT_FILE}"; + + if test ${TESTED_WITH_OPTIONS} -eq 0; + then + run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "" "${TEST_SCRIPT}" "${INPUT_FILE}"; RESULT=$?; + fi - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - break; - fi - done - fi - IFS=${OLDIFS}; + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + done if test ${RESULT} -ne ${EXIT_SUCCESS}; then @@ -109,7 +120,7 @@ return ${RESULT}; } -if ! test -z ${SKIP_PYTHON_TESTS}; +if test -n "${SKIP_PYTHON_TESTS}"; then exit ${EXIT_IGNORE}; fi @@ -137,7 +148,11 @@ test_python_function "${TEST_FUNCTION}"; RESULT=$?; - if test ${RESULT} -ne ${EXIT_SUCCESS}; + if test ${RESULT} -eq ${EXIT_NO_TESTS_RAN}; + then + RESULT=${EXIT_IGNORE}; + fi + if test ${RESULT} -ne ${EXIT_SUCCESS} && test ${RESULT} -ne ${EXIT_IGNORE}; then break; fi @@ -158,8 +173,11 @@ test_python_function "${TEST_FUNCTION}"; RESULT=$?; fi - - if test ${RESULT} -ne ${EXIT_SUCCESS}; + if test ${RESULT} -eq ${EXIT_NO_TESTS_RAN}; + then + RESULT=${EXIT_IGNORE}; + fi + if test ${RESULT} -ne ${EXIT_SUCCESS} && test ${RESULT} -ne ${EXIT_IGNORE}; then break; fi diff -Nru libbde-20190102/tests/test_runner.sh libbde-20240223/tests/test_runner.sh --- libbde-20190102/tests/test_runner.sh 2019-01-02 14:14:13.000000000 +0000 +++ libbde-20240223/tests/test_runner.sh 2024-02-23 02:47:19.000000000 +0000 @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Bash functions to run an executable for testing. # -# Version: 20180929 +# Version: 20231119 # # When CHECK_WITH_ASAN is set to a non-empty value the test executable # is run with asan, otherwise it is run without. @@ -14,6 +14,8 @@ # # When CHECK_WITH_VALGRIND is set to a non-empty value the test executable # is run with valgrind, otherwise it is run without. +# +# PYTHON is used to determine the Python interpreter. EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -69,6 +71,33 @@ fi } +# Checks if the test set is in the ignore list. +# +# Arguments: +# a string containing the test set +# a string containing space separated ignore list +# +# Returns: +# an integer containing the exit status to indicate the input directory +# was found in the ignore list. +# +check_for_test_set_in_ignore_list() +{ + local TEST_SET=$1; + local IGNORE_LIST=$2; + + local IFS=" "; + + for LIST_ELEMENT in ${IGNORE_LIST}; + do + if test "${LIST_ELEMENT}" = "${TEST_SET}"; + then + return ${EXIT_SUCCESS}; + fi + done + return ${EXIT_FAILURE}; +} + # Checks if the input directory is in the ignore list. # # Arguments: @@ -86,7 +115,9 @@ local INPUT_BASENAME=`basename ${INPUT_DIRECTORY}`; - for LIST_ELEMENT in `echo "${IGNORE_LIST}" | tr ' ' '\n'`; + local IFS=" "; + + for LIST_ELEMENT in ${IGNORE_LIST}; do if test "${LIST_ELEMENT}" = "${INPUT_BASENAME}"; then @@ -159,14 +190,24 @@ find_binary_library_path() { local TEST_EXECUTABLE=$1; - local LIBRARY_NAME="${TEST_EXECUTABLE}"; + local LIBRARY_NAME=`dirname ${TEST_EXECUTABLE}`; - echo ${LIBRARY_NAME} | grep 'tools' > /dev/null 2>&1; + local NAME=`basename ${LIBRARY_NAME}`; - if test $? -eq ${EXIT_SUCCESS}; + if test ${NAME} = ".libs"; then LIBRARY_NAME=`dirname ${LIBRARY_NAME}`; + NAME=`basename ${LIBRARY_NAME}`; + fi + if test ${NAME} = "tests"; + then LIBRARY_NAME=`dirname ${LIBRARY_NAME}`; + NAME=`basename ${LIBRARY_NAME}`; + fi + echo ${LIBRARY_NAME} | grep 'tools' > /dev/null 2>&1; + + if test $? -eq ${EXIT_SUCCESS}; + then LIBRARY_NAME=`basename ${LIBRARY_NAME} | sed 's/\(.*\)tools$/lib\1/'`; else LIBRARY_NAME=`basename ${LIBRARY_NAME} | sed 's/^py//' | sed 's/^\([^_]*\)_test_.*$/lib\1/'`; @@ -186,9 +227,6 @@ # Searches for the path to the binary variant of the Python module # -# Globals: -# PYTHON_VERSION -# # Arguments: # a string containing the path of the test executable # @@ -205,18 +243,8 @@ TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; TEST_EXECUTABLE=`dirname ${TEST_EXECUTABLE}`; - PYTHON_VERSION=`echo ${PYTHON_VERSION} | cut -c1`; + local PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}/.libs"; - local PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}-python${PYTHON_VERSION}/.libs"; - - if ! test -d "${PYTHON_MODULE_PATH}"; - then - PYTHON_MODULE_PATH="../${PYTHON_MODULE_NAME}-python${PYTHON_VERSION}/.libs"; - fi - if ! test -d "${PYTHON_MODULE_PATH}"; - then - PYTHON_MODULE_PATH="${TEST_EXECUTABLE}/${PYTHON_MODULE_NAME}/.libs"; - fi if ! test -d "${PYTHON_MODULE_PATH}"; then PYTHON_MODULE_PATH="../${PYTHON_MODULE_NAME}/.libs"; @@ -224,26 +252,26 @@ echo "${PYTHON_MODULE_PATH}"; } -# Determines the test option file. +# Determines the test data option file. # # Arguments: # a string containing the path of the test set directory # a string containing the path of the test input file -# a string containing the name of the option set +# a string containing the name of the test data option set # # Returns: # a string containing the test input files # -get_testion_option_file() +get_test_data_option_file() { local TEST_SET_DIRECTORY=$1; local INPUT_FILE=$2; local OPTION_SET=$3; local INPUT_NAME=`basename "${INPUT_FILE}"`; - local OPTION_FILE="${TEST_SET_DIRECTORY}/${INPUT_NAME}.${OPTION_SET}"; + local TEST_DATA_OPTION_FILE="${TEST_SET_DIRECTORY}/${INPUT_NAME}.${OPTION_SET}"; - echo "${OPTION_FILE}"; + echo "${TEST_DATA_OPTION_FILE}"; } # Determines the test profile directory. @@ -337,32 +365,40 @@ if test -f "${IGNORE_FILE}"; then - IGNORE_LIST=`cat ${IGNORE_FILE} | sed '/^#/d'`; + IGNORE_LIST=`cat ${IGNORE_FILE} | sed '/^#/d' | tr '\n' ' '`; fi echo ${IGNORE_LIST}; } -# Reads the test set option file. +# Reads a test data option file. # # Arguments: # a string containing the path of the test set directory # a string containing the path of the test input file -# a string containing the name of the option set +# a string containing the name of the test data option set # # Returns: -# a string containing the ignore list +# a string containing the test data specific options # -read_option_file() +read_test_data_option_file() { local TEST_SET_DIRECTORY=$1; local INPUT_FILE=$2; local OPTION_SET=$3; - local OPTION_FILE=$(get_testion_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + local TEST_DATA_OPTION_FILE="${INPUT_FILE}.${OPTION_SET}"; + + if ! test -f "${TEST_DATA_OPTION_FILE}"; + then + TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + fi - local OPTIONS=() - local OPTIONS_STRING=`cat "${OPTION_FILE}" | head -n 1 | sed 's/[\r\n]*$//'`; + local OPTIONS_STRING=`head -n 1 "${TEST_DATA_OPTION_FILE}" | sed 's/[\r\n]*$//'`; + if test "${OPTIONS_STRING}" = "# libyal test data options"; + then + OPTIONS_STRING=`tail -n +2 "${TEST_DATA_OPTION_FILE}" | sed 's/^offset=/-o/;s/^password=/-p/;s/^recovery_password=/-r/;s/^startup_key=/-s/;s/virtual_address=/-v/' | tr '\n' ' '`; + fi echo "${OPTIONS_STRING}"; } @@ -373,7 +409,6 @@ # CHECK_WITH_GDB # CHECK_WITH_STDERR # CHECK_WITH_VALGRIND -# PYTHON_VERSION # # Arguments: # a string containing the test description @@ -408,9 +443,9 @@ echo "${EXECUTABLE_TYPE}" | grep -i "python script" > /dev/null 2>&1; local IS_PYTHON_SCRIPT=$?; - if test ${IS_PYTHON_SCRIPT} -eq 0; + if test ${IS_PYTHON_SCRIPT} -eq 0 && test -z ${PYTHON}; then - local PYTHON=`which python${PYTHON_VERSION} 2> /dev/null`; + local PYTHON=`which python 2> /dev/null`; if ! test -x ${PYTHON}; then @@ -619,6 +654,7 @@ return ${EXIT_FAILURE}; fi + local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); @@ -674,7 +710,7 @@ fi if test -n "${TEST_DESCRIPTION}"; then - echo -n "${TEST_DESCRIPTION} "; + echo -n "${TEST_DESCRIPTION}"; if test ${RESULT} -ne ${EXIT_SUCCESS}; then @@ -693,7 +729,6 @@ # CHECK_WITH_GDB # CHECK_WITH_STDERR # CHECK_WITH_VALGRIND -# PYTHON_VERSION # # Arguments: # a string containing the path of the test executable @@ -728,9 +763,9 @@ echo "${EXECUTABLE_TYPE}" | grep -i "python script" > /dev/null 2>&1; local IS_PYTHON_SCRIPT=$?; - if test ${IS_PYTHON_SCRIPT} -eq 0; + if test ${IS_PYTHON_SCRIPT} -eq 0 && test -z ${PYTHON}; then - local PYTHON=`which python${PYTHON_VERSION} 2> /dev/null`; + local PYTHON=`which python 2> /dev/null`; if ! test -x ${PYTHON}; then @@ -940,6 +975,7 @@ return ${EXIT_FAILURE}; fi + local TEST_EXECUTABLE=$( find_binary_executable ${TEST_EXECUTABLE} ); local LIBRARY_PATH=$( find_binary_library_path ${TEST_EXECUTABLE} ); local PYTHON_MODULE_PATH=$( find_binary_python_module_path ${TEST_EXECUTABLE} ); @@ -1005,7 +1041,7 @@ # a string containing the path of the test set directory # a string containing the description of the test # a string containing the test mode -# a string containing the name of the option set +# a string containing the name of the test data option set # a string containing the path of the test executable # a string containing the path of the test input file # an array containing the arguments for the test executable @@ -1025,14 +1061,10 @@ local ARGUMENTS=("$@"); local INPUT_NAME=`basename "${INPUT_FILE}"`; - local OPTIONS=(); local TEST_OUTPUT="${INPUT_NAME}"; if test -n "${OPTION_SET}"; then - OPTIONS_STRING=$(read_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); - IFS=" " read -a OPTIONS <<< "${OPTIONS_STRING}"; - TEST_OUTPUT="${INPUT_NAME}-${OPTION_SET}"; fi @@ -1044,7 +1076,7 @@ if test "${TEST_MODE}" = "with_callback"; then - test_callback "${TMPDIR}" "${TEST_SET_DIRECTORY}" "${TEST_OUTPUT}" "${TEST_EXECUTABLE}" "${TEST_INPUT}" ${ARGUMENTS[@]} "${OPTIONS[@]}"; + test_callback "${TMPDIR}" "${TEST_SET_DIRECTORY}" "${TEST_OUTPUT}" "${TEST_EXECUTABLE}" "${TEST_INPUT}" ${ARGUMENTS[@]}; RESULT=$?; elif test "${TEST_MODE}" = "with_stdout_reference"; @@ -1061,26 +1093,33 @@ local INPUT_FILE_FULL_PATH=$( readlink_f "${INPUT_FILE}" ); local TEST_LOG="${TEST_OUTPUT}.log"; - (cd ${TMPDIR} && run_test_with_input_and_arguments "${TEST_EXECUTABLE}" "${INPUT_FILE_FULL_PATH}" ${ARGUMENTS[@]} "${OPTIONS[@]}" | sed '1,2d' > "${TEST_LOG}"); + (cd ${TMPDIR} && run_test_with_input_and_arguments "${TEST_EXECUTABLE}" "${INPUT_FILE_FULL_PATH}" ${ARGUMENTS[@]} > "${TEST_LOG}"); RESULT=$?; - local TEST_RESULTS="${TMPDIR}/${TEST_LOG}"; - local STORED_TEST_RESULTS="${TEST_SET_DIRECTORY}/${TEST_LOG}.gz"; - - if test -f "${STORED_TEST_RESULTS}"; + # Compare output if test ran successfully. + if test ${RESULT} -eq ${EXIT_SUCCESS}; then - # Using zcat here since zdiff has issues on Mac OS X. - # Note that zcat on Mac OS X requires the input from stdin. - zcat < "${STORED_TEST_RESULTS}" | diff "${TEST_RESULTS}" -; - RESULT=$?; - else - gzip "${TEST_RESULTS}"; + local TEST_RESULTS="${TMPDIR}/${TEST_LOG}"; + local STORED_TEST_RESULTS="${TEST_SET_DIRECTORY}/${TEST_LOG}.gz"; + + # Strip header with version. + sed -i'~' '1,2d' "${TEST_RESULTS}"; - mv "${TEST_RESULTS}.gz" ${TEST_SET_DIRECTORY}; + if test -f "${STORED_TEST_RESULTS}"; + then + # Using zcat here since zdiff has issues on Mac OS X. + # Note that zcat on Mac OS X requires the input from stdin. + zcat < "${STORED_TEST_RESULTS}" | diff "${TEST_RESULTS}" -; + RESULT=$?; + else + gzip "${TEST_RESULTS}"; + + mv "${TEST_RESULTS}.gz" ${TEST_SET_DIRECTORY}; + fi fi else - run_test_with_input_and_arguments "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]} "${OPTIONS[@]}"; + run_test_with_input_and_arguments "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]}; RESULT=$?; fi @@ -1088,13 +1127,13 @@ if test -n "${TEST_DESCRIPTION}"; then - OPTIONS=`echo "${OPTIONS[*]}" | tr '\n' ' ' | sed 's/[ ]\$//'`; + ARGUMENTS=`echo "${ARGUMENTS[*]}" | tr '\n' ' ' | sed 's/[ ]\$//'`; - if test -z "${OPTIONS}"; + if test -z "${ARGUMENTS}"; then echo -n "${TEST_DESCRIPTION} with input: ${INPUT_FILE}"; else - echo -n "${TEST_DESCRIPTION} with options: '${OPTIONS}' and input: ${INPUT_FILE}"; + echo -n "${TEST_DESCRIPTION} with options: '${ARGUMENTS}' and input: ${INPUT_FILE}"; fi if test ${RESULT} -ne ${EXIT_SUCCESS}; @@ -1106,62 +1145,4 @@ fi return ${RESULT}; } - -# Runs the test with options on the input file. -# -# Note that this function is not intended to be directly invoked -# from outside the test runner script. -# -# Arguments: -# a string containing the path of the test set directory -# a string containing the description of the test -# a string containing the test mode -# a string containing the name of the option sets -# a string containing the path of the test executable -# a string containing the path of the test input file -# an array containing the arguments for the test executable -# -# Returns: -# an integer containg the exit status of the test executable -# -run_test_on_input_file_with_options() -{ - local TEST_SET_DIRECTORY=$1; - local TEST_DESCRIPTION=$2; - local TEST_MODE=$3; - local OPTION_SETS=$4; - local TEST_EXECUTABLE=$5; - local INPUT_FILE=$6; - shift 6; - local ARGUMENTS=("$@"); - - local RESULT=${EXIT_SUCCESS}; - local TESTED_WITH_OPTIONS=0; - - for OPTION_SET in `echo ${OPTION_SETS} | tr ' ' '\n'`; - do - local OPTION_FILE=$(get_testion_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); - - if ! test -f ${OPTION_FILE}; - then - continue - fi - - run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "${TEST_MODE}" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]}; - RESULT=$?; - - if test ${RESULT} -ne ${EXIT_SUCCESS}; - then - break; - fi - TESTED_WITH_OPTIONS=1; - done - - if test ${RESULT} -eq ${EXIT_SUCCESS} && test ${TESTED_WITH_OPTIONS} -eq 0; - then - run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "${TEST_MODE}" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}" ${ARGUMENTS[@]}; - RESULT=$?; - fi - return ${RESULT}; -} diff -Nru libbde-20190102/tests/test_tools.sh libbde-20240223/tests/test_tools.sh --- libbde-20190102/tests/test_tools.sh 1970-01-01 00:00:00.000000000 +0000 +++ libbde-20240223/tests/test_tools.sh 2024-02-23 02:48:27.000000000 +0000 @@ -0,0 +1,196 @@ +#!/usr/bin/env bash +# Tests tools functions and types. +# +# Version: 20231007 + +EXIT_SUCCESS=0; +EXIT_FAILURE=1; +EXIT_IGNORE=77; + +TOOLS_TESTS="info_handle output signal"; +TOOLS_TESTS_WITH_INPUT=""; +OPTION_SETS=("password" "recovery_password" "startup_key"); + +INPUT_GLOB="*"; + +run_test() +{ + local TEST_NAME=$1; + + local TEST_DESCRIPTION="Testing: ${TEST_NAME}"; + local TEST_EXECUTABLE="./bde_test_tools_${TEST_NAME}"; + + if ! test -x "${TEST_EXECUTABLE}"; + then + TEST_EXECUTABLE="${TEST_EXECUTABLE}.exe"; + fi + + # TODO: add support for TEST_PROFILE and OPTION_SETS? + run_test_with_arguments "${TEST_DESCRIPTION}" "${TEST_EXECUTABLE}"; + local RESULT=$?; + + return ${RESULT}; +} + +run_test_with_input() +{ + local TEST_NAME=$1; + + local TEST_DESCRIPTION="Testing: ${TEST_NAME}"; + local TEST_EXECUTABLE="./bde_test_tools_${TEST_NAME}"; + + if ! test -x "${TEST_EXECUTABLE}"; + then + TEST_EXECUTABLE="${TEST_EXECUTABLE}.exe"; + fi + + if ! test -d "input"; + then + echo "Test input directory not found."; + + return ${EXIT_IGNORE}; + fi + local RESULT=`ls input/* | tr ' ' '\n' | wc -l`; + + if test ${RESULT} -eq ${EXIT_SUCCESS}; + then + echo "No files or directories found in the test input directory"; + + return ${EXIT_IGNORE}; + fi + + local TEST_PROFILE_DIRECTORY=$(get_test_profile_directory "input" "bdetools"); + + local IGNORE_LIST=$(read_ignore_list "${TEST_PROFILE_DIRECTORY}"); + + RESULT=${EXIT_SUCCESS}; + + for TEST_SET_INPUT_DIRECTORY in input/*; + do + if ! test -d "${TEST_SET_INPUT_DIRECTORY}"; + then + continue; + fi + if check_for_directory_in_ignore_list "${TEST_SET_INPUT_DIRECTORY}" "${IGNORE_LIST}"; + then + continue; + fi + + local TEST_SET_DIRECTORY=$(get_test_set_directory "${TEST_PROFILE_DIRECTORY}" "${TEST_SET_INPUT_DIRECTORY}"); + + if test -f "${TEST_SET_DIRECTORY}/files"; + then + IFS="" read -a INPUT_FILES <<< $(cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"); + else + IFS="" read -a INPUT_FILES <<< $(ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}); + fi + for INPUT_FILE in "${INPUT_FILES[@]}"; + do + OPTION_INPUT_FILE="${INPUT_FILE}"; + + if test "${OSTYPE}" = "msys"; + then + # A test executable built with MinGW expects a Windows path. + INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`; + fi + local TESTED_WITH_OPTIONS=0; + + for OPTION_SET in ${OPTION_SETS[@]}; + do + local TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${OPTION_INPUT_FILE}" "${OPTION_SET}"); + + if test -f ${TEST_DATA_OPTION_FILE}; + then + TESTED_WITH_OPTIONS=1; + + IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}"); + + run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${OPTIONS[@]}"; + RESULT=$?; + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + fi + done + + if test ${TESTED_WITH_OPTIONS} -eq 0; + then + run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}"; + RESULT=$?; + fi + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + done + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi + done + + return ${RESULT}; +} + +if test -n "${SKIP_TOOLS_TESTS}"; +then + exit ${EXIT_IGNORE}; +fi + +TEST_RUNNER="tests/test_runner.sh"; + +if ! test -f "${TEST_RUNNER}"; +then + TEST_RUNNER="./test_runner.sh"; +fi + +if ! test -f "${TEST_RUNNER}"; +then + echo "Missing test runner: ${TEST_RUNNER}"; + + exit ${EXIT_FAILURE}; +fi + +source ${TEST_RUNNER}; + +RESULT=${EXIT_IGNORE}; + +for TEST_NAME in ${TOOLS_TESTS}; +do + run_test "${TEST_NAME}"; + RESULT=$?; + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi +done + +if test ${RESULT} -ne ${EXIT_SUCCESS} && test ${RESULT} -ne ${EXIT_IGNORE}; +then + exit ${RESULT}; +fi + +for TEST_NAME in ${TOOLS_TESTS_WITH_INPUT}; +do + if test -d "input"; + then + run_test_with_input "${TEST_NAME}"; + RESULT=$?; + else + run_test "${TEST_NAME}"; + RESULT=$?; + fi + + if test ${RESULT} -ne ${EXIT_SUCCESS}; + then + break; + fi +done + +exit ${RESULT}; +