![]() |
FOSSology
4.5.1
Open Source License Compliance by Open Source Software
|
Copy a file into the repository. More...
#include <stdlib.h>#include <stdio.h>#include <unistd.h>#include <string.h>#include <ctype.h>#include "libfossrepo.h"
Go to the source code of this file.
Functions | |
| void | CopyFile (char *Source, char *Type, char *Name) |
| int | ReadLine (FILE *Fin, char *Line, int MaxLine) |
| int | Hex2Dec (char C) |
| int | UnUnicodeHex (char *S) |
| void | ProcessPairs (FILE *Fin, char *Type) |
| void | ProcessXML (FILE *Fin, char *TypeSource, char *Type) |
| Process Ununpack XML. More... | |
| int | main (int argc, char *argv[]) |
Variables | |
| long | TotalImported = 0 |
| long | TotalDuplicate = 0 |
| long | TotalError = 0 |
Copy a file into the repository.
Input can be from stdin or command-line. stdin can be pairs of files, or xml.
Definition in file repcopyin.c.
| void CopyFile | ( | char * | Source, |
| char * | Type, | ||
| char * | Name | ||
| ) |
Given one file, copy it.
| Source | Source file path |
| Type | Type of source |
| Name | Destination file name |
Definition at line 39 of file repcopyin.c.
| int Hex2Dec | ( | char | C | ) |
Given a hex character, return decimal value.
| C | Hex character to convert |
Definition at line 87 of file repcopyin.c.
| void ProcessPairs | ( | FILE * | Fin, |
| char * | Type | ||
| ) |
Process pairs of names in format: dest src
| Fin | FP to read from |
| Type | Type of file |
Definition at line 117 of file repcopyin.c.
| void ProcessXML | ( | FILE * | Fin, |
| char * | TypeSource, | ||
| char * | Type | ||
| ) |
Process Ununpack XML.
Format comes from Ununpack -L. We care about fuid and source fields. We want to skip directories and artifacts.
| Fin | File pointer |
| TypeSource | Type of source |
| Type | Type of destination |
Definition at line 168 of file repcopyin.c.
| int ReadLine | ( | FILE * | Fin, |
| char * | Line, | ||
| int | MaxLine | ||
| ) |
Read a line from stdin.
| Fin | File to read from (STDIN) | |
| [out] | Line | Line read |
| MaxLine | Max length of line |
Definition at line 64 of file repcopyin.c.
| int UnUnicodeHex | ( | char * | S | ) |
Convert "ª" to hex.
| S | Unicode character |
Definition at line 100 of file repcopyin.c.