pspsdk-1.0+beta2
mksfoex.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "types.h"
Include dependency graph for mksfoex.c:

Data Structures

struct  SfoHeader
struct  SfoEntry
struct  EntryContainer

Macros

#define PSF_MAGIC   0x46535000
#define PSF_VERSION   0x00000101
#define PSF_TYPE_BIN   0
#define PSF_TYPE_STR   2
#define PSF_TYPE_VAL   4
#define MAX_OPTIONS   (256)

Functions

struct SfoHeader __attribute__ ((packed))
struct EntryContainerfind_free ()
struct EntryContainerfind_name (const char *name)
int add_string (char *str)
int add_dword (char *str)
int process_args (int argc, char **argv)
int main (int argc, char **argv)

Variables

uint32_t magic
uint32_t version
uint32_t keyofs
uint32_t valofs
uint32_t count
uint16_t nameofs
uint8_t alignment
uint8_t type
uint32_t valsize
uint32_t totalsize
uint32_t dataofs
struct EntryContainer __attribute__
struct EntryContainer g_defaults []

Macro Definition Documentation

#define MAX_OPTIONS   (256)

Referenced by find_free(), and find_name().

#define PSF_MAGIC   0x46535000

Referenced by main().

#define PSF_TYPE_BIN   0
#define PSF_TYPE_STR   2

Referenced by add_string(), and main().

#define PSF_TYPE_VAL   4

Referenced by add_dword(), and main().

#define PSF_VERSION   0x00000101

Referenced by main().

Function Documentation

struct SfoHeader __attribute__ ( (packed)  )
struct EntryContainer* find_free ( )
read

References i, MAX_OPTIONS, name, and NULL.

Referenced by add_dword(), add_string(), and main().

struct EntryContainer* find_name ( const char *  name)
read

References i, MAX_OPTIONS, NULL, and strcmp().

Referenced by main().

int process_args ( int  argc,
char **  argv 
)

References add_dword(), add_string(), ch, getopt_long(), NULL, optarg, and optind.

Referenced by main().

Variable Documentation

uint8_t alignment
uint32_t dataofs
struct EntryContainer g_defaults[]
Initial value:
{
{ "BOOTABLE", PSF_TYPE_VAL, 1, NULL },
{ "CATEGORY", PSF_TYPE_STR, 0, "MG" },
{ "DISC_ID", PSF_TYPE_STR, 0, "UCJS10041" },
{ "DISC_VERSION", PSF_TYPE_STR, 0, "1.00" },
{ "PARENTAL_LEVEL", PSF_TYPE_VAL, 1, NULL },
{ "PSP_SYSTEM_VER", PSF_TYPE_STR, 0, "1.00" },
{ "REGION", PSF_TYPE_VAL, 0x8000, NULL },
}

Referenced by main().

uint32_t keyofs

Referenced by main().

uint32_t magic
uint16_t nameofs
uint32_t totalsize

Referenced by main().

uint8_t type
uint32_t valofs
uint32_t valsize

Referenced by main().

uint32_t version