Skip to content

Commit

Permalink
Remove no longer used code from src-common.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 committed Dec 4, 2023
1 parent 3f8efcc commit ac36f4e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 99 deletions.
66 changes: 0 additions & 66 deletions src/librepgp/stream-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,13 @@ pgp_source_t::read(void *buf, size_t len, size_t *readres)
return true;
}

bool
src_read(pgp_source_t *src, void *buf, size_t len, size_t *readres)
{
return src->read(buf, len, readres);
}

bool
pgp_source_t::read_eq(void *buf, size_t len)
{
size_t res = 0;
return read(buf, len, &res) && (res == len);
}

bool
src_read_eq(pgp_source_t *src, void *buf, size_t len)
{
return src->read_eq(buf, len);
}

bool
pgp_source_t::peek(void *buf, size_t len, size_t *peeked)
{
Expand Down Expand Up @@ -219,25 +207,13 @@ pgp_source_t::peek(void *buf, size_t len, size_t *peeked)
return false;
}

bool
src_peek(pgp_source_t *src, void *buf, size_t len, size_t *peeked)
{
return src->peek(buf, len, peeked);
}

bool
pgp_source_t::peek_eq(void *buf, size_t len)
{
size_t res = 0;
return peek(buf, len, &res) && (res == len);
}

bool
src_peek_eq(pgp_source_t *src, void *buf, size_t len)
{
return src->peek_eq(buf, len);
}

void
pgp_source_t::skip(size_t len)
{
Expand Down Expand Up @@ -272,36 +248,18 @@ pgp_source_t::skip(size_t len)
free(buf);
}

void
src_skip(pgp_source_t *src, size_t len)
{
src->skip(len);
}

rnp_result_t
pgp_source_t::finish()
{
return raw_finish ? raw_finish(this) : RNP_SUCCESS;
}

rnp_result_t
src_finish(pgp_source_t *src)
{
return src->finish();
}

bool
pgp_source_t::error() const
{
return error_;
}

bool
src_error(const pgp_source_t *src)
{
return src->error();
}

bool
pgp_source_t::eof()
{
Expand All @@ -314,12 +272,6 @@ pgp_source_t::eof()
return peek(&check, 1, &read) && (read == 0);
}

bool
src_eof(pgp_source_t *src)
{
return src->eof();
}

void
pgp_source_t::close()
{
Expand All @@ -333,12 +285,6 @@ pgp_source_t::close()
}
}

void
src_close(pgp_source_t *src)
{
src->close();
}

bool
pgp_source_t::skip_eol()
{
Expand All @@ -359,12 +305,6 @@ pgp_source_t::skip_eol()
return false;
}

bool
src_skip_eol(pgp_source_t *src)
{
return src->skip_eol();
}

bool
pgp_source_t::peek_line(char *buf, size_t len, size_t *readres)
{
Expand Down Expand Up @@ -400,12 +340,6 @@ pgp_source_t::peek_line(char *buf, size_t len, size_t *readres)
return false;
}

bool
src_peek_line(pgp_source_t *src, char *buf, size_t len, size_t *readres)
{
return src->peek_line(buf, len, readres);
}

bool
init_src_common(pgp_source_t *src, size_t paramsize)
{
Expand Down
33 changes: 0 additions & 33 deletions src/librepgp/stream-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,39 +193,6 @@ typedef struct pgp_source_t {
**/
bool init_src_common(pgp_source_t *src, size_t paramsize);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_read(pgp_source_t *src, void *buf, size_t len, size_t *read);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_read_eq(pgp_source_t *src, void *buf, size_t len);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_peek(pgp_source_t *src, void *buf, size_t len, size_t *read);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_peek_eq(pgp_source_t *src, void *buf, size_t len);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
void src_skip(pgp_source_t *src, size_t len);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
rnp_result_t src_finish(pgp_source_t *src);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_error(const pgp_source_t *src);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_eof(pgp_source_t *src);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
void src_close(pgp_source_t *src);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_skip_eol(pgp_source_t *src);

/** @brief To be removed once codebase is refactored to use pgp_source_t methods. */
bool src_peek_line(pgp_source_t *src, char *buf, size_t len, size_t *read);

/** @brief init file source
* @param src pre-allocated source structure
* @param path path to the file
Expand Down

0 comments on commit ac36f4e

Please sign in to comment.