Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
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.

Classes

struct  unit_list
struct  record
struct  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

int getopt ()
char * getenv (const char *)
char * strdup (const char *s)
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 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

int optind
char * optarg
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 165 of file cif_lines.c.

#define CIF_BINARY   2

Definition at line 166 of file cif_lines.c.

#define CIF_NOT   0

Definition at line 164 of file cif_lines.c.

#define CIF_VERSION   3

Definition at line 138 of file cif_lines.c.

Referenced by Cif_Make_Lines(), and lines_type().

#define const

Definition at line 135 of file cif_lines.c.

#define MODID_BUMP   10

Definition at line 197 of file cif_lines.c.

Referenced by Cif_Make_Lines().


Function Documentation

char* cif_basename ( char *  name)

Definition at line 399 of file cif_lines.c.

References NULL.

Referenced by cif_convert_to_cifconv(), and cif_convert_to_lines().

int Cif_CifStatus ( )

Definition at line 241 of file cif_lines.c.

References global_cif_status.

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

Definition at line 368 of file cif_lines.c.

References exit(), fprintf(), and NULL.

Referenced by cif_VerifyCanWrite().

Here is the call graph for this function:

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

Definition at line 709 of file cif_lines.c.

References access, cif_basename(), Cif_Make_Lines(), cif_VerifyCanWrite(), free(), getenv(), later_date(), lines_type(), mktemp, NULL, and strdup.

Referenced by Cif_Lines().

Here is the call graph for this function:

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

Definition at line 421 of file cif_lines.c.

References exit(), fprintf(), and strdup.

Referenced by cif_VerifyCanWrite().

Here is the call graph for this function:

char* Cif_Filename ( int  cifd)

Definition at line 310 of file cif_lines.c.

References _Cif_filetbl, CIF_FT_SIZE, 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 922 of file cif_lines.c.

References _cif_version, Cif_Lines(), and CIF_SUB_VERSION_2.

Here is the call graph for this function:

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

Definition at line 948 of file cif_lines.c.

References _cif_version, Cif_Lines(), and CIF_SUB_VERSION_3.

Here is the call graph for this function:

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

Definition at line 274 of file cif_lines.c.

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

Referenced by lines_type().

Here is the call graph for this function:

int cif_VerifyCanWrite ( char *  file)

Definition at line 453 of file cif_lines.c.

References access, cif_concat(), cif_dirname(), fd, free(), NULL, stat, and unlink.

Referenced by cif_convert_to_cifconv(), and cif_convert_to_lines().

Here is the call graph for this function:

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

Definition at line 1002 of file cif_lines.c.

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

Referenced by print_records().

Here is the call graph for this function:

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

Definition at line 1056 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 1039 of file cif_lines.c.

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

Referenced by print_records().

Here is the call graph for this function:

static int get_adjusted_scope ( struct Cif_generic rptr) [static]

Definition at line 2083 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_scope ( struct Cif_generic rptr) [static]
static int get_type ( struct Cif_generic rptr) [static]

Definition at line 2053 of file cif_lines.c.

References CIF_ENTRY, and Cif_generic::rectype.

Referenced by comp_scope().

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

Definition at line 253 of file cif_lines.c.

References stat.

Referenced by cif_convert_to_lines().

static int lines_type ( char *  cif_name) [static]

Definition at line 336 of file cif_lines.c.

References CIF_CIFHDR, Cif_Close(), CIF_FIRST_RECORD, CIF_FORM_LINES, CIF_FORM_SORTED, CIF_MEM_FREE, cif_next_entry(), Cif_Open(), CIF_VERSION, CIFHDR, global_srcfid, and NULL.

Referenced by cif_convert_to_lines().

Here is the call graph for this function:

static void print_header_records ( struct record l) [static]

Definition at line 1421 of file cif_lines.c.

References CIF_CIFHDR, Cif_Errstring(), CIF_FORM_LINES, Cif_Putrecord(), CIFHDR, comp_rtype(), exit(), fprintf(), outfd, Cif_generic::rectype, ret, unit_list::rptr, record::ul, and record::ulcur.

Referenced by Cif_Make_Lines().

Here is the call graph for this function:

static void print_include_records ( struct record w,
struct record n,
int  start,
int  current,
int *  pscope_index 
) [static]
static void save_record ( struct record l,
struct Cif_generic cif_record,
int  recno,
long  filepos 
) [static]
char* strdup ( const char *  s)

Variable Documentation

int global_cif_status = 0 [static]

Definition at line 237 of file cif_lines.c.

Referenced by Cif_CifStatus(), and Cif_Make_Lines().

int global_last_scope = -1 [static]

Definition at line 219 of file cif_lines.c.

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

int global_srcfid = 0 [static]

Definition at line 217 of file cif_lines.c.

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

int last_inc = 0 [static]

Definition at line 1096 of file cif_lines.c.

Referenced by print_include_records().

int modid_current = 0 [static]

Definition at line 196 of file cif_lines.c.

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

int modid_max = 0 [static]

Definition at line 195 of file cif_lines.c.

Referenced by Cif_Make_Lines().

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

Definition at line 194 of file cif_lines.c.

struct record nl [static]

Definition at line 182 of file cif_lines.c.

Referenced by Cif_Make_Lines(), Process_Control_Opt(), RNL(), and store_ctrl().

char* optarg
int optind
int outfd [static]
char* outfile = "-" [static]

Definition at line 215 of file cif_lines.c.

Referenced by main(), W2C_Translate_Global_Defs(), and W2C_Translate_Global_Types().

struct record ul [static]

Definition at line 180 of file cif_lines.c.

Referenced by Cif_Make_Lines().

struct record wl [static]

Definition at line 181 of file cif_lines.c.

Referenced by Cif_Make_Lines(), and fei_where().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines