Fixed the update-libraries script (thanks to Anderson Souza) and added a basic Linux daemon for the server

This commit is contained in:
Fatbag 2012-11-11 17:10:53 -06:00
parent bb904c4698
commit 5444c9aea6
19 changed files with 260 additions and 84 deletions

View file

@ -1,6 +1,6 @@
/*
FileHandler - General-purpose file handling library for Niotso
libfar.c - Copyright (c) 2011 Niotso Project <http://niotso.org/>
far.c - Copyright (c) 2011-2012 Niotso Project <http://niotso.org/>
Author(s): Fatbag <X-Fi6@phppoll.org>
Permission to use, copy, modify, and/or distribute this software for any
@ -72,21 +72,18 @@ int far_identify(const uint8_t * Buffer, unsigned FileSize)
return FAR_TYPE_INVALID;
#ifdef FAR_SUPPORT_FAR
if(FileSize >= MINSIZE_FAR)
if(!memcmp(Buffer, Header_FAR, 8))
return FAR_TYPE_FAR;
if(FileSize >= MINSIZE_FAR && !memcmp(Buffer, Header_FAR, 8))
return FAR_TYPE_FAR;
#endif
#ifdef FAR_SUPPORT_DBPF
if(FileSize >= MINSIZE_DBPF)
if(!memcmp(Buffer, Header_DBPF, 4))
return FAR_TYPE_DBPF;
if(FileSize >= MINSIZE_DBPF && !memcmp(Buffer, Header_DBPF, 4))
return FAR_TYPE_DBPF;
#endif
#ifdef FAR_SUPPORT_PERSIST
if(FileSize >= MINSIZE_PERSIST)
if(Buffer[0] == 0x01)
return FAR_TYPE_PERSIST;
if(FileSize >= MINSIZE_PERSIST && Buffer[0] == 0x01)
return FAR_TYPE_PERSIST;
#endif
return FAR_TYPE_INVALID;

View file

@ -1,6 +1,6 @@
/*
FileHandler - General-purpose file handling library for Niotso
libfar.h - Copyright (c) 2011 Niotso Project <http://niotso.org/>
far.h - Copyright (c) 2011 Niotso Project <http://niotso.org/>
Author(s): Fatbag <X-Fi6@phppoll.org>
Permission to use, copy, modify, and/or distribute this software for any

View file

@ -21,7 +21,6 @@
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include "config.h"
#include "far.h"
enum {

View file

@ -159,5 +159,5 @@ int RefPackDecompress(const uint8_t *__restrict CompressedData, size_t Compresse
}
}
return (!stopflag || CompressedSize || DecompressedSize) ? 0 : 1;
return (stopflag && !CompressedSize && !DecompressedSize);
}