osprey/libcif/cif_lines.c File Reference

#include <cif.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "cif_int.h"
#include "unitrecord.h"

Include dependency graph for cif_lines.c:

Go to the source code of this file.

Data Types

type  unit_list
type  record
type  mod_struct

Defines

#define const
#define CIF_VERSION   3
#define CIF_NOT   0
#define CIF_ASCII   1
#define CIF_BINARY   2
#define MODID_BUMP   10

Functions/Subroutines

static void save_record (struct record *, struct Cif_generic *, int, long)
static void print_records (struct record *, struct record *)
static void print_header_records (struct record *)
static int get_id (struct Cif_generic *)
static int get_line (struct Cif_generic *)
static int get_cpos (struct Cif_generic *)
static int get_fid (struct Cif_generic *)
static int get_scope (struct Cif_generic *)
static int get_type (struct Cif_generic *)
static int get_adjusted_scope (struct Cif_generic *)
int Cif_CifStatus ()
static int later_date (char *file_1, char *file_2)
static int cif_next_entry (int cifd, long *cifpos, struct Cif_generic **cif_record)
char * Cif_Filename (int cifd)
static int lines_type (char *cif_name)
static char * cif_concat (char *str1, char *str2)
char * cif_basename (char *name)
static char * cif_dirname (char *name)
int cif_VerifyCanWrite (char *file)
static char * Cif_Make_Lines (char *infile, char *outfile)
static char * cif_convert_to_lines (char *filename, int keep, int *tmp_cif)
int Cif_Lines (char *filename, char *optype, int *rtypes, int version, int keep)
int Cif_Lines_V2_1 (char *filename, char *optype, int *rtypes, int version, int keep, int sub_version)
int Cif_Lines_V3_1 (char *filename, char *optype, int *rtypes, int version, int keep, int sub_version)
static int comp_id (struct Cif_generic **r1, struct Cif_generic **r2)
static int comp_scope (struct Cif_generic **r1, struct Cif_generic **r2)
static int comp_rtype (struct Cif_generic **r1, struct Cif_generic **r2)
static void print_include_records (struct record *w, struct record *n, int start, int current, int *pscope_index)

Variables

static struct record ul
static struct record wl
static struct record nl
static struct mod_structmodids = (struct mod_struct *) NULL
static int modid_max = 0
static int modid_current = 0
static int outfd
static char * outfile = "-"
static int global_srcfid = 0
static int global_last_scope = -1
static int global_scope_found = 0
static int global_cif_status = 0
static int last_inc = 0


Define Documentation

#define CIF_ASCII   1

Definition at line 161 of file cif_lines.c.

#define CIF_BINARY   2

Definition at line 162 of file cif_lines.c.

#define CIF_NOT   0

Definition at line 160 of file cif_lines.c.

#define CIF_VERSION   3

Definition at line 142 of file cif_lines.c.

#define const

Definition at line 139 of file cif_lines.c.

#define MODID_BUMP   10

Definition at line 193 of file cif_lines.c.

Referenced by Cif_Make_Lines().


Function Documentation

char* cif_basename ( char *  name  ) 

Definition at line 395 of file cif_lines.c.

References NULL, and strrchr().

Referenced by cif_convert_to_cifconv(), and cif_convert_to_lines().

int Cif_CifStatus (  ) 

Definition at line 237 of file cif_lines.c.

References global_cif_status.

static char* cif_concat ( char *  str1,
char *  str2 
) [static]

Definition at line 364 of file cif_lines.c.

References exit(), fprintf(), malloc, NULL, sprintf(), strlen(), and void.

Referenced by cif_VerifyCanWrite().

static char* cif_convert_to_lines ( char *  filename,
int  keep,
int *  tmp_cif 
) [static]

static char* cif_dirname ( char *  name  )  [static]

Definition at line 417 of file cif_lines.c.

References char, exit(), fprintf(), i, malloc, strdup, strlen(), strncpy(), and void.

Referenced by cif_VerifyCanWrite().

char* Cif_Filename ( int  cifd  ) 

Definition at line 306 of file cif_lines.c.

References _Cif_filetbl, CIF_FT_SIZE, filename, NOT_A_CIF, and NULL.

int Cif_Lines ( char *  filename,
char *  optype,
int *  rtypes,
int  version,
int  keep 
)

