Commit 2258a7b8 authored by Niels Möller's avatar Niels Möller
Browse files

Moved macros to a separate file.

Rev: src/parse.c:1.22
Rev: src/parse_macros.h:1.1
parent feae7881
......@@ -30,6 +30,8 @@
#include "werror.h"
#include "xalloc.h"
#include "parse_macros.h"
#include <assert.h>
#include <string.h>
......@@ -41,10 +43,6 @@ void simple_buffer_init(struct simple_buffer *buffer,
buffer->data = data;
}
#define LEFT (buffer->capacity - buffer->pos)
#define HERE (buffer->data + buffer->pos)
#define ADVANCE(n) (buffer->pos += (n))
int parse_uint32(struct simple_buffer *buffer, UINT32 *result)
{
if (LEFT < 4)
......
/* parse_macros.h
*
* Utility macros for managing a struct simple_buffer *buffer.
*
* $Id$ */
#ifndef LSH_PARSE_MACROS_H_INCLUDED
#define LSH_PARSE_MACROS_H_INCLUDED
#ifndef BUFFER
#define BUFFER buffer
#endif
#define LEFT (BUFFER->capacity - BUFFER->pos)
#define HERE (BUFFER->data + BUFFER->pos)
#define ADVANCE(n) (BUFFER->pos += (n))
#define GET() (BUFFER->data[BUFFER->pos++])
#endif */ LSH_PARSE_MACROS_H_INCLUDED */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment