<?xml version="1.0" encoding="UTF-8"?>
<collection>

<spec_type>
  <kind> common_env </kind>
  <global_code>
    #include <rpmio.h>	/* XXX rpmioItem */
    #include <poptIO.h>
    #include <assert.h>
    static struct poptOption optionsTable[] = {
      { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmioAllPoptTable, 0,
           "Common options for all rpmio executables:", NULL },
      POPT_AUTOHELP
      POPT_TABLEEND
    };
  </global_code>
  <init_code>
    poptContext optCon = rpmioInit(argc, argv, optionsTable);
  </init_code>
  <final_code>
    optCon = rpmioFini(optCon);
  </final_code>
</spec_type>

<!-- argv.h -->

<spec_type>
  <kind> common_param </kind>
  <data_type> ARGint_t </data_type>
  <value> 0xdeadbeef </value>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> ARGI_t </data_type>
  <value> NULL </value>
  <init_code>
    assert(argiAdd(&$0, -1, 1) == 0 && $0 != NULL && argiCount($0) == 1);
  </init_code>
  <final_code>
    $0 = argiFree($0);
  </final_code>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> ARGI_t </data_type>
  <value> NULL </value>
  <init_code>
    assert(argiAdd(&$0, -1, 1) == 0 && $0 != NULL && argiCount($0) == 1);
  </init_code>
  <associating>
    <interfaces>
      argiFree
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> ARGstr_t </data_type>
  <value> "foo" </value>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> ARGV_t </data_type>
  <value> NULL </value>
  <init_code>
    assert(argvAdd(&$0, "foo") == 0 && $0 != NULL && !strcmp($0[0], "foo"));
  </init_code>
  <final_code>
    $0 = argvFree($0);
  </final_code>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> ARGV_t * </data_type>
  <value> NULL </value>
  <global_code>
    static ARGV_t _av;
  </global_code>
  <init_code>
    $0 = &_av;
    assert(argvAdd($0, "foo") == 0 && *$0 != NULL && !strcmp((*$0)[0], "foo"));
  </init_code>
  <final_code>
    if ($0) *$0 = argvFree(*$0);
  </final_code>
  <associating>
    <interfaces>
      argvAdd
      argvAppend
      argvSplit
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> ARGV_t </data_type>
  <value> NULL </value>
  <init_code>
    assert(argvAdd(&$0, "foo") == 0 && $0 != NULL && !strcmp($0[0], "foo"));
  </init_code>
  <associating>
    <interfaces>
      argvFree
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> ARGV_t * </data_type>
  <value> NULL </value>
  <global_code>
    static ARGV_t _av;
  </global_code>
  <init_code>
    $0 = &_av;
  </init_code>
  <final_code>
    if ($0) *$0 = argvFree(*$0);
  </final_code>
  <associating>
    <interfaces>
      argvFgets
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> NULL </value>
  <global_code>
    #include <rpmio.h>	/* XXX Fopen/Fclose */
    static const char * _fn = "/dev/null";
  </global_code>
  <init_code>
    $0 = (void *) Fopen(_fn, "r");
  </init_code>
  <final_code>
    if ($0) (void) Fclose($0);
  </final_code>
  <associating>
    <interfaces> argvFgets </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<!-- ar.h -->
