FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
finder.h
1 /***************************************************************
2  Copyright (C) 2011 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 #include <stdlib.h>
19 #include <stdio.h>
20 #include <unistd.h>
21 #include <string.h>
22 #include <ctype.h>
23 #include <signal.h>
24 #include <magic.h>
25 #include <libgen.h>
26 
27 #include "libfossology.h"
28 
29 #define MAXCMD 1024
30 extern char SQL[MAXCMD];
31 
32 extern PGresult *DBMime;
33 extern int MaxDBMime;
34 extern PGconn *pgConn;
35 extern int Agent_pk;
36 
37 extern FILE *FMimetype;
38 
39 extern magic_t MagicCookie;
40 
41 extern int Akey;
42 extern char A[MAXCMD];
43 
44 void SetEnv (char *S);
45 void DBCheckMime (char *Filename);
46 int ReadLine(FILE *Fin, char *Line, int MaxLine);
47 void Usage (char *Name);
48 int DBFindMime (char *Mimetype);
PGresult * DBMime
contents of mimetype table
Definition: finder.c:27
PGconn * pgConn
Database connection.
Definition: adj2nest.c:98
int DBFindMime(char *Mimetype)
Find a mime type in the DBMime table.
Definition: finder.c:92
char A[MAXCMD]
input for this system
Definition: finder.c:37
void SetEnv(char *S, char *TempFileDir)
Convert input pairs into globals.
Definition: wget_agent.c:695
void DBCheckMime(char *Filename)
Given a file, check if it has a mime type in the DB.
Definition: finder.c:292
char SQL[256]
SQL query to execute.
Definition: adj2nest.c:90
Usage()
Print Usage statement.
Definition: fo_dbcheck.php:75
int Agent_pk
agent identifier
Definition: finder.c:30
The main FOSSology C library.
int MaxDBMime
how many rows in DBMime
Definition: finder.c:28
FILE * FMimetype
for /etc/mime.types
Definition: finder.c:32
magic_t MagicCookie
for Magic
Definition: finder.c:34
int ReadLine(FILE *Fin, char *Line, int MaxLine)
Definition: repcopyin.c:77
char * Filename
Filename.
Definition: run_tests.c:28