abi_audit.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _ABI_AUDIT_H
#define _ABI_AUDIT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* include headers
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <dirent.h>
#include <libgen.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
/*
* global variable declarations
*/
#define TRUE 1
#define FALSE 0
#define SUCCEED 0
#define FAIL -1
#define CAT_PRIVATE "private"
#define CAT_SUNWABI "sunwabi_"
#define CAT_LOCAL "_local_"
#define CAT_EVOLVING "sunwevolving"
#define CAT_OBSOLETE "sunwobsolete"
/*
* RELMAX is set to be the max. number of releases captured at a single
* node on a linked list of bitvectors
*/
/*
* On a 32-bit machine, the ull_t is 64 bits long, and on a 64-bit machine
* ull_t is 128 bits long.
*/
typedef struct bvlist_tag {
struct bvlist_tag *bt_next;
} bvlist_t;
/*
* struct of a simple linked list of library names to be checked
*/
typedef struct list_tag {
char *lt_name;
} list_t;
/*
* data structures to capture symbol information
*/
typedef struct release_tag {
char *rt_rel_name; /* release or build name */
} release_t;
typedef struct rellist_tag {
struct rellist_tag *rt_next;
} rellist_t;
/*
* The categories are chosen as the ull_t type. Each bit in an ull_t will
* correlate with a release.
* - a "0" bit indicates the symbol did not exist
* - a "1" bit indicates the Symbol exists and belongs to the
* corresponding category
*/
typedef struct category_tag {
} category_t;
typedef struct version_tag {
char *vt_lib_ver; /* highest version of pvs -d */
char *vt_sym_ver; /* base version of pvs -dovs */
} version_t;
typedef struct verlist_tag {
struct verlist_tag *vlt_next;
} verlist_t;
typedef enum {
SCENARIO_01, /* new public symbol introduced */
SCENARIO_02, /* public symbol in all builds */
SCENARIO_03, /* previous public symbol becomes private */
SCENARIO_04, /* previous public symbol is now unexported */
SCENARIO_05, /* new private symbol introduced */
SCENARIO_06, /* previous private symbol becomes public */
SCENARIO_07, /* private symbol in all builds */
SCENARIO_08, /* previous private symbol is now unexported */
SCENARIO_09, /* previously unexported symbol is now public */
SCENARIO_10, /* previously unexported symbol is now private */
SCENARIO_11, /* previously unexported symbol stays as it was */
SCENARIO_12, /* >1 mixed sequences of public & private symbol */
SCENARIO_13, /* >1 mixed sequences of public & unexported symbol */
SCENARIO_14, /* >1 mixed sequences of private & unexported symbol */
SCENARIO_15, /* =2 mixed public, private & unexported symbol */
SCENARIO_16, /* =2 mixed public, private & unexported symbol */
SCENARIO_17, /* =2 mixed public, private & unexported symbol */
SCENARIO_18, /* >2 mixed public, private & unexported symbol */
SCENARIO_19 /* >2 mixed public, private & unexported symbol */
} scenario_t;
typedef struct lib_tag {
char *lt_lib_name; /* with location */
int lt_check_me; /* = 1: check me */
int lt_libc_migrate; /* is a libc_migrate or not */
} liblist_t;
typedef struct sym_tag {
char *st_sym_name; /* symbol name */
int st_size; /* size of object */
} symbol_t;
typedef enum {
} class_t;
typedef struct sequence {
} sequence_t;
/*
* data structure for AVL tree
*/
typedef struct tree_tag {
} tree_t;
/* declaration of global variables */
extern char *program; /* program name for error messages */
extern int Debug; /* flag for debugging use */
extern int Total_relcnt; /* # of releases read in */
extern int iflag; /* version checking */
/* abi_audit.c functions */
int count_num_char(const char, char *);
/* util.c functions */
char *trimmer(char *);
int check_lib_info(list_t *, char *);
void build_sym_tag(char *, symbol_t *);
void sequence_list_destroy(sequence_t *);
void tree_traverse(tree_t *);
/* bvlist data abstraction */
bvlist_t *create_bv_list(int);
int bv_all_zero(bvlist_t *);
void free_bv_list(bvlist_t *);
/* verlist data abstraction */
char *get_lib_ver(liblist_t *, int);
char *get_sym_ver(liblist_t *, int);
int add_verlist(liblist_t *, int);
void assign_lib_ver(liblist_t *, char *, int);
void assign_sym_ver(liblist_t *, char *, int);
/* rellist data abstraction */
bvlist_t *get_rel_bitmask(int);
char *get_rel_name(int);
int add_rellist(int);
int find_num_nodes(int);
void assign_rel_name(char *, int);
/* verschk.c functions */
int find_exported_release(liblist_t *, int);
void version_checker(tree_t *);
#ifdef __cplusplus
}
#endif
#endif /* _ABI_AUDIT_H */