<!-- cpio.h -->
<!-- tar.h -->
<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> &__st </value>
  <global_code>
    static struct stat __st;
  </global_code>
  <init_code>
    (void) memset(&__st, 0, sizeof(__st));
  </init_code>
  <associating>
    <interfaces>
      arHeaderRead
      arHeaderWrite
      cpioHeaderRead
      cpioHeaderWrite
      tarHeaderRead
      tarHeaderWrite
    </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> &__iosm </value>
  <global_code>
    #include <rpmio.h>
    #include <iosm.h>
    static struct iosm_s __iosm;
    static FD_t __cfd;
    static const char * __failedFile;
  </global_code>
  <init_code>
    __cfd = $[Fopen];
    (void) memset(&__iosm, 0, sizeof(__iosm));
    (void) iosmSetup($0, IOSM_PKGINSTALL, "ar", NULL, NULL,
		__cfd, NULL, &__failedFile);
  </init_code>
  <final_code>
    (void) iosmTeardown($0);
    if (__cfd) (void) Fclose(__cfd);
  </final_code>
  <associating>
    <interfaces>
      arHeaderRead
      arHeaderWrite
      arTrailerWrite
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> &__iosm </value>
  <global_code>
    #include <rpmio.h>
    #include <iosm.h>
    static struct iosm_s __iosm;
    static FD_t __cfd;
    static const char * __failedFile;
  </global_code>
  <init_code>
    __cfd = $[Fopen];
    (void) memset(&__iosm, 0, sizeof(__iosm));
    (void) iosmSetup($0, IOSM_PKGINSTALL, "cpio", NULL, NULL,
		__cfd, NULL, &__failedFile);
  </init_code>
  <final_code>
    (void) iosmTeardown($0);
  </final_code>
  <associating>
    <interfaces>
      cpioHeaderRead
      cpioHeaderWrite
      cpioTrailerWrite
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> &__iosm </value>
  <global_code>
    #include <rpmio.h>
    #include <iosm.h>
    static struct iosm_s __iosm;
    static FD_t __cfd;
    static const char * __failedFile;
  </global_code>
  <init_code>
    __cfd = $[Fopen];
    (void) memset(&__iosm, 0, sizeof(__iosm));
    (void) iosmSetup($0, IOSM_PKGINSTALL, "ustar", NULL, NULL,
		__cfd, NULL, &__failedFile);
  </init_code>
  <final_code>
    (void) iosmTeardown($0);
  </final_code>
  <associating>
    <interfaces>
      tarHeaderRead
      tarHeaderWrite
      tarTrailerWrite
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<!-- fts.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> FTS * </data_type>
  <value> NULL </value>
  <global_code>
    #include <fts.h>
  </global_code>
  <init_code>
    rpmioFtsOpts = (FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOSTAT);
    $0 = Fts_open (argv, rpmioFtsOpts, NULL);
  </init_code>
  <final_code> (void) Fts_close($0); </final_code>
  <associating>
    <except> Fts_close </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> FTS * </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- iosm.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> IOSM_t </data_type>
  <value> &_iosm </value>
  <global_code>
    #include <rpmio.h>
    static struct iosm_s _iosm;
  </global_code>
  <init_code>
    (void) memset(&_iosm, 0, sizeof(_iosm));
  </init_code>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param8 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> unsigned int * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param7 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> FD_t </data_type>
  <value> $[Fopen] </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param6 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param5 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param4 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "cpio" </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> iosmFileStage </data_type>
  <value> IOSM_PKGINSTALL </value>
  <associating>
    <interfaces> iosmSetup </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<!-- mire.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> miRE </data_type>
  <value> mireNew(RPMMIRE_REGEX, 0) </value>
  <init_code>
    mireRegcomp($0, "pattern");
  </init_code>
  <final_code> $0 = mireFree($0); </final_code>
  <associating>
    <except>
      mireAppend
      mireApply
      mireFree
      mireFreeAll
    </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> miRE </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> miRE </data_type>
  <value> mireNew(RPMMIRE_REGEX, 0) </value>
  <init_code>
    (void) mireRegcomp($0, "pattern");
    $2 = 1;
  </init_code>
  <associating>
    <interfaces> mireFreeAll </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "en_US" </value>
  <associating>
    <interfaces> mireSetLocale </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <global_code>
    static const char * _patterns[] = { "foo", "bar", "baz", NULL };
    static miRE _mires;
    static int _nmires;
  </global_code>
  <init_code>
    /* type:		$(type) */
    /* interface:	$[interface] */
    /* obj:		$obj */
    $1 = RPMMIRE_REGEX;
    $2 = 0;
    $3 = _patterns;
    $4 = NULL;
    $5 = &_mires;
    $6 = &_nmires;
  </init_code>
  <final_code> mireFreeAll(_mires, _nmires); </final_code>
  <associating>
    <interfaces> mireLoadPatterns </interfaces>
  </associating>
</spec_type>

<!-- poptIO.h -->

<!-- rpmacl.h -->

<!-- rpmaug.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmaug </data_type>
  <value> rpmaugNew("root", "loadpath", 0) </value>
  <final_code> $0 = rpmaugFree($0); </final_code>
  <associating>
    <except> rpmaugFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmaug </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmbc.h -->