int Cif_Lines_V2_1 ( char *  filename,
char *  optype,
int *  rtypes,
int  version,
int  keep,
int  sub_version 
)

Definition at line 918 of file cif_lines.c.

References _cif_version, Cif_Lines(), and CIF_SUB_VERSION_2.

int Cif_Lines_V3_1 ( char *  filename,
char *  optype,
int *  rtypes,
int  version,
int  keep,
int  sub_version 
)

Definition at line 944 of file cif_lines.c.

References _cif_version, Cif_Lines(), and CIF_SUB_VERSION_3.

static char* Cif_Make_Lines ( char *  infile,
char *  outfile 
) [static]

static int cif_next_entry ( int  cifd,
long cifpos,
struct Cif_generic **  cif_record 
) [static]

Definition at line 270 of file cif_lines.c.

References Cif_Errstring(), Cif_Getpos(), Cif_Getrecord(), Cif_Setpos(), fprintf(), and void.

int cif_VerifyCanWrite ( char *  file  ) 

static int comp_id ( struct Cif_generic **  r1,
struct Cif_generic **  r2 
) [static]

Definition at line 998 of file cif_lines.c.

References get_cpos(), get_fid(), get_line(), get_scope(), and ret.

Referenced by print_records().

static int comp_rtype ( struct Cif_generic **  r1,
struct Cif_generic **  r2 
) [static]

Definition at line 1052 of file cif_lines.c.

References CIF_FILE, CIF_SRCFILE, and CIFFILE.

Referenced by print_header_records().

static int comp_scope ( struct Cif_generic **  r1,
struct Cif_generic **  r2 
) [static]

Definition at line 1035 of file cif_lines.c.

References get_adjusted_scope(), get_id(), get_type(), and ret.

Referenced by print_records().

static int get_adjusted_scope ( struct Cif_generic rptr  )  [static]

Definition at line 2079 of file cif_lines.c.

References CIF_C_ENTRY, CIFCENTRY, global_last_scope, global_scope_found, and Cif_generic::rectype.

Referenced by comp_scope().

static int get_cpos ( struct Cif_generic rptr  )  [static]

static int get_fid ( struct Cif_generic rptr  )  [static]

static int get_id ( struct Cif_generic rptr  )  [static]

static int get_line ( struct Cif_generic rptr  )  [static]

static int get_scope ( struct Cif_generic rptr  )  [static]

static int get_type ( struct Cif_generic rptr  )  [static]

static int later_date ( char *  file_1,
char *  file_2 
) [static]

Definition at line 249 of file cif_lines.c.

References stat::st_mtime, stat, and void.

static int lines_type ( char *  cif_name  )  [static]

static void print_header_records ( struct record l  )  [static]

static void print_include_records ( struct record w,
struct record n,
int  start,
int  current,
int *  pscope_index 
) [static]

static void print_records ( struct record w,
struct record n 
) [static]

static void save_record ( struct record l,
struct Cif_generic cif_record,
int  recno,
long  filepos 
) [static]


Variable Documentation

int global_cif_status = 0 [static]

Definition at line 233 of file cif_lines.c.

Referenced by Cif_CifStatus(), and Cif_Make_Lines().

int global_last_scope = -1 [static]

Definition at line 215 of file cif_lines.c.

Referenced by Cif_Make_Lines(), get_adjusted_scope(), and get_scope().

int global_scope_found = 0 [static]

int global_srcfid = 0 [static]

Definition at line 213 of file cif_lines.c.

Referenced by Cif_Lines(), lines_type(), and print_records().

int last_inc = 0 [static]

Definition at line 1092 of file cif_lines.c.

int modid_current = 0 [static]

Definition at line 192 of file cif_lines.c.

Referenced by Cif_Make_Lines(), print_include_records(), and print_records().

int modid_max = 0 [static]

Definition at line 191 of file cif_lines.c.

Referenced by Cif_Make_Lines().

struct mod_struct* modids = (struct mod_struct *) NULL [static]

Definition at line 190 of file cif_lines.c.

struct record nl [static]

int outfd [static]

Definition at line 210 of file cif_lines.c.

char* outfile = "-" [static]

Definition at line 211 of file cif_lines.c.

struct record ul [static]

Definition at line 176 of file cif_lines.c.

struct record wl [static]


Generated on Wed Apr 8 15:51:08 2009 for Open64 by  doxygen 1.5.6