summaryrefslogtreecommitdiff
path: root/beecrypt/memchunk.c
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@redhat.com>2007-02-16 16:20:02 +0000
committerPaul Nasrat <pnasrat@redhat.com>2007-02-16 16:20:02 +0000
commit1302fd60fc65fc3bd71c301c6d06e3505cdcf95e (patch)
treec4ffa89da116eae15496f5ded4f08d0457b914a1 /beecrypt/memchunk.c
parent29f8a24e89a3daaa7b325faa5bcb44cd0c2cb9b8 (diff)
downloadlibrpm-tizen-1302fd60fc65fc3bd71c301c6d06e3505cdcf95e.tar.gz
librpm-tizen-1302fd60fc65fc3bd71c301c6d06e3505cdcf95e.tar.bz2
librpm-tizen-1302fd60fc65fc3bd71c301c6d06e3505cdcf95e.zip
Remove internal beecrypt
Diffstat (limited to 'beecrypt/memchunk.c')
-rw-r--r--beecrypt/memchunk.c116
1 files changed, 0 insertions, 116 deletions
diff --git a/beecrypt/memchunk.c b/beecrypt/memchunk.c
deleted file mode 100644
index bce766926..000000000
--- a/beecrypt/memchunk.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2001 Virtual Unlimited B.V.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/*!\file memchunk.c
- * \author Bob Deblier <bob.deblier@pandora.be>
- */
-
-#include "system.h"
-
-#include "memchunk.h"
-
-#include "debug.h"
-
-memchunk* memchunkAlloc(size_t size)
-{
- memchunk* tmp = (memchunk*) calloc(1, sizeof(memchunk));
-
- if (tmp)
- {
- tmp->size = size;
- tmp->data = (byte*) malloc(size);
-
- if (tmp->data == (byte*) 0)
- {
- free(tmp);
- tmp = 0;
- }
- }
-
- return tmp;
-}
-
-void memchunkInit(memchunk* m)
- /*@modifies m @*/
-{
- m->data = (byte*) 0;
- m->size = 0;
-}
-
-void memchunkWipe(memchunk* m)
-{
- if (m)
- {
- if (m->data)
- {
- memset(m->data, 0, m->size);
- }
- }
-}
-
-void memchunkFree(memchunk* m)
-{
- if (m)
- {
- if (m->data)
- {
- free(m->data);
-
- m->size = 0;
- m->data = (byte*) 0;
- }
- free(m);
- }
-}
-
-memchunk* memchunkResize(memchunk* m, size_t size)
-{
- if (m)
- {
- if (m->data)
- m->data = (byte*) realloc(m->data, size);
- else
- m->data = (byte*) malloc(size);
-
- if (m->data == (byte*) 0)
- {
- free(m);
- m = (memchunk*) 0;
- }
- else
- m->size = size;
- }
-
- return m;
-}
-
-memchunk* memchunkClone(const memchunk* m)
-{
- if (m)
- {
- memchunk* tmp = memchunkAlloc(m->size);
-
- if (tmp)
- memcpy(tmp->data, m->data, m->size);
-
- return tmp;
- }
-
- return (memchunk*) 0;
-}