<!-- rpmbf.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmbf </data_type>
  <value> rpmbfCreate(1000, 1.0e-4) </value>
  <global_code>
    #include <rpmio.h>	/* XXX rpmioItem */
    static rpmbf rpmbfCreate(size_t n, double e)
    {
	size_t m = 0;
	size_t k = 0;
	rpmbfParams(n, e, &m, &k);
	return rpmbfNew(m, k, 0);
    }
  </global_code>
  <init_code>
    assert(rpmbfAdd($0, "foo", 0) == 0 && rpmbfChk($0, "foo", 0) > 0);
    assert(rpmbfAdd($0, "bar", 0) == 0 && rpmbfChk($0, "bar", 0) > 0);
    assert(rpmbfAdd($0, "baz", 0) == 0 && rpmbfChk($0, "baz", 0) > 0);
  </init_code>
  <final_code> $0 = rpmbfFree($0); </final_code>
  <associating>
    <except> rpmbfFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmbf </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmbz.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmbz </data_type>
  <value> $[rpmbzNew] </value>
  <final_code> $0 = rpmbzFree($0, 0); </final_code>
  <associating>
    <except> rpmbzFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmbz </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> -1 </value>
  <associating>
    <interfaces> rpmbzNew </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "a+" </value>
  <associating>
    <interfaces> rpmbzNew </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> tmpnam(NULL) </value>
  <associating>
    <interfaces> rpmbzNew </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> rpmbzClose </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> 0 </value>
  <associating>
    <interfaces> rpmbzClose </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces>
      rpmbzRead
      rpmbzWrite
    </interfaces>
    <links> param4 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> size_t </data_type>
  <value> sizeof(_buf) </value>
  <associating>
    <interfaces>
      rpmbzRead
      rpmbzWrite
    </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> char * </data_type>
  <value> _buf </value>
  <global_code>
    static char _buf[8192];
  </global_code>
  <associating>
    <interfaces>
      rpmbzRead
      rpmbzWrite
    </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<!-- rpmcb.h -->

<!-- rpmcudf.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmcudf </data_type>
  <value> NULL </value>
  <init_code>
    argv[0] = TEST_DATA_PATH("legacy.cudf");
    argv[1] = NULL;
    $0 = rpmcudfNew(argv, /* RPMCUDV_CUDF */ 256+1);
  </init_code>
  <final_code> $0 = rpmcudfFree($0); </final_code>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> char ** </data_type>
  <value> NULL </value>
  <init_code>
    argv[0] = TEST_DATA_PATH("legacy.cudf");
    argv[1] = NULL;
    $0 = argv;
    $2 = 256+1;
  </init_code>
  <associating>
    <interfaces> rpmcudfNew </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> rpmcudf </data_type>
  <value> NULL </value>
  <init_code>
    argv[0] = TEST_DATA_PATH("legacy.cudf");
    argv[1] = NULL;
    $0 = rpmcudfNew(argv, /* RPMCUDV_CUDF */ 256+1);
  </init_code>
  <associating>
    <interfaces> rpmcudfFree </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> rpmcudf </data_type>
  <value> NULL </value>
  <init_code>
    argv[0] = TEST_DATA_PATH("legacy-sol.cudf");
    argv[1] = NULL;
    $0 = rpmcudfNew(argv, /* RPMCUDV_CUDF */ 256+2);
  </init_code>
  <final_code> $0 = rpmcudfFree($0); </final_code>
  <associating>
    <interfaces>
      rpmcudfInstalledSize
      rpmcudfIsConsistent
      rpmcudfUniverseSize
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<!-- rpmdav.h -->

<!-- rpmdir.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> DIR * </data_type>
  <value> $[Opendir] </value>
  <final_code> (void) Closedir($0); </final_code>
  <associating>
    <except> Closedir </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> DIR * </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "." </value>
  <associating>
    <interfaces> Opendir </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> DIR * </data_type>
  <value> $[Opendir] </value>
  <associating>
    <interfaces> Closedir </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> struct dirent * </data_type>
  <value> NULL </value>
  <init_code>
    DIR * _dir = $[Opendir];
    $0 = Readdir(_dir);
  </init_code>
  <final_code>
    $0 = NULL;
    if (_dir) (void) Closedir(_dir);
  </final_code>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const void * </data_type>
  <value> &_foo </value>
  <global_code>
    static const char * _foo = "foo";
  </global_code>
  <associating>
    <interfaces>
      Alphasort
      Versionsort
    </interfaces>
    <links>
      param1
      param2
    </links>
  </associating>
</spec_type>

<!-- rpmficl.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmficl </data_type>
  <value> rpmficlNew(argv, 0) </value>
  <final_code> $0 = rpmficlFree($0); </final_code>
  <associating>
    <except> rpmficlFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> hashTable </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmgc.h -->

<!-- rpmhash.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> hashTable </data_type>
  <value> htCreate(1000, 0, 1, NULL, NULL) </value>
  <final_code> $0 = htFree($0); </final_code>
  <associating>
    <except> htFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> hashTable </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmhook.h -->

<!-- rpmio.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> mode_t </data_type>
  <value> 0700 </value>
</spec_type>

<spec_type>
  <kind> common_retval </kind>
  <data_type> FD_t </data_type>
  <constraint> $0 != NULL && Fileno($0) > 2 && !Ferror($0) </constraint>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> FD_t </data_type>
  <value> $[fdDup] </value>
  <final_code> Fclose($0); </final_code>
  <associating>
    <except> Fclose </except>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "a+" </value>
  <associating>
    <interfaces> Fopen </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> tmpnam(NULL) </value>
  <associating>
    <interfaces> Fopen </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> fileno(tmpfile()) </value>
  <associating>
    <interfaces> fdDup </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> unsigned </data_type>
  <value> __LINE__ </value>
  <associating>
    <interfaces> XfdNew </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> __FILE__ </value>
  <associating>
    <interfaces> XfdNew </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "msg" </value>
  <associating>
    <interfaces> XfdNew </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> FD_t </data_type>
  <constraint> $0 != NULL </constraint>
  <associating>
    <interfaces> XfdNew </interfaces>
    <links> retval </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> FD_t </data_type>
  <value> $[XfdNew] </value>
  <associating>
    <interfaces>
      fdFree
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> FD_t </data_type>
  <value> $[fdDup] </value>
  <associating>
    <interfaces>
      ufdGetFile
    </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<!--
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmioPool </data_type>
  <value> $[rpmioNewPool] </value>
  <final_code> $0 = rpmioFreePool($0); </final_code>
  <associating>
    <except>
      rpmioFreePool
    </except>
  </associating>
</spec_type>
-->

<spec_type>
  <kind> common_param </kind>
  <data_type> rpmioItem </data_type>
  <value> fooGetPool(NULL) </value>
  <global_code>
    typedef struct rpmfoo_s * rpmfoo;
    struct rpmfoo_s {
      struct rpmioItem_s _item;	/* usage mutex and pool identifier. */
      void * bar[100];
    };
    static int _foo_debug;
    static rpmioPool _fooPool;
    static void fooFini(void * _foo) {
      rpmfoo foo = _foo;
      return;
    }
    static rpmfoo fooGetPool(rpmioPool pool) {
      rpmfoo foo;
     if (_fooPool == NULL) {
       _fooPool = rpmioNewPool("foo", sizeof(*foo), -1, _foo_debug,
			NULL, NULL, fooFini);
	pool = _fooPool;
     }
     foo = (rpmfoo) rpmioGetPool(pool, sizeof(*foo));
     memset(((char *)foo)+sizeof(foo->_item), 0, sizeof(*foo)-sizeof(foo->_item));
     return foo;
  }
  </global_code>
  <final_code>
    $0 = rpmioFreePoolItem((rpmioItem)$0, __FUNCTION__, __FILE__, __LINE__);
    _fooPool = rpmioFreePool(_fooPool);
  </final_code>
  <associating>
    <except>
      rpmioFreePoolItem
      rpmioPutPool
      rpmioUnlinkPoolItem
    </except>
  </associating>
</spec_type>

<spec_type>
  <kind> common_return </kind>
  <data_type> rpmioPool </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> void (*) (void *) </data_type>
  <value> fooFini </value>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param7 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> void (*) (void *) </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param6 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> char * (*) (void *) </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param5 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> _foo_debug </value>
  <global_code>
    static int _foo_debug;
    static void fooFini(void * _foo) {
      rpmfoo foo = _foo;
      return;
    }
    static rpmfoo fooGetPool(rpmioPool pool) {
      rpmfoo foo;
     if (_fooPool == NULL) {
       _fooPool = rpmioNewPool("foo", sizeof(*foo), -1, _foo_debug,
			NULL, NULL, fooFini);
	pool = _fooPool;
     }
     foo = (rpmfoo) rpmioGetPool(pool, sizeof(*foo));
     memset(((char *)foo)+sizeof(foo->_item), 0, sizeof(*foo)-sizeof(foo->_item));
     return foo;
  }
  </global_code>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param4 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> -1 </value>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> size_t </data_type>
  <value> sizeof(struct rpmfoo_s) </value>
  <global_code>
    typedef struct rpmfoo_s * rpmfoo;
    struct rpmfoo_s {
      struct rpmioItem_s _item;	/* usage mutex and pool identifier. */
      void * bar[99];
    };
    static rpmioPool _fooPool;
  </global_code>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "foo" </value>
  <associating>
    <interfaces> rpmioNewPool </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<!--
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmioItem </data_type>
  <final_code>
    $0 = rpmioFreePoolItem($0, "foo", __FILE__, __LINE__);
  </final_code>
  <associating>
    <except> rpmioFreePoolItem </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_return </kind>
  <data_type> rpmioItem </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>
-->

<!--
<spec_type>
  <kind> normal </kind>
  <data_type> size_t </data_type>
  <value> sizeof(struct rpmfoo_s) </value>
  <associating>
    <interfaces> rpmioGetPool </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> rpmioPool </data_type>
  <value> $[rpmioNewPool] </value>
  <associating>
    <interfaces> rpmioGetPool </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> poolItem </data_type>
  <constraint> $0 != NULL </constraint>
  <associating>
    <interfaces> rpmioGetPool </interfaces>
    <links> retval </links>
  </associating>
</spec_type>
-->

<spec_type>
  <kind> normal </kind>
  <data_type> unsigned </data_type>
  <value> __LINE__ </value>
  <associating>
    <interfaces> rpmioFreePoolItem </interfaces>
    <links> param4 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> __FILE__ </value>
  <associating>
    <interfaces> rpmioFreePoolItem </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "foo" </value>
  <associating>
    <interfaces> rpmioFreePoolItem </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> poolItem </data_type>
  <value> $[rpmioGetPool] </value>
  <associating>
    <interfaces> rpmioFreePoolItem </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> &__pglob </value>
  <global_code>
    #include <glob.h>
    static glob_t __pglob;
  </global_code>
  <init_code>
    (void) Glob("*", 0, Glob_error, $0);
  </init_code>
  <associating>
    <interfaces> Globfree </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> char * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> Realpath </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<!-- rpmiotypes.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmiob </data_type>
  <value> $[rpmiobNew] </value>
  <final_code> $0 = rpmiobFree($0); </final_code>
  <associating>
    <except> rpmiobFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmiob </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> size_t </data_type>
  <value> 0 </value>
  <associating>
    <interfaces> rpmiobNew </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> DIGEST_CTX </data_type>
  <final_code> rpmDigestFinal($0, NULL, NULL, 0); </final_code>
  <associating>
    <except> rpmDigestFinal </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> DIGEST_CTX </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> DIGEST_CTX </data_type>
  <constraint> $0 != NULL </constraint>
  <associating>
    <interfaces> rpmDigestInit </interfaces>
    <links> retval </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> rpmDigestFlags </data_type>
  <value> RPMDIGEST_NONE </value>
  <associating>
    <interfaces> rpmDigestInit </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> pgpHashAlgo </data_type>
  <value> PGPHASHALGO_MD5 </value>
  <associating>
    <interfaces> rpmDigestInit </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> DIGEST_CTX </data_type>
  <constraint> $0 != NULL && rpmDigestFinal($0, NULL, NULL, 0) == 0 </constraint>
  <associating>
    <interfaces>
      rpmDigestDup
    </interfaces>
    <links> retval </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> strdup("foo") </value>
  <associating>
    <interfaces> xstrtolocale </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> rpmioP </data_type>
  <value> NULL </value>
  <init_code>
    rpmioParse(&$0, "bing bang boom");
  </init_code>
