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GAJDM4ARWKNWOSWAC
4RYULBDDDIVSJTIOTBBSQAWMSN6ZBZEFJ6UR7P6ECEXEXTGPMUOAC
RIWSVVASWLJQQTSVRHIIUPENOZWOMHQLZMTQVGJUS2ZUGDPSWWIQC
IS5A7VT6TJ6ZXKY5LNUVT4BF4OV2Y3XCII4L4VI6XAKRKL42DJSQC
QEFCNNVCEDFUV7O4ASWVI4QUTUFWLHAOTJMDCZ3DFJIUQWTAN3SAC
LVX6U4EKYXM6H32X5SZS4UBIM5PW4ND4F4QQOF5EQDX3DUHBYFGAC
B3XLVPNC4COLLC3FUE34Y7HIKTMF6CJZUASZOU3YM2YGPZKJZP7QC
AHIXA5ZESN6QJXV2LKRSC4H5ZRFMJFHFPY2RQRARTH3XJLLCMCGQC
GCZYAURZNOMZ635LMJRENB5H2Z56NZ72UIVLWTJKAUSALCUCPEMQC
RRUEU4S3AURC5RPK7JPHYQUOS54KDLXGKF7MCB4Z6PWZ47534OBAC
WNZP5NXYZYP5TFMKQZRLPT6UXBNBNYXLBWWZL5DQDRCM7ZWZ5CJAC
#ifndef ANI_COMMON_H
#define ANI_COMMON_H
typedef char * str;
/* Banned functions */
/*
* This header lists functions that have been banned from our code base,
* because they're too easy to misuse (and even if used correctly,
* complicate audits). Including this header turns them into compile-time
* errors.
*/
#define BANNED(func) sorry_##func##_is_a_banned_function
#undef strcpy
#define strcpy(x, y) BANNED(strcpy)
#undef strcat
#define strcat(x, y) BANNED(strcat)
#undef strncpy
#define strncpy(x, y, n) BANNED(strncpy)
#undef strncat
#define strncat(x, y, n) BANNED(strncat)
#undef sprintf
#undef vsprintf
#define sprintf(...) BANNED(sprintf)
#define vsprintf(...) BANNED(vsprintf)
#undef gmtime
#define gmtime(t) BANNED(gmtime)
#undef localtime
#define localtime(t) BANNED(localtime)
#undef ctime
#define ctime(t) BANNED(ctime)
#undef ctime_r
#define ctime_r(t, buf) BANNED(ctime_r)
#undef asctime
#define asctime(t) BANNED(asctime)
#undef asctime_r
#define asctime_r(t, buf) BANNED(asctime_r)
#endif
struct change_header {
char *message; /* the "commit" message */
char *description; /* the other undescribed part of a change */
char *timestamp; /* yes, as a string */
struct authors authors; /* a list of "key"="value" collections */
};
typedef struct {
str message; /* the "commit" message */
str description; /* the other undescribed part of a change */
str timestamp; /* yes, as a string */
Authors authors; /* a list of "key"="value" collections */
} Changeheader;
struct change_header header;
struct hash_list dependencies; /* array of hashes */
struct hash_list extra_known; /* another array of hashes */
};
Changeheader header;
Hashlist dependencies; /* array of hashes */
Hashlist extraknown; /* another array of hashes */
} Hashed;
uint8_t bincode_getu8(struct bincode_state *);
uint16_t bincode_getu16(struct bincode_state *);
uint32_t bincode_getu32(struct bincode_state *);
uint64_t bincode_getu64(struct bincode_state *);
uint8_t bincode_getu8(Bincode *);
uint16_t bincode_getu16(Bincode *);
uint32_t bincode_getu32(Bincode *);
uint64_t bincode_getu64(Bincode *);
### Header files
Simple rule: include files should never include include files (see
[pikestyle][pikestyle]). Instead they state (in comments or implicitly)
what files they need to have included first, the problem of deciding which
files to include is pushed to the user. (vendored header files are exempted
from this rule to make it easier to update a vendored dependency.)
### Include files
In addition, system include files should be grouped first before any user
include files, and the first user include file _must_ be common.h. All .c
files in this project _must_ include common.h As an example, this is the
correct way to include files:
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
Simple rule: include files should never include include files. Instead they
state (in comments or implicitly) what files they need to have included first,
the problem of deciding which files to include is pushed to the user.
#include "common.h"
#include "atom.h"
Prefer to leave a blank line in between the system includes and user includes.
### Type declarations