![]() |
FOSSology
4.7.1
Open Source License Compliance by Open Source Software
|
Scanoss agent for Fossology. Scans for licenses on osskb.org. More...
#include "snippet_scan.h"#include <stdio.h>#include <errno.h>#include <sys/types.h>#include <sys/wait.h>#include <unistd.h>
Go to the source code of this file.
Functions | |
| void | logme (char *msg) |
| static int | run_scanoss_command (const char *pythonPath, const char *scanossPath, const char *folder, const char *outputFile, const char *apiurl, const char *key) |
| Safely run scanoss-py command using fork+exec instead of popen. More... | |
| int | splitLine (char *lineToSplit, char *separator, char **fields) |
| void | extract_csv (char *out, char *in, int n, long limit, char sep) |
| FILE * | openFileByKey (long pFileKey) |
| Open a file of the repository given its primary key. More... | |
| int | getLicenseId (unsigned char *name) |
| Retrieves the license id (license_ref.rf_pk) given its short name. | |
| void | dumpToFile (const char *path, unsigned char *content, long size) |
| Dumps the content of a file in the repository to a temporary file. More... | |
| void | RestoreTempFile (char *uploadFolder, long key, long realParent, char *realName) |
| void | ParseResults (char *folder) |
| Parse results from a temporary file and store results on database. More... | |
| int | ScanFolder (char *folder) |
| Scans a Temporary folder. More... | |
| int | RebuildUpload (long upload_pk, char *tempFolder) |
| void | Usage (char *Name) |
| Say how to run this program. More... | |
Variables | |
| char * | baseTMP |
| int | Verbose = 0 |
| Verbose level. More... | |
| PGconn * | db_conn = NULL |
| The connection to Database. More... | |
| int | Agent_pk |
| agent identifier | |
| char | ApiUrl [200] |
| char | accToken [100] |
Scanoss agent for Fossology. Scans for licenses on osskb.org.
The SCANOSS Agent for Fossology tool
Copyright (C) 2018-2025 SCANOSS.COM
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Definition in file snippet_scan.c.
| void dumpToFile | ( | const char * | path, |
| unsigned char * | content, | ||
| long | size | ||
| ) |
Dumps the content of a file in the repository to a temporary file.
| path | Path to the temporary file |
| content | Buffer containing the file |
| size | Size of the file to be stored |
Definition at line 236 of file snippet_scan.c.
| FILE* openFileByKey | ( | long | pFileKey | ) |
Open a file of the repository given its primary key.
| pFileKey | the key of the file to be retrieved |
Definition at line 174 of file snippet_scan.c.
| void ParseResults | ( | char * | folder | ) |
Parse results from a temporary file and store results on database.
| folder | Path to the temporary project folder |
Definition at line 291 of file snippet_scan.c.
|
static |
Safely run scanoss-py command using fork+exec instead of popen.
| pythonPath | Path to Python dependencies |
| scanossPath | Path to scanoss-py executable |
| folder | Folder to scan |
| outputFile | Output CSV file path |
| apiurl | API URL option (or empty string) |
| key | API key option (or empty string) |
Definition at line 46 of file snippet_scan.c.
| int ScanFolder | ( | char * | folder | ) |
Scans a Temporary folder.
Scans a Temporary folder with a rebuild project and places results in results.csv
| folder | path to temp folder |
Definition at line 403 of file snippet_scan.c.
| void Usage | ( | char * | Name | ) |
Say how to run this program.
Print usage of bucket agent
| Name | Absolute path of agent |
Many agents permit running from the command-line for testing. At minimum, you need "-i" to initialize the DB and exit.
Say how to run this program.
| Name | - the name of the executable, usually it is mimetype |
Say how to run this program.
| Name | Path to nomos binary |
Say how to run this program.
Say how to run this program.
| Name | Path of the binary |
Definition at line 533 of file snippet_scan.c.
| PGconn* db_conn = NULL |
The connection to Database.
the connection to Database
Definition at line 129 of file snippet_scan.c.
| int Verbose = 0 |
Verbose level.
Global verbose level.
Contains all the functions supported by delagent
Verbosity level
Definition at line 128 of file snippet_scan.c.