Skip to content

Commit

Permalink
use standard layout for referenced golang packages in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrh committed Nov 20, 2018
1 parent 41493e4 commit b91b1ad
Show file tree
Hide file tree
Showing 10 changed files with 1,169 additions and 39 deletions.
12 changes: 6 additions & 6 deletions c/go/src/brotli/brotli.go → c/go/brotli/brotli.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package brotli

/*
#cgo CFLAGS: -I../../..
#cgo LDFLAGS: -L../../../target/release -l brotli_ffi -lm -ldl
#include <brotli/encode.h>
#include <brotli/decode.h>
#include <brotli/broccoli.h>
#include <brotli/multiencode.h>
#cgo CFLAGS: -I../../.. -I.
#cgo LDFLAGS: -L../../../target/release -L../target/release -L../../target/release -lbrotli_ffi -lm -ldl
#include "brotli/encode.h"
#include "brotli/decode.h"
#include "brotli/broccoli.h"
#include "brotli/multiencode.h"
static BrotliDecoderResult BrDecompressStream(BrotliDecoderState* s,
size_t *avail_in,
const uint8_t* in,
Expand Down
38 changes: 38 additions & 0 deletions c/go/brotli/brotli/broccoli.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#ifndef BROTLI_BROCCOLI_H
#define BROTLI_BROCCOLI_H
#include <stdint.h>
typedef struct BroccoliState_ {
void *unused;
unsigned char data[248];
} BroccoliState;

typedef enum BroccoliResult_ {
BroccoliSuccess = 0,
BroccoliNeedsMoreInput = 1,
BroccoliNeedsMoreOutput = 2,
BroccoliBrotliFileNotCraftedForAppend = 124,
BroccoliInvalidWindowSize = 125,
BroccoliWindowSizeLargerThanPreviousFile = 126,
BroccoliBrotliFileNotCraftedForConcatenation = 127,
} BroccoliResult;


BroccoliState BroccoliCreateInstance();

BroccoliState BroccoliCreateInstanceWithWindowSize(uint8_t window_size);

void BroccoliDestroyInstance(BroccoliState state);

void BroccoliNewBrotliFile(BroccoliState *state);

BroccoliResult BroccoliConcatStream(
BroccoliState *state,
size_t *available_in,
const uint8_t **input_buf_ptr,
size_t *available_out,
uint8_t **output_buf_ptr);

BroccoliResult BroccoliConcatFinish(BroccoliState * state,
size_t *available_out,
uint8_t**output_buf);
#endif
Loading

0 comments on commit b91b1ad

Please sign in to comment.