debuggers: import openocd-0.7.0
Initial check-in of openocd-0.7.0 as it can be downloaded from http://sourceforge.net/projects/openocd/files/openocd/0.7.0/ Any modifications will follow. Change-Id: I6949beaefd589e046395ea0cb80f4e1ab1654d55
This commit is contained in:
7
debuggers/openocd/jimtcl/examples.ext/README
Normal file
7
debuggers/openocd/jimtcl/examples.ext/README
Normal file
@ -0,0 +1,7 @@
|
||||
This directory contains examples of C extensions for Jim.
|
||||
|
||||
In general, do:
|
||||
|
||||
build-jim-ext extsource.c
|
||||
|
||||
See the Makefile
|
||||
24
debuggers/openocd/jimtcl/examples.ext/helloworld.c
Normal file
24
debuggers/openocd/jimtcl/examples.ext/helloworld.c
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* hello.c -- A minimal Jim C extension.
|
||||
*/
|
||||
#include <jim.h>
|
||||
|
||||
static int
|
||||
Hello_Cmd(Jim_Interp *interp, int objc, Jim_Obj *const objv[])
|
||||
{
|
||||
Jim_SetResultString(interp, "Hello, World!", -1);
|
||||
return JIM_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Jim_helloworldInit -- Called when Jim loads your extension.
|
||||
*
|
||||
* Note that the name *must* correspond exactly to the name of the extension:
|
||||
* Jim_<extname>Init
|
||||
*/
|
||||
int
|
||||
Jim_helloworldInit(Jim_Interp *interp)
|
||||
{
|
||||
Jim_CreateCommand(interp, "hello", Hello_Cmd, NULL, NULL);
|
||||
return JIM_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user