Back to index

enigmail  1.4.3
Functions | Variables
pr.c File Reference
#include "def.h"

Go to the source code of this file.

Functions

void add_include (struct filepointer *filep, struct inclist *file, struct inclist *file_red, char *include, int type, boolean failOK)
static void pr (struct inclist *ip, char *file, char *base)
void recursive_pr_include (struct inclist *head, char *file, char *base)

Variables

struct * inclistp
char * objprefix
char * objsuffix
int width
boolean printed
boolean verbose
boolean show_where_not

Function Documentation

void add_include ( struct filepointer filep,
struct inclist file,
struct inclist file_red,
char *  include,
int  type,
boolean  failOK 
)

Definition at line 41 of file pr.c.

{
       register struct inclist     *newfile;
       register struct filepointer *content;

       /*
        * First decide what the pathname of this include file really is.
        */
       newfile = inc_path(file->i_file, include, type);
       if (newfile == NULL) {
              if (failOK)
                  return;
              if (file != file_red)
                     warning("%s (reading %s, line %d): ",
                            file_red->i_file, file->i_file, filep->f_line);
              else
                     warning("%s, line %d: ", file->i_file, filep->f_line);
              warning1("cannot find include file \"%s\"\n", include);
              show_where_not = TRUE;
              newfile = inc_path(file->i_file, include, type);
              show_where_not = FALSE;
       }

       if (newfile) {
              included_by(file, newfile);
              if (!(newfile->i_flags & SEARCHED)) {
                     newfile->i_flags |= SEARCHED;
                     content = getfile(newfile->i_file);
                     find_includes(content, newfile, file_red, 0, failOK);
                     freefile(content);
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void pr ( struct inclist ip,
char *  file,
char *  base 
) [static]

Definition at line 78 of file pr.c.

{
       static char   *lastfile;
       static int    current_len;
       register int  len, i;
       char   buf[ BUFSIZ ];

       printed = TRUE;
       len = strlen(ip->i_file)+1;
       if (current_len + len > width || file != lastfile) {
              lastfile = file;
              sprintf(buf, "\n%s%s%s: %s", objprefix, base, objsuffix,
                     ip->i_file);
              len = current_len = strlen(buf);
       }
       else {
              buf[0] = ' ';
              strcpy(buf+1, ip->i_file);
              current_len += len;
       }
       fwrite(buf, len, 1, stdout);

       /*
        * If verbose is set, then print out what this file includes.
        */
       if (! verbose || ip->i_list == NULL || ip->i_flags & NOTIFIED)
              return;
       ip->i_flags |= NOTIFIED;
       lastfile = NULL;
       printf("\n# %s includes:", ip->i_file);
       for (i=0; i<ip->i_listlen; i++)
              printf("\n#\t%s", ip->i_list[ i ]->i_incstring);
}

Here is the caller graph for this function:

void recursive_pr_include ( struct inclist head,
char *  file,
char *  base 
)

Definition at line 113 of file pr.c.

{
       int    i;

       if (head->i_flags & MARKED)
              return;
       head->i_flags |= MARKED;
       if (head->i_file != file)
              pr(head, file, base);
       for (i=0; i<head->i_listlen; i++)
              recursive_pr_include(head->i_list[ i ], file, base);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct * inclistp

Definition at line 96 of file main.c.

char* objprefix

Definition at line 106 of file main.c.

char* objsuffix

Definition at line 107 of file main.c.

Definition at line 111 of file main.c.

Definition at line 113 of file main.c.

Definition at line 220 of file upload.py.

int width

Definition at line 109 of file main.c.