tree: drop last paragraph of GPL copyright header
[coreboot.git] / payloads / bayou / util / pbuilder / liblar / liblar.h
blob4cbd52c690cd8777490649afc15fc7a6b13111fc
1 /*
2 * This file is part of the bayou project.
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef _LIBLAR_H_
17 #define _LIBLAR_H_
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include "lar.h"
24 typedef void (*LAR_CompFunc) (char *, int, char *, int *);
25 typedef void (*LAR_DecompFunc) (char *, int, char *, int);
27 struct LAR {
28 int fd;
29 LAR_CompFunc cfuncs[ALGO_INVALID];
30 LAR_DecompFunc dfuncs[ALGO_INVALID];
33 struct LARHeader {
34 u32 len;
35 u32 reallen;
36 u32 checksum;
37 u32 compression;
38 u64 loadaddress;
39 u64 entry;
40 /* These are the offsets within the file. */
41 unsigned int offset;
42 unsigned int hoffset;
45 struct LARAttr {
46 char name[MAX_PATHLEN];
47 u64 loadaddr;
48 int compression;
49 u64 entry;
52 struct LARFile {
53 int len;
54 char *buffer;
57 int LAR_AppendBuffer(struct LAR *lar, unsigned char *buffer, int len,
58 struct LARAttr *attr);
59 int LAR_AppendSelf(struct LAR *lar, const char *filename, struct LARAttr *attr);
60 int LAR_AppendFile(struct LAR *lar, const char *filename, struct LARAttr *attr);
61 int LAR_DeleteFile(struct LAR *lar, const char *filename);
62 void LAR_CloseFile(struct LARFile *file);
63 struct LARFile *LAR_MapFile(struct LAR *lar, const char *filename);
64 int LAR_SetCompressionFuncs(struct LAR *lar, int algo,
65 LAR_CompFunc cfunc, LAR_DecompFunc dfunc);
66 void LAR_Close(struct LAR *lar);
67 struct LAR *LAR_Open(const char *filename);
68 struct LAR *LAR_Create(const char *filename);
69 void LAR_SetAttrs(struct LARAttr *attrs, char *name, int algo);
71 #endif