Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#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"
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_struct * | modids = (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 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().
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().
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().
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().
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 | ||
) |
Definition at line 845 of file cif_lines.c.
References _Cif_filetbl, _cif_version, cif_convert_to_lines(), cif_name, CIF_NOTCIF, Cif_Open_V2(), Cif_Open_V3_1(), CIF_SUB_VERSION_3, free(), global_scope_found, global_srcfid, NULL, ret, and _Cif_File_Tbl::tmp_cif.
Referenced by Cif_Lines_V2_1(), and Cif_Lines_V3_1().
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.
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.
static char* Cif_Make_Lines | ( | char * | infile, |
char * | outfile | ||
) | [static] |
Definition at line 522 of file cif_lines.c.
References Cif_Close(), CIF_ENDUNIT, CIF_EOF, Cif_Errstring(), Cif_Getpos(), Cif_Getrecord(), CIF_INCLUDE, CIF_MAXRECORD, CIF_MEM_FREE, CIF_MEM_KEEP, CIF_MEM_MANAGED, Cif_Memmode(), Cif_Open(), Cif_Release(), CIF_SUMMARY, CIF_UNIT, CIF_USAGE, CIF_VERSION, CIFSUM, CIFUSAGE, mod_struct::direct, fprintf(), get_scope(), global_cif_status, global_last_scope, has_line, mod_struct::modid, MODID_BUMP, modid_current, modid_max, nl, NULL, outfd, print_header_records(), print_records(), save_record(), record::ul, ul, record::ulcur, record::ulmax, unit_record, and wl.
Referenced by cif_convert_to_lines().
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().
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().
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().
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().
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_cpos | ( | struct Cif_generic * | rptr | ) | [static] |
Definition at line 2157 of file cif_lines.c.
References CIF_CALLSITE, CIF_ENDUNIT, CIF_INCLUDE, CIF_MESSAGE, CIF_ND_MSG, CIF_STMT_TYPE, CIF_UNIT, CIF_USAGE, CIFCS, CIFENDU, CIFINC, CIFMSG, CIFNMSG, CIFSTMT, CIFUNIT, CIFUSAGE, global_scope_found, and Cif_generic::rectype.
Referenced by comp_id().
static int get_fid | ( | struct Cif_generic * | rptr | ) | [static] |
Definition at line 1777 of file cif_lines.c.
References CIF_C_CONST, CIF_C_ENTRY, CIF_C_MESSAGE, CIF_C_OBJECT, CIF_C_TAG, CIF_CALLSITE, CIF_COMBLK, CIF_CONST, CIF_ENDUNIT, CIF_ENTRY, CIF_INCLUDE, CIF_LABEL, CIF_LOOP, CIF_MESSAGE, CIF_NAMELIST, CIF_ND_MSG, CIF_OBJECT, CIF_STMT_TYPE, CIF_UNIT, CIF_USAGE, CIFCMSG, CIFCS, CIFENDU, CIFINC, CIFLOOP, CIFMSG, CIFNMSG, CIFSTMT, CIFUNIT, CIFUSAGE, global_scope_found, and Cif_generic::rectype.
Referenced by comp_id(), print_include_records(), and print_records().
static int get_id | ( | struct Cif_generic * | rptr | ) | [static] |
Definition at line 1450 of file cif_lines.c.
References CIF_C_CONST, CIF_C_ENTRY, CIF_C_OBJECT, CIF_C_TAG, CIF_CALLSITE, CIF_COMBLK, CIF_CONST, CIF_ENTRY, CIF_LABEL, CIF_NAMELIST, CIF_OBJECT, CIF_USAGE, CIFCB, CIFCCON, CIFCENTRY, CIFCOBJ, CIFCON, CIFCS, CIFCTAG, CIFENTRY, CIFLABEL, CIFNL, CIFOBJ, CIFUSAGE, global_scope_found, and Cif_generic::rectype.
Referenced by comp_scope().
static int get_line | ( | struct Cif_generic * | rptr | ) | [static] |
Definition at line 1577 of file cif_lines.c.
References CIF_C_CONST, CIF_C_ENTRY, CIF_C_MESSAGE, CIF_C_OBJECT, CIF_C_TAG, CIF_CALLSITE, CIF_COMBLK, CIF_CONST, CIF_ENDUNIT, CIF_ENTRY, CIF_INCLUDE, CIF_LABEL, CIF_LOOP, CIF_MESSAGE, CIF_NAMELIST, CIF_ND_MSG, CIF_OBJECT, CIF_STMT_TYPE, CIF_UNIT, CIF_USAGE, CIFCMSG, CIFCS, CIFENDU, CIFINC, CIFLOOP, CIFMSG, CIFNMSG, CIFSTMT, CIFUNIT, CIFUSAGE, global_scope_found, and Cif_generic::rectype.
Referenced by comp_id().
static int get_scope | ( | struct Cif_generic * | rptr | ) | [static] |
Definition at line 1980 of file cif_lines.c.
References CIF_C_ENTRY, CIFCENTRY, global_last_scope, global_scope_found, and Cif_generic::rectype.
Referenced by Cif_Make_Lines(), comp_id(), print_include_records(), and print_records().
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().
Referenced by _f_opn(), _initialize_e_fortran_io(), _lwrite_setup(), _wf_setup(), ar_clear_sim_state(), catmsgfmt(), cif_convert_to_cifconv(), cif_convert_to_lines(), create_temp_file(), DaVinci::DaVinci(), dV_view_whirl(), DaVinci::enabled(), f77_map_datapool_(), f77_map_datapool_pad_(), get_machine_chars(), init_msg_processing(), init_release_level(), main(), MEM_Initialize(), open_arith_file(), open_intrinsics_file(), print_buffered_messages(), RiceWhirl2f(), s_abort(), and WN_verifier().
int getopt | ( | ) |
static int later_date | ( | char * | file_1, |
char * | file_2 | ||
) | [static] |
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().
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().
static void print_include_records | ( | struct record * | w, |
struct record * | n, | ||
int | start, | ||
int | current, | ||
int * | pscope_index | ||
) | [static] |
Definition at line 1098 of file cif_lines.c.
References Cif_Errstring(), CIF_INCLUDE, Cif_Putrecord(), CIFGEN, CIFINC, mod_struct::direct, exit(), fprintf(), get_fid(), get_scope(), global_scope_found, last_inc, modid_current, NULL, outfd, ret, unit_list::rptr, record::ul, and record::ulcur.
Referenced by print_records().
static void print_records | ( | struct record * | w, |
struct record * | n | ||
) | [static] |
Definition at line 1230 of file cif_lines.c.
References Cif_Errstring(), CIF_INCLUDE, Cif_Putrecord(), CIF_UNIT, CIF_USAGE, CIFGEN, CIFUSAGE, comp_id(), comp_scope(), mod_struct::direct, exit(), fprintf(), get_fid(), get_scope(), global_scope_found, global_srcfid, modid_current, outfd, print_include_records(), ret, unit_list::rptr, record::ul, and record::ulcur.
Referenced by Cif_Make_Lines().
static void save_record | ( | struct record * | l, |
struct Cif_generic * | cif_record, | ||
int | recno, | ||
long | filepos | ||
) | [static] |
Definition at line 971 of file cif_lines.c.
References unit_list::filepos, NULL, unit_list::recno, unit_list::rptr, record::ul, record::ulcur, and record::ulmax.
Referenced by Cif_Make_Lines().
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_scope_found = 0 [static] |
Definition at line 227 of file cif_lines.c.
Referenced by Cif_Lines(), get_adjusted_scope(), get_cpos(), get_fid(), get_id(), get_line(), get_scope(), print_include_records(), and print_records().
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.
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] |
Definition at line 214 of file cif_lines.c.
Referenced by Cif_Make_Lines(), print_header_records(), print_include_records(), and print_records().
char* outfile = "-" [static] |
Definition at line 215 of file cif_lines.c.
Referenced by main(), W2C_Translate_Global_Defs(), and W2C_Translate_Global_Types().
Definition at line 180 of file cif_lines.c.
Referenced by Cif_Make_Lines().
Definition at line 181 of file cif_lines.c.
Referenced by Cif_Make_Lines(), and fei_where().