</spec_type>

<!-- rpmjs.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmjs </data_type>
  <value> rpmjsNew(argv, 0) </value>
  <final_code> $0 = rpmjsFree($0); </final_code>
  <associating>
    <except> rpmjsFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmjs </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmku.h -->

<!-- rpmlog.h -->
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> 1 </value>
  <associating>
    <interfaces> _rpmlog </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "%d" </value>
  <associating>
    <interfaces> _rpmlog </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> RPMLOG_DEBUG </value>
  <associating>
    <interfaces> _rpmlog </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> va_list </data_type>
  <value> NULL </value>
  <init_code>
    va_start($0, argc);
  <init_code>
  <final_code>
    va_end($0);
  <final_code>
  <associating>
    <interfaces> vrpmlog </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "%p" </value>
  <associating>
    <interfaces> vrpmlog </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> RPMLOG_DEBUG </value>
  <associating>
    <interfaces> vrpmlog </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<!-- rpmlua.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmlua </data_type>
  <value> rpmluaNew() </value>
  <final_code> $0 = rpmluaFree($0); </final_code>
  <associating>
    <except> rpmluaFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmlua </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> rpmluav </data_type>
  <value> rpmluavNew() </value>
  <final_code> $0 = rpmluavFree($0); </final_code>
  <associating>
    <except> rpmluavFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmluav </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> NULL </value>
  <associating>
    <interfaces> rpmluaRunScript </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "print(\"-->      lua: Hard Rocks!\")" </value>
  <associating>
    <interfaces> rpmluaRunScript </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> TEST_DATA_PATH("print.lua") </value>
  <associating>
    <interfaces> rpmluaRunScriptFile </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<!-- rpmmacro.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> MacroContext </data_type>
  <value> NULL </value>
  <final_code> rpmFreeMacros($0); </final_code>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> void * </data_type>
  <value> NULL </value>
  <final_code> rpmFreeMacros($0); </final_code>
  <associating>
    <interfaces> expandMacros </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> char * </data_type>
  <value> _buf </value>
  <global_code>
    static char _buf[8192];
  </global_code>
  <init_code>
      (void) rpmDefineMacro(NULL, "foo bar", 0);
      $0 = strcpy(_buf, "%{foo}");
      $4 = sizeof(_buf);
  </init_code>
  <associating>
    <interfaces> expandMacros </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> char * </data_type>
  <value> "foo bar" </value>
  <associating>
    <interfaces> rpmDefineMacro </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<!-- rpmmg.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmmg </data_type>
  <value> $[rpmmgNew] </value>
  <final_code> $0 = rpmmgFree($0); </final_code>
  <associating>
    <except> rpmmgFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmmg </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <value> 0 </value>
  <associating>
    <interfaces> rpmmgNew </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> "/usr/lib/rpm/magic" </value>
  <associating>
    <interfaces> rpmmgNew </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>

<!-- rpmnss.h -->

<!-- rpmperl.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmperl </data_type>
  <value> rpmperlNew(argv, 0) </value>
  <final_code> $0 = rpmperlFree($0); </final_code>
  <associating>
    <except> rpmperlFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmperl </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmpgp.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> pgpDig </data_type>
  <value> pgpDigNew(RPMVSF_DEFAULT) </value>
  <final_code> $0 = pgpDigFree($0); </final_code>
  <associating>
    <except> pgpDigFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> pgpDig </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmpython.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmpython </data_type>
  <value> rpmpythonNew(argv, 0) </value>
  <final_code> $0 = rpmpythonFree($0); </final_code>
  <associating>
    <except> rpmpythonFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmpython </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmruby.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmruby </data_type>
  <value> rpmrubyNew(argv, 0) </value>
  <final_code> $0 = rpmrubyFree($0); </final_code>
  <associating>
    <except> rpmrubyFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmruby </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmsm.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmsm </data_type>
  <value> rpmsmNew(argv[1], 0) </value>
  <final_code> $0 = rpmsmFree($0); </final_code>
  <associating>
    <except> rpmsmFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmsm </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmsp.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmsp </data_type>
  <value> rpmspNew(argv[1], 0) </value>
  <final_code> $0 = rpmspFree($0); </final_code>
  <associating>
    <except> rpmspFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmsp </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmsq.h -->

