pspsdk-1.0+beta2
psp-build-exports.c File Reference
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <ctype.h>
#include "sha1.h"
Include dependency graph for psp-build-exports.c:

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"

Enumerations

enum  PspConfigMode {
  PSP_BUILD_UNKNOWN, PSP_BUILD_EXPORTS, PSP_BUILD_STUBS, PSP_BUILD_STUBS_NEW,
  PSP_CONFIG_UNKNOWN, PSP_CONFIG_PSPSDK_PATH, PSP_CONFIG_PSPDEV_PATH, PSP_CONFIG_PSP_PREFIX
}

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 []

Macro Definition Documentation

#define MAX_LIB_ENTRY_NAME   127
#define MAX_LIB_FUNCS   65535
#define MAX_LIB_NAME   27

Referenced by psp_export_start().

#define MAX_LIB_VARS   255
#define MAX_LINE   1024

Referenced by load_exports().

#define SYSTEM_LIB_NAME   "syslib"

Referenced by build_exports(), and build_stubs().

Enumeration Type Documentation

Enumerator:
PSP_BUILD_UNKNOWN 
PSP_BUILD_EXPORTS 
PSP_BUILD_STUBS 
PSP_BUILD_STUBS_NEW 
PSP_CONFIG_UNKNOWN 
PSP_CONFIG_PSPSDK_PATH 
PSP_CONFIG_PSPDEV_PATH 
PSP_CONFIG_PSP_PREFIX 

Function Documentation

void build_exports_output_extern ( struct psp_export pHead)
void build_exports_output_names ( struct psp_export pHead)
void build_exports_output_nids ( struct psp_export pHead)
const char* find_alias ( struct psp_alias pHead,
const char *  name 
)
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().

int internal_do_export ( const char *  name,
unsigned int  nid,
struct psp_export **  pHead 
)
int load_exports ( void  )
int parse_string ( char *  line,
char **  params,
int  max_params 
)

References assert, isalnum(), MAX_ERROR, NULL, snprintf(), and strtok().

Referenced by load_exports().

void print_help ( void  )

References fprintf(), and stderr.

Referenced by main().

int process_args ( int  argc,
char **  argv 
)
int process_command ( const char *  cmd,
char **  params,
int  param_count 
)
int psp_begin_exports ( char **  params)
int psp_end_exports ( char **  params)

References NULL.

int psp_export_end ( char **  params)
int psp_export_start ( char **  params)
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 
)

Variable Documentation

struct export_cmd commands[]
Initial value:
{
{ "PSP_BEGIN_EXPORTS", 0, psp_begin_exports },
{ "PSP_END_EXPORTS", 0, psp_end_exports },
{ "PSP_EXPORT_START", 3, psp_export_start },
{ "PSP_EXPORT_END", 0, psp_export_end },
{ "PSP_EXPORT_FUNC_NID", 2, psp_export_func_nid },
{ "PSP_EXPORT_FUNC_HASH", 1, psp_export_func_hash },
{ "PSP_EXPORT_FUNC", 1, psp_export_func_hash },
{ "PSP_EXPORT_VAR_NID", 2, psp_export_var_nid },
{ "PSP_EXPORT_VAR", 1, psp_export_var_hash },
{ "PSP_EXPORT_VAR_HASH", 1, psp_export_var_hash },
{ "PSP_EXPORT_ALIAS", 2, psp_export_alias },
{ NULL, 0, NULL }
}