From 2c46a26a8bbc4130a6dc195a77b760d26016d5a1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 14 Jul 2000 16:58:03 +0000 Subject: removed prs_data(), prs_free_data(), and prs_realloc_data() as these were unneeded and replaced by the real functions already in HEAD. Added a few more functions to parse_spoolss.c to help with the rpcclient merge from TNG. (This used to be commit 3bc9af4c1dbdb664970541f6091982ffccc87b31) --- source3/rpc_parse/parse_prs.c | 93 ------------------------------------------- 1 file changed, 93 deletions(-) (limited to 'source3/rpc_parse/parse_prs.c') diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 5b5834084f..1bda5ef506 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -897,99 +897,6 @@ BOOL prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32, return True; } -/******************************************************************* - frees a memory buffer. - ********************************************************************/ -void prs_free_data(prs_struct *buf) -{ - if (buf == NULL) - return; - - if (buf->data_p != NULL) - { - free(buf->data_p); - buf->data_p = NULL; - } - buf->buffer_size = 0; -} - -/******************************************************************* - reallocate a memory buffer -********************************************************************/ -BOOL prs_realloc_data(prs_struct *buf, size_t new_size) -{ - char *new_data; - - /* prs_sma_init(); JERRY */ - - prs_debug(buf, 200, "prs_realloc_data - before", "prs_realloc_data"); - - SMB_ASSERT(((ssize_t) new_size) >= 0); - - if (new_size == 0) - { - prs_free_data(buf); - return True; - } - - /* new_data = sma_realloc(prs_sma_region, buf->data_p, new_size); */ - new_data = realloc(buf->data_p, new_size); - - if (new_data != NULL) - { - if (new_size > buf->buffer_size) - { - memset(&new_data[buf->buffer_size], 0, - new_size - buf->buffer_size); - } - buf->data_p = new_data; - buf->buffer_size = new_size; - } - else if (buf->buffer_size >= new_size) - { - DEBUG(3, ("prs_realloc_data: warning - " - "could not realloc to %d\n", new_size)); - } - else - { - DEBUG(3, ("prs_realloc_data: error - " - "could not realloc to %d\n", new_size)); - - prs_free_data(buf); - return False; - } - - prs_debug(buf, 200, "prs_realloc_data - after", "prs_realloc_data"); - return True; -} - -/******************************************************************* - return the memory location specified by offset; may return NULL. - ********************************************************************/ -char *prs_data(const prs_struct *buf, uint32 offset) -{ - - /* do we have something to look at? */ - if (buf == NULL) - return NULL; - - /* check to make sure the offset is within range */ - if ((offset < 0) || (offset >= buf->buffer_size)) - return NULL; - - /* locate the memory address */ - if (buf->data_p != NULL) - { - return &(buf->data_p[offset]); - } - - /* default return */ - return NULL; -} - - - - /* useful function to store a structure in rpc wire format */ int tdb_prs_store(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps) { -- cgit