FOSSology  4.4.0
Open Source License Compliance by Open Source Software
process.c
Go to the documentation of this file.
1 /*
2  SPDX-FileCopyrightText: © 2006-2011 Hewlett-Packard Development Company, L.P.
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
11 #include "nomos.h"
12 #include "process.h"
13 #include "licenses.h"
14 #include "util.h"
15 #include "list.h"
16 
17 #ifdef MEMSTATS
18 extern void memStats();
19 #endif /* MEMSTATS */
20 
21 #define BOGUS_MD5 "wwww0001xxxx0002yyyy0004zzzz0008"
22 
23 
30 {
31  /* item_t *p; doesn't look like this is used */
32 
33 #if defined(PROC_TRACE) || defined(UNPACK_DEBUG)
34  traceFunc("== processNonPackagedFiles()\n");
35 #endif /* PROC_TRACE || UNPACK_DEBUG */
36 
37  /*
38  * If there are unused/unreferenced source archives, they need to be
39  * processed individually. Create the global 'unused archives' list
40  * and hand it off to be processed.
41  */
42 #ifdef UNPACK_DEBUG
43  listDump(&cur.regfList, NO);
44 #endif /* UNPACK_DEBUG */
45  if (!cur.regfList.used) {
46  printf("No-data!\n");
47  return;
48  } else {
49  /* CDB *cur.basename = NULL_CHAR; */
51  /* since p isn't used, reduce the following to just the listGetItem
52  since it mods the global cur
53  p = listGetItem(&cur.fLicFoundMap, BOGUS_MD5);
54  p->buf = copyString(cur.compLic, MTAG_COMPLIC);
55  p->refCount++;
56  p->buf = copyString(BOGUS_MD5, MTAG_MD5SUM);
57  */
58  listGetItem(&cur.fLicFoundMap, BOGUS_MD5);
59  }
60  return;
61 }
62 
63 
64 
65 #ifdef notdef
69 void stripLine(char *textp, int offset, int size)
70 {
71  char *start, *end;
72  extern char *findBol();
73 
74 #ifdef PROC_TRACE
75  traceFunc("== stripLine(%s, %d, %d)\n", textp, offset, size);
76 #endif /* PROC_TRACE */
77 
78  if ((end = findEol((char *)(textp+offset))) == NULL_STR) {
79  Assert(NO, "No EOL found!");
80  }
81  if ((start = findBol((char *)(textp+offset), textp)) == NULL_STR) {
82  Assert(NO, "No BOL found!");
83  }
84 #ifdef DEBUG
85  printf("Textp %p start %p end %p\n", textp, start, end);
86  printf("@START(%d): %s", strlen(start), start);
87  printf("@END+1(%d): %s", strlen(end+1), end+1);
88 #endif /* DEBUG */
89  if (*(end+1) == NULL_CHAR) { /* EOF */
90  *start = NULL_CHAR;
91  }
92  else {
93 #ifdef DEBUG
94  printf("MOVE %d bytes\n", size-(end-textp));
95 #endif /* DEBUG */
96  (void) memmove(start, (char *)(end+1),
97  (size_t)((size)-(end-textp)));
98  }
99 #ifdef DEBUG
100  printf("FINISH: @START(%d): %s", strlen(start), start);
101 #endif /* DEBUG */
102  return;
103 }
104 #endif /* notdef */
105 
106 
114 {
115 #ifdef PROC_TRACE
116  traceFunc("== processRawSource()\n");
117 #endif /* PROC_TRACE */
118 
119 #ifdef PACKAGE_DEBUG
120  listDump(&cur.regfList, NO);
121 #endif /* PACKAGE_DEBUG */
122 
124  return;
125 }
126 
136 {
137 #ifdef PROC_TRACE
138  traceFunc("== processRegularFiles()\n");
139 #endif /* PROC_TRACE */
140 
141  /* CDB (void) sprintf(cur.basename, "misc-files"); */
142  /* loop through the list here -- and delete files with link-count >1? */
143  licenseScan(&cur.regfList);
144  return;
145 }
146 
void licenseScan(list_t *licenseList)
scan the list for a license(s)
Definition: licenses.c:747
void listDump(list_t *l, int verbose)
print the passed in list
Definition: list.c:829
item_t * listGetItem(list_t *l, char *s)
get an item from the itemlist. If the item is not in the itemlist, then add it to the itemlist.
Definition: list.c:246
void processRawSource()
Definition: process.c:113
static void processNonPackagedFiles()
Definition: process.c:29
void processRegularFiles()
Process a list of regular files.
Definition: process.c:135
char * findBol(char *s, char *upperLimit)
Find Begin of Line in a string.
Definition: util.c:340
void Assert(int fatalFlag, const char *fmt,...)
Raise an assert.
Definition: util.c:1395
char * findEol(char *s)
Find first ROL in a string.
Definition: util.c:378
Nomos header file.
#define NULL_STR
NULL string.
Definition: nomos.h:235
#define NO
Definition: nomos.h:171
#define NULL_CHAR
NULL character.
Definition: nomos.h:234
start($application)
start the application Assumes application is restartable via /etc/init.d/<script>....
Definition: pkgConfig.php:1214
int used
Definition: nomos.h:310