FOSSology  4.4.0
Open Source License Compliance by Open Source Software
demomod.h
1 /*
2  SPDX-FileCopyrightText: © 2013 Hewlett-Packard Development Company, L.P.
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #ifndef _DEMOMOD_H
8 #define _DEMOMOD_H 1
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <libgen.h>
12 #include <unistd.h>
13 #include <string.h>
14 #include <strings.h>
15 #include <ctype.h>
16 #include <getopt.h>
17 #include <errno.h>
18 #include <sys/types.h>
19 
20 #include <libfossology.h>
21 #define FUNCTION
22 
23 #define myBUFSIZ 2048
24 #define DataSize 32
25 
28 {
29  char Buf[DataSize];
30  char HexStr[(DataSize * 2) + 1];
31 };
33 
34 /* File utils.c */
35 void CheckTable (char *AgentARSName);
36 void ExitNow (int ExitVal);
37 void Char2Hex (char *InBuf, int NumBytes, char *OutBuf);
38 
39 /* File usage.c */
40 void Usage (char *Name);
41 
42 /* File process.c */
43 int ProcessUpload (int upload_pk, int agent_fk);
44 int ProcessFile (char *FilePath, pFileResult_t FileResult);
45 
46 #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:61
FUNCTION int ProcessFile(char *FilePath, pFileResult_t FileResult)
Process a single file - read the first 32 bytes.
Definition: process.c:24
FUNCTION void Char2Hex(char *InBuf, int NumBytes, char *OutBuf)
Convert a character buffer to a hex string.
Definition: utils.c:91
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:108
FUNCTION void CheckTable(char *AgentARSName)
Check to make sure the demomod and demomod_ars tables exists.
Definition: utils.c:27
Usage()
Print Usage statement.
Definition: fo_dbcheck.php:63
The main FOSSology C library.
const char * upload_pk
Definition: sqlstatements.h:82
char HexStr[(DataSize *2)+1]
Hexadecimal string.
Definition: demomod.h:30
char Buf[DataSize]
Buffer.
Definition: demomod.h:29