Lines Matching defs:resource

257 static void AddHashedResource(resource, category)
258 Resource *resource;
269 hash = Hash(resource->file);
273 comparison = strcmp (current->file, resource->file);
277 strcmp(current->name, resource->name) != 0) break;
284 category->hash[hash] = resource;
285 resource->next = NULL;
288 resource->next = NULL;
289 previous->next = resource;
292 resource->next = current;
295 category->hash[hash] = resource;
297 previous->next = resource;
344 Resource *resource,
349 resource = (Resource *) ckcalloc (1, sizeof (Resource),
352 resource->name = ckmalloc (strlen (resourceName) + 1,
355 strcpy (resource->name, resourceName);
359 resource->file = ckmalloc (strlen (fileName) + 1,
362 strcpy (resource->file, fileName);
364 resource->noPrefix = noPrefix;
367 AddHashedResource(resource, category);
382 EnterDuplicateWarning(category, current, resource);
386 free (resource->name);
387 free (resource->file);
388 free (resource);
397 category->list = resource;
399 resource->next = NULL;
400 previous->next = resource;
402 resource->next = current;
405 category->list = resource;
407 previous->next = resource;
417 Resource *resource;
420 for (resource = category->list;
421 resource != NULL && strcmp(resource->name, resourceName) != 0;
422 resource = resource->next) {}
424 if (resource != NULL) return true;
429 for (resource = category->hash[i];
430 resource != NULL && strcmp(resource->name, resourceName) != 0;
431 resource = resource->next) {}
432 if (resource != NULL) return true;
463 UPRResource *resource, *current, *previous;
474 resource = (UPRResource *) ckcalloc (1, sizeof (UPRResource),
477 resource->name = ckmalloc (strlen (resourceName) + 1,
480 strcpy (resource->name, resourceName);
482 resource->file = ckmalloc (strlen (fileName) + strlen(prefix) + 2,
486 strcpy (resource->file, prefix);
487 strcat (resource->file, "/");
488 strcat (resource->file, fileName);
489 } else strcpy (resource->file, fileName);
491 resource->category = ckmalloc (strlen (categoryName) + 1,
494 strcpy(resource->category, categoryName);
496 resource->noPrefix = noPrefix;
497 resource->found = false;
499 hash = Hash(resource->file);
503 comparison = strcmp (current->file, resource->file);
509 if (strcmp(current->name, resource->name) != 0 ||
510 strcmp(current->category, resource->category) != 0) { /* Same */
514 /* Replace "NONRESOURCE" entry with resource one */
516 current->name = resource->name;
518 current->category = resource->category;
519 free(resource->file);
520 free (resource);
525 program, resource->file);
528 free (resource->name);
529 free (resource->file);
530 free (resource->category);
531 free (resource);
539 UPRresources[hash] = resource;
540 resource->next = NULL;
543 resource->next = NULL;
544 previous->next = resource;
546 resource->next = current;
549 UPRresources[hash] = resource;
551 previous->next = resource;
1358 printf(" 0 - Not a resource file\n");
1396 printf("Please enter resource category: ");
1403 printf("Please enter resource name: ");
1490 UPRResource *resource = UPRresources[Hash(filename)];
1492 while (resource != NULL && strcmp(filename, resource->file) != 0) {
1493 resource = resource->next;
1495 if (resource == NULL) return false;
1496 AddResource(resource->category, resource->name, resource->file,
1497 resource->noPrefix);
1712 Resource *resource;
1722 for (resource = category->list; resource != NULL;
1723 resource = resource->next) {
1724 for (upr = UPRresources[Hash(resource->file)];
1725 upr != NULL && strcmp(upr->file, resource->file) < 0;
1732 for (resource = category->hash[bucket]; resource != NULL;
1733 resource = resource->next) {
1734 for (upr = UPRresources[Hash(resource->file)];
1735 upr != NULL && strcmp(upr->file, resource->file) < 0;
1816 Resource *resource;
1834 resource = category->list;
1836 while (resource != NULL) {
1837 if (resource->noPrefix) {
1838 resource = resource->next;
1842 prefix = ckmalloc(strlen(resource->file) + 1,
1844 strcpy(prefix, resource->file);
1850 ch2 = resource->file;
1862 resource = resource->next;
1867 for (resource = category->hash[bucket]; resource != NULL;
1868 resource = resource->next) {
1870 if (resource->noPrefix) continue;
1873 prefix = ckmalloc(strlen(resource->file) + 1,
1875 strcpy(prefix, resource->file);
1881 ch2 = resource->file;
1944 Resource *resource;
1975 resource = category->list;
1980 while (resource != NULL) {
1981 outs(resource->name);
1983 if (resource->noPrefix) {
1985 outs(resource->file);
1986 } else outs(resource->file+prefixlen);
1988 resource = resource->next;
1991 while (resource != NULL) {
1992 outs(resource->name);
1994 outs(resource->file);
1995 pname = resource->name;
1996 resource = resource->next;
1997 while (resource != NULL && strcmp(resource->name, pname) == 0) {
1999 outs(resource->file);
2000 resource = resource->next;
2007 for (resource = category->hash[bucket]; resource != NULL;
2008 resource = resource->next) {
2009 outs(resource->name);
2011 if (resource->noPrefix) {
2013 outs(resource->file);
2014 } else outs(resource->file+prefixlen);
2219 "%s: Warning: The output resource file contains the following\n",