dpkg 1.21.11
Macros | Functions | Variables
dpkg.h File Reference

(7aa7057bc)

#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
#include <dpkg/macros.h>
#include <dpkg/progname.h>
#include <dpkg/ehandle.h>
#include <dpkg/report.h>
#include <dpkg/string.h>
#include <dpkg/program.h>
Include dependency graph for dpkg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAXCONFFILENAME   1000
 
#define MAXDIVERTFILENAME   1024
 
#define MAXCONTROLFILENAME   100
 
#define DEBEXT   ".deb"
 
#define REMOVECONFFEXTS
 
#define NEWCONFFILEFLAG   "newconffile"
 
#define NONEXISTENTFLAG   "nonexistent"
 
#define EMPTYHASHFLAG   "-"
 
#define DPKGTEMPEXT   ".dpkg-tmp"
 
#define DPKGNEWEXT   ".dpkg-new"
 
#define DPKGOLDEXT   ".dpkg-old"
 
#define DPKGDISTEXT   ".dpkg-dist"
 
#define CONTROLFILE   "control"
 
#define CONFFILESFILE   "conffiles"
 
#define PREINSTFILE   "preinst"
 
#define POSTINSTFILE   "postinst"
 
#define PRERMFILE   "prerm"
 
#define POSTRMFILE   "postrm"
 
#define MAINTSCRIPT_FILE_CONFIG   "config"
 
#define TRIGGERSCIFILE   "triggers"
 
#define STATUSFILE   "status"
 
#define AVAILFILE   "available"
 
#define LOCKFILE   "lock"
 
#define FRONTENDLOCKFILE   "lock-frontend"
 
#define DIVERSIONSFILE   "diversions"
 
#define STATOVERRIDEFILE   "statoverride"
 
#define UPDATESDIR   "updates"
 
#define INFODIR   "info"
 
#define TRIGGERSDIR   "triggers"
 
#define TRIGGERSFILEFILE   "File"
 
#define TRIGGERSDEFERREDFILE   "Unincorp"
 
#define TRIGGERSLOCKFILE   "Lock"
 
#define CONTROLDIRTMP   "tmp.ci"
 
#define IMPORTANTTMP   "tmp.i"
 
#define REASSEMBLETMP   "reassemble" DEBEXT
 
#define IMPORTANTMAXLEN   10
 
#define IMPORTANTFMT   "%04d"
 
#define MAXUPDATES   250
 
#define DEFAULTSHELL   "sh"
 
#define DEFAULTPAGER   "pager"
 
#define MD5HASHLEN   32
 
#define MAXTRIGDIRECTIVE   256
 
#define BACKEND   "dpkg-deb"
 
#define SPLITTER   "dpkg-split"
 
#define DPKGQUERY   "dpkg-query"
 
#define DPKGDIVERT   "dpkg-divert"
 
#define DPKGSTAT   "dpkg-statoverride"
 
#define DPKGTRIGGER   "dpkg-trigger"
 
#define DPKG   "dpkg"
 
#define DEBSIGVERIFY   "debsig-verify"
 
#define RM   "rm"
 
#define CAT   "cat"
 
#define DIFF   "diff"
 

Functions

void log_message (const char *fmt,...) DPKG_ATTR_PRINTF(1)
 
void statusfd_add (int fd)
 
void statusfd_send (const char *fmt,...) DPKG_ATTR_PRINTF(1)
 
void cu_closestream (int argc, void **argv)
 
void cu_closepipe (int argc, void **argv)
 
void cu_closedir (int argc, void **argv)
 
void cu_closefd (int argc, void **argv)
 
void cu_filename (int argc, void **argv)
 
void setcloexec (int fd, const char *fn)
 
void * m_malloc (size_t)
 
void * m_calloc (size_t nmemb, size_t size)
 
void * m_realloc (void *, size_t)
 
char * m_strdup (const char *str)
 
char * m_strndup (const char *str, size_t n)
 
int m_asprintf (char **strp, const char *fmt,...) DPKG_ATTR_PRINTF(2)
 
int m_vasprintf (char **strp, const char *fmt, va_list args) DPKG_ATTR_VPRINTF(2)
 
int m_dup (int oldfd)
 
void m_dup2 (int oldfd, int newfd)
 
void m_pipe (int fds[2])
 
void m_output (FILE *f, const char *name)
 
int fgets_checked (char *buf, size_t bufsz, FILE *f, const char *fn)
 
