|
/*
* Copyright (C) 2002-2008 XimpleWare, info@ximpleware.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef CONTEXTBUFFER_H
#define CONTEXTBUFFER_H
#include <stdlib.h>
#include "arrayList.h"
#include "customTypes.h"
//data structure for the global stack used in VTDNav
typedef struct contextBuffer{
ArrayList *al;
int capacity;
int incSize;
int n;
int pageSize;
int r;
int size;
} ContextBuffer;
// Create ContextBuffer with incSize of i
ContextBuffer *createContextBuffer(int i);
// Create ContextBuffer with page size (1<<e) and increment Size of i
ContextBuffer *createContextBuffer2(int e, int i);
// Free ContextBuffer
void freeContextBuffer(ContextBuffer *cb);
// Pop the content value back into an integer array.
Boolean load(ContextBuffer *cb, int* output);
// Push the array content on to the stack.
void store(ContextBuffer *cb, int *input);
// Manage the buffer size to reduce unused spaces
void resize(ContextBuffer *cb);
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Jimmy Zhang is a cofounder of XimpleWare, a provider of high performance XML processing solutions. He has working experience in the fields of electronic design automation and Voice over IP for a number of Silicon Valley high-tech companies. He holds both a BS and MS from the department of EECS from U.C. Berkeley.