FOSSology  4.4.0
Open Source License Compliance by Open Source Software
nomos.c File Reference

Main for the nomos agent. More...

#include "nomos.h"
#include "nomos_utils.h"
Include dependency graph for nomos.c:

Go to the source code of this file.

Functions

void arsNomos (cacheroot_t *cacheroot, bool ignoreFilesWithMimeType)
 Make entry in ars table for audit. More...
 
void list_dir (const char *dir_name, int process_count, int *distribute_count, FILE **pFile)
 list all files and store file paths from the specified directory More...
 
void read_file_grab_license (int file_number, FILE **pFile)
 read line by line, then call processFile to grab license line by line More...
 
void myFork (int proc_num, FILE **pFile)
 the recursive create process and process grabbing licenses More...
 
int main (int argc, char **argv)
 

Variables

licText_t licText []
 
struct globals gl
 
struct curScan cur
 
char debugStr [myBUFSIZ]
 Debug string.
 
char dbErrString [myBUFSIZ]
 DB error string.
 
size_t hashEntries
 Hash entries.
 
int schedulerMode = 0
 
int Verbose = 0
 Verbose level. More...
 
char BuildVersion [] = "nomos build version: NULL.\n"
 

Detailed Description

Main for the nomos agent.

Nomos detects licenses and copyrights in a file. Depending on how it is invoked, it either stores it's findings in the FOSSology data base or reports them to standard out.

Definition in file nomos.c.

Function Documentation

◆ arsNomos()

void arsNomos ( cacheroot_t cacheroot,
bool  ignoreFilesWithMimeType 
)

Make entry in ars table for audit.

At the call, first checks if there are any entries in the ars table for the given agent and upload. If so, skip it. Otherwise, collect all files under the upload and processes them. Nomos sends a heart beat at every file scan completion.

At the end, make an entry in the ars using fo_WriteARS().

Parameters
cacherootRoot for hash table
ignoreFilesWithMimeTypeto exclude files with particular mimetype

Definition at line 60 of file nomos.c.

◆ list_dir()

void list_dir ( const char *  dir_name,
int  process_count,
int *  distribute_count,
FILE **  pFile 
)

list all files and store file paths from the specified directory

Parameters
dir_namedirectory
process_countprocess count, write file paths into temp files on average process_count
distribute_countTrack number of files
pFilefile descriptor array

Definition at line 142 of file nomos.c.

◆ main()

int main ( int  argc,
char **  argv 
)

Main entry point for nomos

< The list of files to scan

Definition at line 258 of file nomos.c.

◆ myFork()

void myFork ( int  proc_num,
FILE **  pFile 
)

the recursive create process and process grabbing licenses

Parameters
proc_numhow many child processes(proc_num - 1) will be created
pFiletemp path file pointers

Definition at line 230 of file nomos.c.

◆ read_file_grab_license()

void read_file_grab_license ( int  file_number,
FILE **  pFile 
)

read line by line, then call processFile to grab license line by line

Parameters
file_numberwhile temp path file do you want to read and process
pFilefile descriptor array

Definition at line 200 of file nomos.c.

Variable Documentation

◆ schedulerMode

int schedulerMode = 0

Non-zero when being run from scheduler

Definition at line 33 of file nomos.c.

◆ Verbose

int Verbose = 0

Verbose level.

Global verbose level.

Verbosity level

Definition at line 34 of file nomos.c.