File mod_core.c

This module must always be called first after loading the database.

References Functions: core_cleanup()mod_core.c
  core_init()mod_core.c
  core_misc()mod_core.c


Included Files


Global Variable magpie_module

struct magpie_module magpie_module
Included from magpie.h
Visible in:  magpie.c
   mod_conffiles.c
   mod_core.c
   mod_debian.c
   mod_installed.c
   mod_isizes.c
   mod_keywords.c
   mod_maintainers.c
   mod_md5sums.c
   mod_names.c
   mod_priorities.c
   mod_sections.c
   mod_setuids.c
   mod_sizes.c
   mod_sources.c
   mod_tasks.c
   mod_xml.c
   support.c

Global Variable mod_core

struct magpie_module mod_core
Visible in:  magpie.c
   mod_core.c
Used in:  magpie.c

Local Variables

rcsid
static const char rcsid[]

Local Function core_cleanup()

Break down our environment.

static int core_cleanup ( int voidb )
Calls: rmrf()support.c
  rmdir()
Used in:  mod_core.c


Local Function core_init()

Print the complete package information in individual files. This procedure should be called first, after loading the package information, since the other packages depend on the of the data it produces.

static int core_init ( void )
Calls: pass1()mod_core.c
  pass2()mod_core.c
  pass3()mod_core.c
  pass4()mod_core.c
  pass_last()mod_core.c
  setup()mod_core.c
Used in:  mod_core.c


Local Function core_misc()

Print links to a couple files we produce as a secondary result of the core analysis.

static int core_misc ( FILE* fp )
Calls: mp_item_close(), mp_item_open(), mp_url()
Used in:  mod_core.c


Local Function pass1()

First pass: we create a file for each package, and write the header information into it.

static void pass1 ( void )
Calls: __assert_fail(), access(), fclose(), fopen(), mp_doc_open(), sprintf()
Called by: core_init()mod_core.c
References Variables: cachemod_debian.c
  cachecntmod_debian.c


Local Function pass2()

Second pass: we generate the information for reverse list lookups.

static void pass2 ( void )
Calls: __tolower(), fclose(), fopen(), fprintf(), mp_text(), sprintf(), strchr(), strcpy()
Called by: core_init()mod_core.c
References Variables: cachemod_debian.c
  cachecntmod_debian.c


Local Function pass3()

third pass: generate the real "provides" files

static void pass3 ( void )
Calls: gzip()support.c
  __assert_fail(), fclose(), fgets(), fopen(), fprintf(), mkstemp(), mp_doc_close(), mp_doc_open(), mp_item_close(), mp_item_open(), mp_list_close(), mp_list_open(), mp_nbsp(), mp_text(), mp_url(), popen(), sprintf(), strchr(), strcmp(), strcpy(), strncpy(), unlink()
Called by: core_init()mod_core.c
References Variables: cachemod_debian.c
  cachecntmod_debian.c


Local Function pass4()

fourth pass: generate the real "details" files we use 'append' so duplicate names can be handled.

static void pass4 ( void )
Calls: fclose(), fopen(), mp_package(), sprintf()
Called by: core_init()mod_core.c
References Variables: cachemod_debian.c
  cachecntmod_debian.c


Local Function pass5()

fifth pass: check the md5sums file

static void pass5 ( void )
Calls: gzip()support.c
  md5sum()support.c
  access(), fclose(), fgets(), fopen(), fprintf(), fputs(), mp_abstract(), mp_break(), mp_doc_close(), mp_doc_open(), mp_literal_close(), mp_literal_open(), mp_title(), mp_url(), sprintf(), strchr(), strlen()
References Variables: cachemod_debian.c
  cachecntmod_debian.c


Local Function pass_last()

final pass: close the "details" files and compress them.

static void pass_last ( void )
Calls: gzip()support.c
  fclose(), fopen(), mp_doc_close(), sprintf()
Called by: core_init()mod_core.c
References Variables: cachemod_debian.c
  cachecntmod_debian.c


Local Function setup()

Set up our environment.

static void setup ( void )
Calls: mkdir(), sprintf()
Called by: core_init()mod_core.c