int fgets_must (char *buf, size_t bufsz, FILE *f, const char *fn)
 

Variables

const char * log_file
 

Macro Definition Documentation

◆ AVAILFILE

#define AVAILFILE   "available"

◆ BACKEND

#define BACKEND   "dpkg-deb"

◆ CAT

#define CAT   "cat"

◆ CONFFILESFILE

#define CONFFILESFILE   "conffiles"

◆ CONTROLDIRTMP

#define CONTROLDIRTMP   "tmp.ci"

◆ CONTROLFILE

#define CONTROLFILE   "control"

◆ DEBEXT

#define DEBEXT   ".deb"

◆ DEBSIGVERIFY

#define DEBSIGVERIFY   "debsig-verify"

◆ DEFAULTPAGER

#define DEFAULTPAGER   "pager"

◆ DEFAULTSHELL

#define DEFAULTSHELL   "sh"

◆ DIFF

#define DIFF   "diff"

◆ DIVERSIONSFILE

#define DIVERSIONSFILE   "diversions"

◆ DPKG

#define DPKG   "dpkg"

◆ DPKGDISTEXT

#define DPKGDISTEXT   ".dpkg-dist"

◆ DPKGDIVERT

#define DPKGDIVERT   "dpkg-divert"

◆ DPKGNEWEXT

#define DPKGNEWEXT   ".dpkg-new"

◆ DPKGOLDEXT

#define DPKGOLDEXT   ".dpkg-old"

◆ DPKGQUERY

#define DPKGQUERY   "dpkg-query"

◆ DPKGSTAT

#define DPKGSTAT   "dpkg-statoverride"

◆ DPKGTEMPEXT

#define DPKGTEMPEXT   ".dpkg-tmp"

◆ DPKGTRIGGER

#define DPKGTRIGGER   "dpkg-trigger"

◆ EMPTYHASHFLAG

#define EMPTYHASHFLAG   "-"

◆ FRONTENDLOCKFILE

#define FRONTENDLOCKFILE   "lock-frontend"

◆ IMPORTANTFMT

#define IMPORTANTFMT   "%04d"

◆ IMPORTANTMAXLEN

#define IMPORTANTMAXLEN   10

◆ IMPORTANTTMP

#define IMPORTANTTMP   "tmp.i"

◆ INFODIR

#define INFODIR   "info"

◆ LOCKFILE

#define LOCKFILE   "lock"

◆ MAINTSCRIPT_FILE_CONFIG

#define MAINTSCRIPT_FILE_CONFIG   "config"

◆ MAXCONFFILENAME

#define MAXCONFFILENAME   1000

◆ MAXCONTROLFILENAME

#define MAXCONTROLFILENAME   100

◆ MAXDIVERTFILENAME

#define MAXDIVERTFILENAME   1024

◆ MAXTRIGDIRECTIVE

#define MAXTRIGDIRECTIVE   256

◆ MAXUPDATES

#define MAXUPDATES   250

◆ MD5HASHLEN

#define MD5HASHLEN   32

◆ NEWCONFFILEFLAG

#define NEWCONFFILEFLAG   "newconffile"

◆ NONEXISTENTFLAG

#define NONEXISTENTFLAG   "nonexistent"

◆ POSTINSTFILE

#define POSTINSTFILE   "postinst"

◆ POSTRMFILE

#define POSTRMFILE   "postrm"

◆ PREINSTFILE

#define PREINSTFILE   "preinst"

◆ PRERMFILE

#define PRERMFILE   "prerm"

◆ REASSEMBLETMP

#define REASSEMBLETMP   "reassemble" DEBEXT

◆ REMOVECONFFEXTS

#define REMOVECONFFEXTS
Value:
"~", ".bak", "%", \
#define DPKGOLDEXT
Definition: dpkg.h:65
#define DPKGDISTEXT
Definition: dpkg.h:66
#define DPKGNEWEXT
Definition: dpkg.h:64

◆ RM

#define RM   "rm"

◆ SPLITTER

#define SPLITTER   "dpkg-split"

◆ STATOVERRIDEFILE

#define STATOVERRIDEFILE   "statoverride"

◆ STATUSFILE

#define STATUSFILE   "status"

◆ TRIGGERSCIFILE

#define TRIGGERSCIFILE   "triggers"

◆ TRIGGERSDEFERREDFILE

