misc.c File Reference
`#include "system.h"`
`#include <rpmversion.h>`
`#include <rpmiotypes.h>`
`#include <rpmlog.h>`
`#include <rpmurl.h>`
`#include <rpmmacro.h>`
`#include <rpmtypes.h>`
`#include "misc.h"`
`#include "debug.h"`
Include dependency graph for misc.c:

Go to the source code of this file.

## Functions

rpmRC | rpmMkdirPath (const char *dpath, const char *dname)
| Create directory if it does not exist, and make sure path is writable. More...
int | doputenv (const char *str)
| Like the libc function, but malloc()'s the space needed. More...
int | dosetenv (const char *name, const char *value, int overwrite)
| Like the libc function, but malloc()'s the space needed. More...
char * | currentDirectory (void)
| Return (malloc'd) current working directory. More...

## Variables

const char * | RPMVERSION = VERSION

## Function Documentation

char* currentDirectory | ( | void |  | ) |

Return (malloc'd) current working directory.

Returns
  current working directory (malloc'ed)

Definition at line 71 of file misc.c.

References errno, and xrealloc().

Referenced by rpmQueryVerify(), and rpmtsRun().

int doputenv | ( | const char * | str | ) |

Like the libc function, but malloc()'s the space needed.

Deprecated:
  Use setenv(3) instead.

Parameters

  str | "name=value" string

Returns
  0 on success

Definition at line 49 of file misc.c.

References xmalloc().

Referenced by runScript().

int dosetenv | ( | const char * | name,
|  | const char * | value,
|  | int | overwrite
| ) |  |

Like the libc function, but malloc()'s the space needed.

Deprecated:
  Use setenv(3) instead.

Parameters

  name | variable name
  value | variable value
  overwrite | should an existing variable be changed?

Returns
  0 on success

Definition at line 59 of file misc.c.

References getenv(), stpcpy(), and xmalloc().

rpmRC rpmMkdirPath | ( | const char * | dpath,
|  | const char * | dname
| ) |  |

Create directory if it does not exist, and make sure path is writable.

Note
  This will only create last component of directory path.

Parameters

  dpath | directory path
  dname | directory use string

Returns
  rpmRC return code

Definition at line 19 of file misc.c.

References _, errno, Mkdir(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, Stat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by createDir(), main(), prepFetch(), and rpmpsmStage().

## Variable Documentation

const char* RPMVERSION = VERSION

Definition at line 17 of file misc.c.

Referenced by rpmcliImportPubkey().