MCPcopy Create free account
hub / github.com/OpenPrinting/cups / load_words

Function load_words

cups/testarray.c:519–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517 */
518
519static int /* O - 1 on success, 0 on failure */
520load_words(const char *filename, /* I - File to load */
521 cups_array_t *array) /* I - Array to add to */
522{
523 FILE *fp; /* Test file */
524 char word[256]; /* Word from file */
525
526
527 if ((fp = fopen(filename, "r")) == NULL)
528 {
529 perror(filename);
530 return (0);
531 }
532
533 while (fscanf(fp, "%255s", word) == 1)
534 {
535 if (!cupsArrayFind(array, word))
536 cupsArrayAdd(array, strdup(word));
537 }
538
539 fclose(fp);
540
541 return (1);
542}

Callers 1

mainFunction · 0.85

Calls 2

cupsArrayFindFunction · 0.85
cupsArrayAddFunction · 0.85

Tested by

no test coverage detected