/*
 *   This file was automatically generated by version 1.7 of cextract.
 *   Manual editing not recommended.
 *
 *   Created: Tue Apr 27 16:07:20 1993
 */
#ifndef __CEXTRACT__
#if __STDC__

/*
 * initializes reading files from the specified directory. f_state keeps
 * the status information needed by afind_read() and afind_close().
 */
int afind_init ( char *dir, struct AFIND_STATE *f_state );

/*
 * returns a filename from the directory with which f_state was initialized.
 * the returned string is freeable. If all names have been read, NULL is
 * returned
 */
char *afind_read ( struct AFIND_STATE *f_state );

/*
 * completes reading files with afind, frees memory
 */
void afind_close ( struct AFIND_STATE *f_state );

/*ARGSUSED*/
int read_out_name ( char *o, char *arg );

void usage ( void );

/* main function (this should be obvious) */
int main ( int argc, char **argv );

/* convert fname, if recursive, maybe directory */
void convert ( char *fname, FILE *out );

/* convert a directory named RCS */
void convert_rcsdir ( char *rdir, FILE *out );

/* comment leader string */
void convert_revision ( FILE *out, char *wkfile, bool branches, struct RCSREV *rev, bool initial, char *comment_leader );

/* build shell script for converting the archive */
void make_shell_script ( char *directory, struct RCSFILE *rcsfile, FILE *out );

/* read rlogin output into a struct RCSFILE */
struct RCSFILE *readin_rcsfile ( char *fname );

/* The name of the following two functions should have been
 * "compare_revisions_by_number" and "compare_revisions_by_date", but
 * I guess there still some compilers that treat only the first some
 * (10? 8? 6?) characters of an identifier as significant. (WHY?!) 
 * These two are needed for qsort()ing an array of revision pointers.
 */
int number_compare_revisions ( struct RCSREV **r1, struct RCSREV **r2 );

int date_compare_revisions ( struct RCSREV **r1, struct RCSREV **r2 );

/* sort revisions by revision number, if branches exist by date */
void sort_revisions ( struct RCSFILE *rcsfile );

/* check if all needed fields in rcsfile are present */
short check_rcsfile ( struct RCSFILE *rcsfile );

/* apply symbolic names to apropriate revisions */
void apply_symnames ( struct RCSFILE *rcsfile, struct SYMNAME *symname_list );

/* allocate memory and check */
char *check_malloc ( unsigned size );

/* reallocate memory and check */
char *check_realloc ( char *ptr, unsigned size );

/* callocate memory and check */
char *check_calloc ( unsigned nelem, unsigned elsize );

/* allocate and initialize struct RCSFILE */
struct RCSFILE *new_rcsfile ( void );

/* allocate and initialize struct RCSREV */
struct RCSREV *new_rcsrev ( void );

/* allocate and initialize struct SYMNAME */
struct SYMNAME *new_symname ( void );

/* free memory allocated for a struct RCSFILE */
void free_rcsfile ( struct RCSFILE *rp );

/* free memory allocated for a chain of struct RCSREV */
void free_rev_chain ( struct RCSREV *rp );

/* free memory allocated for a struct RCSREV */
void free_rcsrev ( struct RCSREV *rp );

/* free memory allocated for a chain of struct SYMNAME */
void free_symnames ( struct SYMNAME *sp );

/* duplicate string with check */
char *check_strdup ( char *s );

/* like strdup, but only n characters
 * the resulting string is null padded, freeable
 */
char *strndup ( char *s, int n );

/* return a string concatenated from s1, s2, and s3.
 * The returned string is freeable.
 * Each argument may be NULL. If all are NULL, NULL is returned.
 */
char *addstr3 ( char *s1, char *s2, char *s3 );

/* return a string concatenated from s1 and s2.
 * The returned string is freeable.
 * Each argument may be NULL, if both, NULL is returned.
 */
char *addstr ( char *s1, char *s2 );

/* safe strncpy with null padding but no return value */
void strncpy0 ( char *s1, char *s2, int n );

/* safe strncat with null padding but no return value */
void strncat0 ( char *s1, char *s2, int n );

/* print fatal error message and exit */
void fatal ( char *message, char *message2 );

/* print error message */
void error ( char *message, char *message2 );

/* print warning message */
void warning ( char *message, char *message2 );

/* check for existence of an AtFS history for file fname */
bool atfs_exists ( char *fname );

/* strip last component of pathname.
 * if pathname is NULL or doesn't contain a slash, NULL is returned.
 * returned string may be free()d later
 */
char *strip_last ( char *pathname );

/* and now the opposite: return the last component of pathname.
 * returned string is free(3)able.
 */
char *basename ( char *pathname );

/* return type of file: directory, normal file, RCS file,
 * RCS directory, error (not stat()able)
 */
filetype_t file_type ( char *fname );

/* quote \, " and $ in text for use in the shell script quoted with " */
char *sh_quote ( char *text );

/*EOF*/
void echo_version ( void );

#else /* __STDC__ */

