/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished  proprietary information of BroadOn Communications Corp.,
 *  and  are protected by Federal copyright law. They may not be disclosed
 *  to  third  parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */


#ifndef __APPUTILS_H__
#define __APPUTILS_H__


typedef int (*CommandProc)(char *args, char *extra);

typedef struct {
    char *cmd;
    CommandProc proc;
    char *desc;
    void *arg;
} Command;


extern int  getNextToken(char **cur, char **rest);
extern int  parseCommand(char *line, Command *commands);
extern int  help(char *args, char *d);
extern int  asciiToInt(char *str);
u32 atou32(char *str);
extern char * stripPath(char *name, int size);
extern int  source(char *args, char *d);


int printascii(char *name, char *d);
int fprintascii(char *name, char *d);
u32 elfload(char *name, u32 *entry_point);
u32 dolload(char *name, u32 *entry_point);
u32 binload(char *name, u32 addr, u32 len);
u32 bindump(char *name, u32 addr, u32 len);
int m_osrun(char *args, char *d);
int m_elfload(char *args, char *d);
int m_ioprun(char *args, char *d);
int m_dolload(char *args, char *d);
int m_binload(char *args, char *d);
int m_bindump(char *args, char *d);
int m_ioprun(char *args, char *d);
#endif /* __APPUTILS_H__ */
