?? appshell.c
字號:
/*
* Copyright (c) 1995,2000 TriMedia Technologies Inc.
*
* +------------------------------------------------------------------+
* | This software is furnished under a license and may only be used |
* | and copied in accordance with the terms and conditions of such |
* | a license and with the inclusion of this copyright notice. This |
* | software or any other copies of this software may not be provided|
* | or otherwise made available to any other person. The ownership |
* | and title of this software is not transferred. |
* | |
* | The information in this software is subject to change without |
* | any prior notice and should not be construed as a commitment by |
* | TriMedia Technologies. |
* | |
* | this code and information is provided "as is" without any |
* | warranty of any kind, either expressed or implied, including but |
* | not limited to the implied warranties of merchantability and/or |
* | fitness for any particular purpose. |
* +------------------------------------------------------------------+
*
* Module name : compappshell.c 1.1
*
* Last update : 21:39:57 - 98/04/27
*
* Description :
*
*/
/*----------------------------includes----------------------------------------*/
#include <stdio.h>
#include <tmlib/tmtypes.h>
#include <tmlib/DynamicLoader.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>
#include <dirent.h>
#include "unistd.h"
#include "errno.h"
#include <tm1/tmLibdevErr.h>
/*------------------------ Application Shell ---------------------------------*/
extern Int _rts_trace_dynldr;
typedef Int(*Main_Function) ();
#define APP_DEMO "/flash/application.app"
static void load_and_run( String app_to_be_run )
{
DynLoad_Status load_status;
DynLoad_Code_Segment_Handle module;
_rts_trace_dynldr = True;
load_status = DynLoad_load_application(app_to_be_run, &module);
if (load_status == DynLoad_OK) {
printf("*** loading of `%s` succeeded\n", app_to_be_run);
printf("status= %d\n", ((Main_Function) module->start) (0,0) );
} else {
String error_msg= Null;
switch (load_status) {
case DynLoad_UnknownObjectVersion :
case DynLoad_WrongChecksum :
case DynLoad_InconsistentObject : error_msg= "inconsistent object"; break;
case DynLoad_WrongEndian : error_msg= "wrong endian"; break;
case DynLoad_NotAnApp : error_msg= "not an application object"; break;
case DynLoad_FileNotFound : error_msg= "file not found"; break;
case DynLoad_InsufficientMemory : error_msg= "memory overflow"; break;
}
printf("*** loading of `%s` failed with status %d (%s)\n",
app_to_be_run, load_status,
error_msg);
}
}
int main()
{
printf("------- ---------APP DEMO STARTED -------------\n");
load_and_run(APP_DEMO);
printf("-------- --------APP DEMO TERMINATED--------\n");
exit(0);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -