pspsdk-1.0+beta2
|
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <ctype.h>
#include "sha1.h"
Data Structures | |
struct | psp_export |
struct | psp_alias |
struct | psp_lib |
struct | export_cmd |
Macros | |
#define | MAX_LIB_NAME 27 |
#define | MAX_LIB_FUNCS 65535 |
#define | MAX_LIB_VARS 255 |
#define | MAX_LIB_ENTRY_NAME 127 |
#define | MAX_ERROR 1024 |
#define | MAX_LINE 1024 |
#define | SYSTEM_LIB_NAME "syslib" |
Functions | |
void | free_export_chain (struct psp_export *pHead) |
void | free_alias_chain (struct psp_alias *pHead) |
void | free_lib_data (void) |
const char * | find_alias (struct psp_alias *pHead, const char *name) |
int | process_args (int argc, char **argv) |
void | print_help (void) |
void | strip_whitespace (char *dest, const char *src) |
int | parse_string (char *line, char **params, int max_params) |
void | build_exports_output_extern (struct psp_export *pHead) |
void | build_exports_output_nids (struct psp_export *pHead) |
void | build_exports_output_names (struct psp_export *pHead) |
void | build_exports (void) |
void | build_stubs_output_lib (struct psp_lib *pLib) |
void | build_stubs_output_lib_new (struct psp_lib *pLib) |
void | build_stubs (void) |
int | validate_number (const char *str, unsigned int *num) |
int | psp_begin_exports (char **params) |
int | psp_end_exports (char **params) |
int | psp_export_start (char **params) |
int | psp_export_end (char **params) |
int | internal_do_export (const char *name, unsigned int nid, struct psp_export **pHead) |
int | psp_export_func_nid (char **params) |
int | psp_export_func_hash (char **params) |
int | psp_export_var_nid (char **params) |
int | psp_export_var_hash (char **params) |
int | psp_export_alias (char **params) |
int | process_command (const char *cmd, char **params, int param_count) |
int | load_exports (void) |
void | dump_exports (void) |
int | main (int argc, char **argv) |
Variables | |
struct export_cmd | commands [] |
#define MAX_ERROR 1024 |
#define MAX_LIB_ENTRY_NAME 127 |
Referenced by internal_do_export(), and psp_export_alias().
#define MAX_LIB_FUNCS 65535 |
Referenced by psp_export_func_hash(), and psp_export_func_nid().
#define MAX_LIB_NAME 27 |
Referenced by psp_export_start().
#define MAX_LIB_VARS 255 |
Referenced by psp_export_var_hash(), and psp_export_var_nid().
#define MAX_LINE 1024 |
Referenced by load_exports().
#define SYSTEM_LIB_NAME "syslib" |
Referenced by build_exports(), and build_stubs().
enum PspConfigMode |
void build_exports | ( | void | ) |
References psp_lib::attr, build_exports_output_extern(), build_exports_output_names(), build_exports_output_nids(), fprintf(), psp_lib::funcCount, psp_lib::name, NULL, psp_lib::pFuncHead, psp_lib::pNext, psp_lib::pVarHead, stdout, strcmp(), SYSTEM_LIB_NAME, psp_lib::varCount, and psp_lib::ver.
Referenced by main().
void build_exports_output_extern | ( | struct psp_export * | pHead | ) |
References fprintf(), psp_export::name, NULL, psp_export::pNext, and stdout.
Referenced by build_exports().
void build_exports_output_names | ( | struct psp_export * | pHead | ) |
References fprintf(), psp_export::name, NULL, psp_export::pNext, and stdout.
Referenced by build_exports().
void build_exports_output_nids | ( | struct psp_export * | pHead | ) |
References fprintf(), psp_export::nid, NULL, psp_export::pNext, and stdout.
Referenced by build_exports().
void build_stubs | ( | void | ) |
References build_stubs_output_lib(), build_stubs_output_lib_new(), psp_lib::name, NULL, psp_lib::pNext, PSP_BUILD_STUBS, strcmp(), and SYSTEM_LIB_NAME.
Referenced by main().
void build_stubs_output_lib | ( | struct psp_lib * | pLib | ) |
References psp_lib::attr, fclose(), filename, find_alias(), fopen(), fp, fprintf(), psp_lib::funcCount, psp_export::name, psp_lib::name, psp_export::nid, NULL, psp_lib::pAliasHead, psp_lib::pFuncHead, psp_export::pNext, snprintf(), stderr, and psp_lib::ver.
Referenced by build_stubs().
void build_stubs_output_lib_new | ( | struct psp_lib * | pLib | ) |
References psp_lib::attr, fclose(), filename, find_alias(), fopen(), fp, fprintf(), i, psp_export::name, psp_lib::name, psp_export::nid, NULL, psp_lib::pAliasHead, psp_lib::pFuncHead, psp_export::pNext, snprintf(), stderr, and psp_lib::ver.
Referenced by build_stubs().
void dump_exports | ( | void | ) |
References psp_lib::attr, count, fprintf(), psp_lib::funcCount, psp_export::name, psp_lib::name, psp_export::nid, NULL, psp_lib::pFuncHead, psp_export::pNext, psp_lib::pNext, psp_lib::pVarHead, stderr, psp_lib::varCount, and psp_lib::ver.
Referenced by main().
const char* find_alias | ( | struct psp_alias * | pHead, |
const char * | name | ||
) |
References psp_alias::alias, psp_alias::name, NULL, psp_alias::pNext, and strcmp().
Referenced by build_stubs_output_lib(), and build_stubs_output_lib_new().
void free_alias_chain | ( | struct psp_alias * | pHead | ) |
References free(), NULL, and psp_alias::pNext.
Referenced by free_lib_data().
void free_export_chain | ( | struct psp_export * | pHead | ) |
References free(), NULL, and psp_export::pNext.
Referenced by free_lib_data().
void free_lib_data | ( | void | ) |
References free(), free_alias_chain(), free_export_chain(), NULL, psp_lib::pAliasHead, psp_lib::pFuncHead, psp_lib::pNext, and psp_lib::pVarHead.
Referenced by main().
int internal_do_export | ( | const char * | name, |
unsigned int | nid, | ||
struct psp_export ** | pHead | ||
) |
References assert, malloc(), MAX_ERROR, MAX_LIB_ENTRY_NAME, memset(), psp_export::name, psp_export::nid, NULL, psp_export::pNext, snprintf(), and strncpy().
Referenced by psp_export_func_hash(), psp_export_func_nid(), psp_export_var_hash(), and psp_export_var_nid().
int load_exports | ( | void | ) |
References fgets(), fopen(), fp, fprintf(), i, MAX_LINE, NULL, export_cmd::params, parse_string(), process_command(), stderr, and strip_whitespace().
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
int parse_string | ( | char * | line, |
char ** | params, | ||
int | max_params | ||
) |
References assert, isalnum(), MAX_ERROR, NULL, snprintf(), and strtok().
Referenced by load_exports().
int process_args | ( | int | argc, |
char ** | argv | ||
) |
References ch, getopt_long(), NULL, optind, PSP_BUILD_EXPORTS, PSP_BUILD_STUBS, PSP_BUILD_STUBS_NEW, and PSP_BUILD_UNKNOWN.
int process_command | ( | const char * | cmd, |
char ** | params, | ||
int | param_count | ||
) |
References assert, export_cmd::handler, i, MAX_ERROR, name, NULL, snprintf(), and strcmp().
Referenced by load_exports().
int psp_begin_exports | ( | char ** | params | ) |
int psp_end_exports | ( | char ** | params | ) |
References NULL.
int psp_export_alias | ( | char ** | params | ) |
References psp_alias::alias, fprintf(), malloc(), MAX_ERROR, MAX_LIB_ENTRY_NAME, memset(), psp_alias::name, NULL, psp_lib::pAliasHead, psp_alias::pNext, snprintf(), stderr, and strncpy().
int psp_export_end | ( | char ** | params | ) |
References MAX_ERROR, NULL, psp_lib::pNext, and snprintf().
int psp_export_func_hash | ( | char ** | params | ) |
References psp_lib::funcCount, internal_do_export(), MAX_ERROR, MAX_LIB_FUNCS, psp_export::nid, NULL, psp_lib::pFuncHead, sha1(), SHA1_DIGEST_SIZE, snprintf(), and strlen().
int psp_export_func_nid | ( | char ** | params | ) |
References psp_lib::funcCount, internal_do_export(), MAX_ERROR, MAX_LIB_FUNCS, psp_export::nid, NULL, psp_lib::pFuncHead, snprintf(), and validate_number().
int psp_export_start | ( | char ** | params | ) |
References attr, psp_lib::attr, malloc(), MAX_ERROR, MAX_LIB_NAME, memset(), psp_lib::name, NULL, snprintf(), strncpy(), validate_number(), and psp_lib::ver.
int psp_export_var_hash | ( | char ** | params | ) |
References internal_do_export(), MAX_ERROR, MAX_LIB_VARS, psp_export::nid, NULL, psp_lib::pVarHead, sha1(), SHA1_DIGEST_SIZE, snprintf(), strlen(), and psp_lib::varCount.
int psp_export_var_nid | ( | char ** | params | ) |
References internal_do_export(), MAX_ERROR, MAX_LIB_VARS, psp_export::nid, NULL, psp_lib::pVarHead, snprintf(), validate_number(), and psp_lib::varCount.
void strip_whitespace | ( | char * | dest, |
const char * | src | ||
) |
References assert, isspace(), and NULL.
Referenced by load_exports().
int validate_number | ( | const char * | str, |
unsigned int * | num | ||
) |
References assert, endp, isxdigit(), MAX_ERROR, NULL, snprintf(), and strtoul().
Referenced by psp_export_func_nid(), psp_export_start(), and psp_export_var_nid().
struct export_cmd commands[] |