/*
 * initializes reading files from the specified directory. f_state keeps
 * the status information needed by afind_read() and afind_close().
 */
int afind_init (/* char *dir, struct AFIND_STATE *f_state */);

/*
 * returns a filename from the directory with which f_state was initialized.
 * the returned string is freeable. If all names have been read, NULL is
 * returned
 */
char *afind_read (/* struct AFIND_STATE *f_state */);

/*
 * completes reading files with afind, frees memory
 */
void afind_close (/* struct AFIND_STATE *f_state */);

/*ARGSUSED*/
int read_out_name (/* char *o, char *arg */);

void usage (/* void */);

/* main function (this should be obvious) */
int main (/* int argc, char **argv */);

/* convert fname, if recursive, maybe directory */
void convert (/* char *fname, FILE *out */);

/* convert a directory named RCS */
void convert_rcsdir (/* char *rdir, FILE *out */);

/* comment leader string */
void convert_revision (/* FILE *out, char *wkfile, bool branches, struct RCSREV *rev, bool initial, char *comment_leader */);

/* build shell script for converting the archive */
void make_shell_script (/* char *directory, struct RCSFILE *rcsfile, FILE *out */);

/* read rlogin output into a struct RCSFILE */
struct RCSFILE *readin_rcsfile (/* char *fname */);

/* The name of the following two functions should have been
 * "compare_revisions_by_number" and "compare_revisions_by_date", but
 * I guess there still some compilers that treat only the first some
 * (10? 8? 6?) characters of an identifier as significant. (WHY?!) 
 * These two are needed for qsort()ing an array of revision pointers.
 */
int number_compare_revisions (/* struct RCSREV **r1, struct RCSREV **r2 */);

int date_compare_revisions (/* struct RCSREV **r1, struct RCSREV **r2 */);

/* sort revisions by revision number, if branches exist by date */
void sort_revisions (/* struct RCSFILE *rcsfile */);

/* check if all needed fields in rcsfile are present */
short check_rcsfile (/* struct RCSFILE *rcsfile */);

/* apply symbolic names to apropriate revisions */
void apply_symnames (/* struct RCSFILE *rcsfile, struct SYMNAME *symname_list */);

/* allocate memory and check */
char *check_malloc (/* unsigned size */);

/* reallocate memory and check */
char *check_realloc (/* char *ptr, unsigned size */);

/* callocate memory and check */
char *check_calloc (/* unsigned nelem, unsigned elsize */);

/* allocate and initialize struct RCSFILE */
struct RCSFILE *new_rcsfile (/* void */);

/* allocate and initialize struct RCSREV */
struct RCSREV *new_rcsrev (/* void */);

/* allocate and initialize struct SYMNAME */
struct SYMNAME *new_symname (/* void */);

/* free memory allocated for a struct RCSFILE */
void free_rcsfile (/* struct RCSFILE *rp */);

/* free memory allocated for a chain of struct RCSREV */
void free_rev_chain (/* struct RCSREV *rp */);

/* free memory allocated for a struct RCSREV */
void free_rcsrev (/* struct RCSREV *rp */);

/* free memory allocated for a chain of struct SYMNAME */
void free_symnames (/* struct SYMNAME *sp */);

/* duplicate string with check */
char *check_strdup (/* char *s */);

/* like strdup, but only n characters
 * the resulting string is null padded, freeable
 */
char *strndup (/* char *s, int n */);

/* return a string concatenated from s1, s2, and s3.
 * The returned string is freeable.
 * Each argument may be NULL. If all are NULL, NULL is returned.
 */
char *addstr3 (/* char *s1, char *s2, char *s3 */);

/* return a string concatenated from s1 and s2.
 * The returned string is freeable.
 * Each argument may be NULL, if both, NULL is returned.
 */
char *addstr (/* char *s1, char *s2 */);

/* safe strncpy with null padding but no return value */
void strncpy0 (/* char *s1, char *s2, int n */);

/* safe strncat with null padding but no return value */
void strncat0 (/* char *s1, char *s2, int n */);

/* print fatal error message and exit */
void fatal (/* char *message, char *message2 */);

/* print error message */
void error (/* char *message, char *message2 */);

/* print warning message */
void warning (/* char *message, char *message2 */);

/* check for existence of an AtFS history for file fname */
bool atfs_exists (/* char *fname */);

/* strip last component of pathname.
 * if pathname is NULL or doesn't contain a slash, NULL is returned.
 * returned string may be free()d later
 */
char *strip_last (/* char *pathname */);

/* and now the opposite: return the last component of pathname.
 * returned string is free(3)able.
 */
char *basename (/* char *pathname */);

/* return type of file: directory, normal file, RCS file,
 * RCS directory, error (not stat()able)
 */
filetype_t file_type (/* char *fname */);

/* quote \, " and $ in text for use in the shell script quoted with " */
char *sh_quote (/* char *text */);

/*EOF*/
void echo_version (/* void */);

#endif /* __STDC__ */
#endif /* __CEXTRACT__ */
