#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(WIN32)
#include <fcntl.h>
#include <io.h>
#endif
enum Commands { … };
bool ReadInt(int* out) { … }
void WriteResponse(void* data, int size) { … }
struct Box { … };
struct Bitmap { … };
static inline
bool PixelsEqual(const unsigned char* pixel1, const unsigned char* pixel2,
int tolerance) { … }
static inline
bool PixelsEqual(const unsigned char* pixel, int color, int tolerance) { … }
static
bool Histogram(const Bitmap& bmp) { … }
static
bool BoundingBox(const Bitmap& bmp) { … }
int main() { … }