#define TRIGGERSDEFERREDFILE   "Unincorp"

◆ TRIGGERSDIR

#define TRIGGERSDIR   "triggers"

◆ TRIGGERSFILEFILE

#define TRIGGERSFILEFILE   "File"

◆ TRIGGERSLOCKFILE

#define TRIGGERSLOCKFILE   "Lock"

◆ UPDATESDIR

#define UPDATESDIR   "updates"

Function Documentation

◆ cu_closedir()

void cu_closedir ( int  argc,
void **  argv 
)

◆ cu_closefd()

void cu_closefd ( int  argc,
void **  argv 
)

Referenced by md5hash(), and parsedb_open().

Here is the caller graph for this function:

◆ cu_closepipe()

void cu_closepipe ( int  argc,
void **  argv 
)

◆ cu_closestream()

void cu_closestream ( int  argc,
void **  argv 
)

Referenced by atomic_file_open().

Here is the caller graph for this function:

◆ cu_filename()

void cu_filename ( int  argc,
void **  argv 
)

◆ fgets_checked()

int fgets_checked ( char *  buf,
size_t  bufsz,
FILE *  f,
const char *  fn 
)

References _, ohshit(), and ohshite().

Referenced by fgets_must(), and trigdef_parse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fgets_must()

int fgets_must ( char *  buf,
size_t  bufsz,
FILE *  f,
const char *  fn 
)

References _, fgets_checked(), and ohshit().

Here is the call graph for this function:

◆ log_message()

void log_message ( const char *  fmt,
  ... 
)

References _, args, varbuf::buf, fd_write(), log_file, notice(), setcloexec(), varbuf::used, varbuf_add_char(), varbuf_add_str, varbuf_end_str(), varbuf_reset(), and varbuf_vprintf().

Referenced by archivefiles(), log_action(), modstatdb_note(), and packages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_asprintf()

int m_asprintf ( char **  strp,
const char *  fmt,
  ... 
)

References args, and m_vasprintf().

Referenced by maintscript_fallback(), and maintscript_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_calloc()

void * m_calloc ( size_t  nmemb,
size_t  size 
)

Referenced by pager_spawn().

Here is the caller graph for this function:

◆ m_dup()

int m_dup ( int  oldfd)

References _, ohshite(), and onerr_abort.

Here is the call graph for this function:

◆ m_dup2()

void m_dup2 ( int  oldfd,
int  newfd 
)

References _, ohshite(), and onerr_abort.

Referenced by pager_reap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_malloc()

void * m_malloc ( size_t  amount)

◆ m_output()

void m_output ( FILE *  f,
const char *  name 
)

References _, and ohshite().

Referenced by do_info(), predeppackage(), print_foreign_arches(), and printarch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m_pipe()

void m_pipe ( int  fds[2])

References _, ohshite(), and onerr_abort.

Here is the call graph for this function:

◆ m_realloc()

void * m_realloc ( void *  r,
size_t  amount 
)

Referenced by varbuf_grow().

Here is the caller graph for this function:

◆ m_strdup()

char * m_strdup ( const char *  str)

Referenced by atomic_file_new(), dir_make_path(), dir_make_path_parent(), dir_sync_path_parent(), filter_add(), match_node_new(), pkg_hash_find_set(), and pkg_spec_parse().

Here is the caller graph for this function:

◆ m_strndup()

char * m_strndup ( const char *  str,
size_t  n 
)

Referenced by pkg_spec_parse().

Here is the caller graph for this function:

◆ m_vasprintf()

int m_vasprintf ( char **  strp,
const char *  fmt,
va_list  args 
)

References _, args, ohshite(), and onerr_abort.

Referenced by badusage(), dpkg_error_print(), info(), m_asprintf(), notice(), and str_fmt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setcloexec()

void setcloexec ( int  fd,
const char *  fn 
)

References _, and ohshite().

Referenced by debug_set_output(), file_lock(), log_message(), and statusfd_add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusfd_add()

void statusfd_add ( int  fd)

References _, pipef::fd, pipef::next, nfmalloc(), and setcloexec().

Here is the call graph for this function:

◆ statusfd_send()

void statusfd_send ( const char *  fmt,
  ... 
)

References args.

Referenced by log_action(), modstatdb_note(), print_error_perarchive(), and print_error_perpackage().

Here is the caller graph for this function:

Variable Documentation

◆ log_file

const char* log_file
extern

Referenced by log_message().