<!-- rpmsquirrel.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmsquirrel </data_type>
  <value> rpmsquirrelNew(argv, 0) </value>
  <final_code> $0 = rpmsquirrelFree($0); </final_code>
  <associating>
    <except> rpmsquirrelFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmsquirrel </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmssl.h -->

<!-- rpmsw.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmsw </data_type>
  <value> &_sw </value>
  <global_code> static struct rpmsw_s _sw; </global_code>
</spec_type>
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmop </data_type>
  <value> &_op </value>
  <global_code> static struct rpmop_s _op; </global_code>
</spec_type>

<!-- rpmsx.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmsx </data_type>
  <value> rpmsxNew(argv[1], 0) </value>
  <final_code> $0 = rpmsxFree($0); </final_code>
  <associating>
    <except> rpmsxFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmsx </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmsyck.h -->

<!-- rpmtcl.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> rpmtcl </data_type>
  <value> rpmtclNew(argv, 0) </value>
  <final_code> $0 = rpmtclFree($0); </final_code>
  <associating>
    <except> rpmtclFree </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> rpmtcl </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<!-- rpmurl.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> urlinfo </data_type>
  <value> NULL </value>
  <global_code>
    static const char * _url = "http://keys.rpm5.org:11371/pks/lookup?op=stats";
    static urlinfo _u;
  </global_code>
  <init_code> (void) urlSplit(_url, &$0); </init_code>
  <final_code>
    $0 = urlFree($0, "msg");
    urlFreeCache();
  </final_code>
  <associating>
    <except> urlSplit </except>
  </associating>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> urlinfo * </data_type>
  <value> &_u </value>
  <global_code>
    static urlinfo _u;
  </global_code>
  <final_code>
    _u = urlFree(_u, __FILE__);
    urlFreeCache();
  </final_code>
  <associating>
    <interfaces> urlSplit </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> const char * </data_type>
  <value> _url </value>
  <global_code>
    static const char * _url = "http://keys.rpm5.org:11371/pks/lookup?op=stats";
  </global_code>
  <associating>
    <interfaces> urlSplit </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> int </data_type>
  <constraint> $0 == 0 </constraint>
  <associating>
    <interfaces> urlSplit </interfaces>
    <links> retval </links>
  </associating>
</spec_type>

<!-- rpmuuid.h -->

<!-- rpmxar.h -->

<!-- ugid.h -->

<!-- yarn.h -->
<spec_type>
  <kind> common_param </kind>
  <data_type> yarnLock </data_type>
  <value> $[yarnNewLock] </value>
  <associating>
    <except> yarnFreeLock </except>
  </associating>
</spec_type>
<spec_type>
  <kind> common_retval </kind>
  <data_type> yarnLock </data_type>
  <constraint> $0 != NULL </constraint>
</spec_type>

<spec_type>
  <kind> normal </kind>
  <data_type> long </data_type>
  <value> 0 </value>
  <associating>
    <interfaces> yarnNewLock </interfaces>
    <links> param1 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> long </data_type>
  <value> 0 </value>
  <associating>
    <interfaces> yarnWaitFor </interfaces>
    <links> param3 </links>
  </associating>
</spec_type>
<spec_type>
  <kind> normal </kind>
  <data_type> yarnWaitOP </data_type>
  <value> TO_BE </value>
  <associating>
    <interfaces> yarnWaitFor </interfaces>
    <links> param2 </links>
  </associating>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> void (*) (void *) </data_type>
  <value> _snooze </value>
  <global_code>
    static unsigned int _seconds = 2;
    static void _snooze (void * _uip) { sleep(_seconds); }
  </global_code>
</spec_type>

<spec_type>
  <kind> common_param </kind>
  <data_type> yarnThread </data_type>
  <value> NULL </value>
  <global_code>
    static unsigned int _seconds = 2;
    static void _snooze (void * _uip) { sleep(_seconds); }
  </global_code>
  <init_code>
    $0 = yarnLaunch(_snooze, &_seconds);
  </init_code>
</spec_type>

</collection>
