# tools/javadeps.c File Reference

`#include "system.h"`
`#include <stdarg.h>`
`#include "debug.h"`

Go to the source code of this file.

## Data Structures

struct | symbolTable_t

## Defines

#define | MAX_PRINT_TABLE 10000
#define | mod4(num) ( (num) & 3 )

## Functions

void | usage (void)
void | outofmemory (void)
void | die (char *format,...)
size_t | my_fread (void *ptr, size_t size, size_t nitems, FILE *stream)
void | check_range (short entryNum, short value, short poolSize)
char * | is_lower_equal (char *string, char *pattern)
int | findJavaMagic (FILE *fileHandle)
int | my_strcmp (const void *a, const void *b)
void | print_table_flush (void)
void | print_table_add (char *str)
char * | formatClassName (char *pSomeString, char terminator, char print_star)
void | dumpRefType (char *pSomeString)
void | genSymbolTable (FILE *fileHandle, symbolTable_t *symbolTable)
void | freeSymbolTable (symbolTable_t *symbolTable)
char * | findClassName (FILE *fileHandle, symbolTable_t *symbolTable)
void | dumpProvides (char *className)
void | dumpRequires (symbolTable_t *symbolTable)
void | processJavaFile (FILE *fileHandle)
static void | print_list (char *in_string)
int | main (int argc, char **argv)

## Variables

char * | PROGRAM_NAME = 0
char * | FILE_NAME = 0
char * | CLASS_NAME = 0
char * | OUTPUT_PREFIX = 0
int | ARG_PROVIDES = 0
int | ARG_REQUIRES = 0
int | ARG_RPMFORMAT = 0
int | ARG_DEPSFORMAT = 0
int | ARG_KEYWORDS = 0
int | ARG_STARPROV = 0
char * | KEYWORD_VERSION = 0
char * | KEYWORD_REVISION = 0
char * | KEYWORD_EPOCH = 0
char * | PRINT_TABLE [10000]
int | SIZE_PRINT_TABLE

## Define Documentation

#define MAX_PRINT_TABLE 10000

Definition at line 134 of file javadeps.c.

Referenced by print_table_add().

#define mod4 | ( | num |  | ) | ( (num) & 3 )

Definition at line 418 of file javadeps.c.

Referenced by findJavaMagic().

## Function Documentation

void check_range | ( | short | entryNum,
|  | short | value,
|  | short | poolSize |
| ) |  |  |

Definition at line 371 of file javadeps.c.

References die().

Referenced by genSymbolTable().

void die | ( | char * | format,
|  |  | ... |
| ) |  |  |

Definition at line 295 of file javadeps.c.

References CLASS_NAME, FILE_NAME, outofmemory(), and PROGRAM_NAME.

Referenced by check_range(), dumpRequires(), findClassName(), findJavaMagic(), formatClassName(), genSymbolTable(), main(), and my_fread().

void dumpProvides | ( | char * | className | ) |

Definition at line 1033 of file javadeps.c.

References ARG_STARPROV, formatClassName(), KEYWORD_EPOCH, KEYWORD_REVISION, KEYWORD_VERSION, outofmemory(), and print_table_add().

Referenced by processJavaFile().

void dumpRefType | ( | char * | pSomeString | ) |

Definition at line 723 of file javadeps.c.

References formatClassName(), and print_table_add().

Referenced by dumpRequires().

void dumpRequires | ( | symbolTable_t * | symbolTable | ) |

Definition at line 744 of file javadeps.c.

References symbolTable_t::classRef, die(), dumpRefType(), formatClassName(), symbolTable_t::poolSize, print_table_add(), and symbolTable_t::stringList.

Referenced by processJavaFile().

char * findClassName | ( | FILE * | fileHandle,
|  | symbolTable_t * | symbolTable |
| ) |  |  |

Definition at line 993 of file javadeps.c.

References die(), my_fread(), and symbolTable_t::stringList.

Referenced by processJavaFile().

int findJavaMagic | ( | FILE * | fileHandle | ) |

Definition at line 421 of file javadeps.c.

References die(), and mod4.

Referenced by main().

char * formatClassName | ( | char * | pSomeString,
|  | char | terminator,
|  | char | print_star |
| ) |  |  |

Definition at line 631 of file javadeps.c.

References ARG_RPMFORMAT, die(), and outofmemory().

Referenced by dumpProvides(), dumpRefType(), dumpRequires(), and processJavaFile().

void freeSymbolTable | ( | symbolTable_t * | symbolTable | ) |

Definition at line 1123 of file javadeps.c.

References symbolTable_t::poolSize, and symbolTable_t::stringList.

Referenced by processJavaFile().

void genSymbolTable | ( | FILE * | fileHandle,
|  | symbolTable_t * | symbolTable |
| ) |  |  |

Definition at line 803 of file javadeps.c.

References ARG_KEYWORDS, ARG_PROVIDES, ARG_REQUIRES, check_range(), symbolTable_t::classRef, die(), is_lower_equal(), KEYWORD_EPOCH, KEYWORD_REVISION, KEYWORD_VERSION, my_fread(), outofmemory(), symbolTable_t::poolSize, print_list(), symbolTable_t::stringList, and symbolTable_t::typeRef.

Referenced by processJavaFile().

char * is_lower_equal | ( | char * | string,
|  | char * | pattern |
| ) |  |  |

Definition at line 392 of file javadeps.c.

Referenced by genSymbolTable().

int main | ( | int | argc,
|  | char ** | argv |
| ) |  |  |

Definition at line 1190 of file javadeps.c.

References ARG_DEPSFORMAT, ARG_KEYWORDS, ARG_PROVIDES, ARG_REQUIRES, ARG_RPMFORMAT, ARG_STARPROV, CLASS_NAME, die(), FILE_NAME, findJavaMagic(), print_table_flush(), processJavaFile(), PROGRAM_NAME, and usage().

size_t my_fread | ( | void * | ptr,
|  | size_t | size,
|  | size_t | nitems,
|  | FILE * | stream |
| ) |  |  |

Definition at line 354 of file javadeps.c.

References die().

Referenced by findClassName(), and genSymbolTable().

int my_strcmp | ( | const void * | a,
|  | const void * | b |
| ) |  |  |

Definition at line 475 of file javadeps.c.

Referenced by print_table_flush().

void outofmemory | ( | void |  | ) |

Definition at line 285 of file javadeps.c.

Referenced by die(), dumpProvides(), formatClassName(), genSymbolTable(), print_table_add(), and processJavaFile().

static void print_list | ( | char * | in_string | ) | `[static]`

Definition at line 559 of file javadeps.c.

Referenced by genSymbolTable().

void print_table_add | ( | char * | str | ) |

Definition at line 531 of file javadeps.c.

References MAX_PRINT_TABLE, outofmemory(), OUTPUT_PREFIX, PRINT_TABLE, print_table_flush(), and SIZE_PRINT_TABLE.

Referenced by dumpProvides(), dumpRefType(), and dumpRequires().

void print_table_flush | ( | void |  | ) |

Definition at line 488 of file javadeps.c.

References my_strcmp(), PRINT_TABLE, and SIZE_PRINT_TABLE.

Referenced by main(), and print_table_add().

void processJavaFile | ( | FILE * | fileHandle | ) |

Definition at line 1152 of file javadeps.c.

References ARG_DEPSFORMAT, ARG_PROVIDES, ARG_REQUIRES, CLASS_NAME, dumpProvides(), dumpRequires(), findClassName(), formatClassName(), freeSymbolTable(), genSymbolTable(), outofmemory(), and OUTPUT_PREFIX.

Referenced by main().

void usage | ( | void |  | ) |

Definition at line 162 of file javadeps.c.

Referenced by main().

## Variable Documentation

int ARG_DEPSFORMAT = 0

Definition at line 103 of file javadeps.c.

Referenced by main(), and processJavaFile().

int ARG_KEYWORDS = 0

Definition at line 104 of file javadeps.c.

Referenced by genSymbolTable(), and main().

int ARG_PROVIDES = 0

Definition at line 100 of file javadeps.c.

Referenced by genSymbolTable(), main(), and processJavaFile().

int ARG_REQUIRES = 0

Definition at line 101 of file javadeps.c.

Referenced by genSymbolTable(), main(), and processJavaFile().

int ARG_RPMFORMAT = 0

Definition at line 102 of file javadeps.c.

Referenced by formatClassName(), and main().

int ARG_STARPROV = 0

Definition at line 105 of file javadeps.c.

Referenced by dumpProvides(), and main().

char* CLASS_NAME = 0

Definition at line 93 of file javadeps.c.

Referenced by die(), main(), and processJavaFile().

char* FILE_NAME = 0

Definition at line 90 of file javadeps.c.

Referenced by die(), and main().

char* KEYWORD_EPOCH = 0

Definition at line 110 of file javadeps.c.

Referenced by dumpProvides(), and genSymbolTable().

char* KEYWORD_REVISION = 0

Definition at line 109 of file javadeps.c.

Referenced by dumpProvides(), and genSymbolTable().

char* KEYWORD_VERSION = 0

Definition at line 108 of file javadeps.c.

Referenced by dumpProvides(), and genSymbolTable().

char* OUTPUT_PREFIX = 0

Definition at line 97 of file javadeps.c.

Referenced by print_table_add(), and processJavaFile().

char* PRINT_TABLE[10000]

Definition at line 135 of file javadeps.c.

Referenced by print_table_add(), and print_table_flush().

char* PROGRAM_NAME = 0

Definition at line 87 of file javadeps.c.

Referenced by die(), and main().

int SIZE_PRINT_TABLE

Definition at line 136 of file javadeps.c.

Referenced by print_table_add(), and print_table_flush().