# rpmio/stringbuf.c File Reference

`#include "system.h"`
`#include <rpmio.h>`
`#include "stringbuf.h"`
`#include "debug.h"`
Include dependency graph for stringbuf.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | StringBufRec

## Defines

#define | BUF_CHUNK 1024

## Functions

StringBuf | newStringBuf (void)
StringBuf | freeStringBuf (StringBuf sb)
void | truncStringBuf (StringBuf sb)
void | stripTrailingBlanksStringBuf (StringBuf sb)
char * | getStringBuf (StringBuf sb)
void | appendStringBufAux (StringBuf sb, const char *s, size_t nl)

## Detailed Description

Definition in file stringbuf.c.

## Define Documentation

#define BUF_CHUNK 1024

Definition at line 11 of file stringbuf.c.

Referenced by appendStringBufAux(), and newStringBuf().

## Function Documentation

void appendStringBufAux | ( | StringBuf | sb,
|  | const char * | s,
|  | size_t | nl |
| ) |  |  |

Definition at line 66 of file stringbuf.c.

References StringBufRec::allocated, StringBufRec::buf, BUF_CHUNK, StringBufRec::free, StringBufRec::tail, and xrealloc().

StringBuf freeStringBuf | ( | StringBuf | sb | ) |

Definition at line 34 of file stringbuf.c.

References _free(), and StringBufRec::buf.

Referenced by addFileToArrayTag(), addFileToTag(), addFileToTagAux(), checkFiles(), doSetupMacro(), freePackage(), freeSpec(), initSourceHeader(), parseChangelog(), parseDescription(), parsePrep(), parseScript(), processBinaryFiles(), processSourceFiles(), rpmfcExec(), rpmfcFree(), rpmfcGenerateDependsHelper(), rpmfcGenerateScriptletDeps(), rpmfcHelper(), rpmReadPackageManifest(), and tagStoreFree().

char* getStringBuf | ( | StringBuf | sb | ) |

Definition at line 61 of file stringbuf.c.

References StringBufRec::buf.

Referenced by addChangelog(), addFileToArrayTag(), addFileToTag(), checkFiles(), doSetupMacro(), initSourceHeader(), parseDescription(), parsePrep(), parseScript(), processPackageFiles(), processSourceFiles(), rpmfcExec(), rpmfcGenerateDependsHelper(), rpmfcGenerateScriptletDeps(), rpmfcHelper(), rpmReadPackageManifest(), spec_get_build(), spec_get_clean(), spec_get_install(), and spec_get_prep().

StringBuf newStringBuf | ( | void |  | ) |

Definition at line 22 of file stringbuf.c.

References StringBufRec::allocated, StringBufRec::buf, BUF_CHUNK, StringBufRec::free, StringBufRec::tail, xcalloc(), and xmalloc().

Referenced by addFileToArrayTag(), addFileToTag(), doSetupMacro(), getOutputFrom(), initSourceHeader(), parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parseForSimple(), parsePrep(), parseScript(), processBinaryFiles(), processSourceFiles(), rpmfcGenerateDependsHelper(), rpmfcGenerateScriptletDeps(), rpmfcHelper(), rpmReadPackageManifest(), spec_get_build(), spec_get_clean(), spec_get_install(), and spec_get_prep().

void stripTrailingBlanksStringBuf | ( | StringBuf | sb | ) |

Definition at line 50 of file stringbuf.c.

References StringBufRec::allocated, StringBufRec::free, StringBufRec::tail, and xisspace().

Referenced by parseDescription(), parseScript(), and rpmfcGenerateScriptletDeps().

void truncStringBuf | ( | StringBuf | sb | ) |

Definition at line 43 of file stringbuf.c.

References StringBufRec::allocated, StringBufRec::buf, StringBufRec::free, and StringBufRec::tail.

Referenced by rpmfcGenerateScriptletDeps().