FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
demomod.h
1 /***************************************************************
2  Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License
6  version 2 as published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 
17 ***************************************************************/
18 #ifndef _DEMOMOD_H
19 #define _DEMOMOD_H 1
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <libgen.h>
23 #include <unistd.h>
24 #include <string.h>
25 #include <strings.h>
26 #include <ctype.h>
27 #include <getopt.h>
28 #include <errno.h>
29 #include <sys/types.h>
30 
31 #include <libfossology.h>
32 #define FUNCTION
33 
34 #define myBUFSIZ 2048
35 #define DataSize 32
36 
39 {
40  char Buf[DataSize];
41  char HexStr[(DataSize * 2) + 1];
42 };
44 
45 /* File utils.c */
46 void CheckTable (char *AgentARSName);
47 void ExitNow (int ExitVal);
48 void Char2Hex (char *InBuf, int NumBytes, char *OutBuf);
49 
50 /* File usage.c */
51 void Usage (char *Name);
52 
53 /* File process.c */
54 int ProcessUpload (int upload_pk, int agent_fk);
55 int ProcessFile (char *FilePath, pFileResult_t FileResult);
56 
57 #endif /* _DEMOMOD_H */
FUNCTION int ProcessUpload(int upload_pk, int agent_fk)
Process a single upload - read the first 32 bytes in each file.
Definition: process.c:73
FUNCTION void Char2Hex(char *InBuf, int NumBytes, char *OutBuf)
Convert a character buffer to a hex string.
Definition: utils.c:103
FUNCTION int ProcessFile(char *FilePath, pFileResult_t FileResult)
Process a single file - read the first 32 bytes.
Definition: process.c:36
FUNCTION void CheckTable(char *AgentARSName)
Check to make sure the demomod and demomod_ars tables exists.
Definition: utils.c:39
char HexStr[(DataSize *2)+1]
Hexadecimal string.
Definition: demomod.h:41
Usage()
Print Usage statement.
Definition: fo_dbcheck.php:75
FUNCTION void ExitNow(int ExitVal)
Exit function. This does all cleanup and should be used instead of calling exit() or main() return...
Definition: utils.c:120
The main FOSSology C library.
char Buf[DataSize]
Buffer.
Definition: demomod.h:40
const char * upload_pk
Definition: sqlstatements.h:93