Back to index

radiance  4R0+20100331
Functions | Variables
duphead.c File Reference
#include "copyright.h"
#include "platform.h"
#include "standard.h"
#include "paths.h"

Go to the source code of this file.

Functions

void headclean ()
void openheader ()
void dupheader ()

Variables

static const char RCSid [] = "$Id: duphead.c,v 2.7 2003/10/22 02:06:35 greg Exp $"
int headismine = 1
static char * headfname = NULL
static FILE * headfp = NULL

Function Documentation

void dupheader ( void  )

Definition at line 49 of file duphead.c.

{
       register int  c;

       if (headfp == NULL) {
              if ((headfp = fopen(headfname, "r")) == NULL)
                     error(SYSTEM, "error reopening header file");
              SET_FILE_BINARY(headfp);
       } else if (fseek(headfp, 0L, 0) < 0)
              error(SYSTEM, "seek error on header file");
       while ((c = getc(headfp)) != EOF)
              putchar(c);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void headclean ( void  )

Definition at line 24 of file duphead.c.

{
       if (headfname == NULL)
              return;
       if (headfp != NULL)
              fclose(headfp);
       if (headismine)
              unlink(headfname);
}

Here is the caller graph for this function:

void openheader ( void  )

Definition at line 36 of file duphead.c.

{
       static char  template[] = TEMPLATE;

       headfname = mktemp(template);
       if (freopen(headfname, "w", stdout) == NULL) {
              sprintf(errmsg, "cannot open header file \"%s\"", headfname);
              error(SYSTEM, errmsg);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char* headfname = NULL [static]

Definition at line 19 of file duphead.c.

FILE* headfp = NULL [static]

Definition at line 20 of file duphead.c.

int headismine = 1

Definition at line 17 of file duphead.c.

const char RCSid[] = "$Id: duphead.c,v 2.7 2003/10/22 02:06:35 greg Exp $" [static]

Definition at line 2 of file duphead.c.