本文整理汇总了C++中FindTask函数 的典型用法代码示例。如果您正苦于以下问题:C++ FindTask函数的具体用法?C++ FindTask怎么用?C++ FindTask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindTask函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SendRexxCommand
LONG SendRexxCommand(CONST_STRPTR port, CONST_STRPTR Cmd, STRPTR Result, LONG ResultSize)
{
struct MsgPort *RexxPort;
struct MsgPort *ReplyPort = &((struct Process *)FindTask(NULL))->pr_MsgPort;
struct Library *RexxSysBase;
#ifdef __AMIGAOS4__
struct RexxSysIFace *IRexxSys;
#else
void *IRexxSys;
#endif
int rc;
*Result = '\0';
if ((RexxSysBase = OpenLibraryInterface("rexxsyslib.library", 36L, &IRexxSys)))
{
Forbid();
if ((RexxPort = FindPort(port)))
{
struct RexxMsg *rexxMsg, *Answer;
if ((rexxMsg = CreateRexxMsg(ReplyPort, NULL, NULL)))
{
if ((rexxMsg->rm_Args[0] = (STRPTR)CreateArgstring(Cmd, strlen(Cmd))))
{
rexxMsg->rm_Action = RXCOMM | RXFF_RESULT;
PutMsg(RexxPort, &rexxMsg->rm_Node);
Permit();
do
{
WaitPort(ReplyPort);
Answer = (struct RexxMsg *)GetMsg(ReplyPort);
} while (Answer == NULL);
if ((rc = (Answer->rm_Result1 == RETURN_OK)))
{
if (Answer->rm_Result2)
{
strncpy(Result, (STRPTR)Answer->rm_Result2, ResultSize);
DeleteArgstring((STRPTR)Answer->rm_Result2);
}
}
DeleteArgstring((STRPTR)ARG0(Answer));
DeleteRexxMsg(Answer);
CloseLibraryInterface(RexxSysBase,IRexxSys);
return rc;
} else
{
DeleteRexxMsg(rexxMsg);
}
}
}
Permit();
CloseLibraryInterface(RexxSysBase,IRexxSys);
}
return 0;
}
开发者ID:sba1, 项目名称:simplemail, 代码行数:65, 代码来源:amigasupport.c
示例2: handle_startup_msg
static void handle_startup_msg (void)
{
struct Process *self = (struct Process*) FindTask (NULL);
WaitPort (&self->pr_MsgPort);
ReplyMsg (GetMsg (&self->pr_MsgPort));
}
开发者ID:CrashSerious, 项目名称:PiUAE, 代码行数:6, 代码来源:thread.c
示例3: amiga_init
void amiga_init (char *dir)
{
if ((DefaultPubScreen = LockPubScreen (0)) == 0)
exit (1);
screen_ratio (DefaultPubScreen);
char prog_name[256];
static char font_name[MAXFONTPATH];
char *font_desc, *name_ptr;
static WORD pens[] =
{-1};
static struct TextAttr font =
{NULL, 0, FS_NORMAL, 0};
int window = 0;
if (Icon == NULL)
{
if (GetProgramName (prog_name, 256))
Icon = GetDiskObject (prog_name);
}
if (Icon)
{
if (FindToolType (Icon->do_ToolTypes, "WINDOW"))
window = 1;
if (font_desc = FindToolType (Icon->do_ToolTypes, "FONT"))
{
strcpy (font_name, font_desc);
if (name_ptr = strrchr (font_name, '/'))
{
font.ta_Name = font_name;
font.ta_YSize = atoi (name_ptr + 1);
strcpy (name_ptr, ".font");
}
}
if (font.ta_Name)
Font = OpenDiskFont (&font);
}
if (Font == NULL)
{
font.ta_Name = "topaz.font";
font.ta_YSize = 8;
Font = OpenFont (&font);
}
if (window == 0)
{
if ((Screen = OpenScreenTags (0,
SA_Pens, pens,
SA_DisplayID, GetVPModeID (&DefaultPubScreen->ViewPort),
SA_Overscan, OSCAN_TEXT,
SA_Depth, 2,
SA_Type, CUSTOMSCREEN | AUTOSCROLL,
SA_Font, &font,
SA_Title, TitleBar, TAG_DONE)) == 0)
exit (1);
}
if ((Window = OpenWindowTags (0,
WA_Left, 0,
WA_Top, Screen ? 2 : DefaultPubScreen->BarHeight + 1,
WA_Width, Screen ? Screen->Width : ScreenWidth,
WA_Height, Screen ? Screen->Height - 2 : ScreenHeight - DefaultPubScreen->BarHeight - 1,
WA_SmartRefresh, 1,
WA_NewLookMenus, 1,
WA_AutoAdjust, 1,
WA_Borderless, Screen ? 1 : 0,
WA_Backdrop, Screen ? 1 : 0,
WA_Activate, 1,
WA_CloseGadget, Screen ? 0 : 1,
WA_DragBar, Screen ? 0 : 1,
WA_DepthGadget, Screen ? 0 : 1,
WA_SizeGadget, Screen ? 0 : 1,
WA_SizeBBottom, Screen ? 0 : 1,
WA_Title, TitleBar,
WA_ScreenTitle, TitleBar,
WA_IDCMP, IDCMP_RAWKEY | IDCMP_VANILLAKEY | IDCMP_MENUPICK | IDCMP_CLOSEWINDOW | IDCMP_CHANGEWINDOW,
Screen ? WA_CustomScreen : WA_PubScreen, Screen ? Screen : DefaultPubScreen,
TAG_DONE)) == 0)
exit (1);
ThisProcess = (struct Process *)FindTask(0);
OldWindowPtr = ThisProcess->pr_WindowPtr;
ThisProcess->pr_WindowPtr = Window;
if ((Visual = GetVisualInfo (Window->WScreen, TAG_DONE)) == 0)
exit (1);
if ((Menus = CreateMenus (NewMenus, GTMN_NewLookMenus, TRUE, TAG_DONE)) == 0)
exit (1);
LayoutMenus (Menus, Visual, GTMN_NewLookMenus, TRUE, TAG_DONE);
SetMenuStrip (Window, Menus);
if ((GameReq = alloc_freq (dir)) == 0)
exit (1);
if ((SaveReq = alloc_freq (dir)) == 0)
exit (1);
if ((ScriptReq = alloc_freq (dir)) == 0)
exit (1);
RastPort = Window->RPort;
//.........这里部分代码省略.........
开发者ID:DavidKinder, 项目名称:Level9, 代码行数:101, 代码来源:amiga.c
示例4: X11_Init
static int X11_Init(LIBBASETYPEPTR LIBBASE)
{
struct x11_staticdata *xsd = &LIBBASE->xsd;
D(bug("Entering X11_Init\n"));
if (LIBBASE->library.lib_OpenCnt) {
D(bug("[X11GFX] Already initialized\n"));
return TRUE;
}
InitSemaphore( &xsd->sema );
InitSemaphore( &xsd->x11sema );
/* Do not need to singlethead this
* since no other tasks are using X currently
*/
xsd->display = XCALL(XOpenDisplay, NULL);
if (xsd->display)
{
struct x11task_params xtp;
struct Task *x11task;
XCALL(XSetErrorHandler, MyErrorHandler);
XCALL(XSetIOErrorHandler, MySysErrorHandler);
/*
* XXX on my system, getenv() is declared:
*
* extern char *getenv (__const char *__name) __THROW __nonnull ((1)) * __wur;
*
* the attributes appear to change the calling convention, so a naive
* prototype like char *getenv(char *) causes carshes as the returned
* address is not a valid pointer.
*
* ideally this configration variable would be brought in via a
* bootloader.resource, which hosted doesn't have yet
*/
/*
if (getenv, "AROS_X11_FULLSCREEN")
{
xsd->fullscreen = x11_fullscreen_supported(xsd->display);
}
*/
xsd->delete_win_atom = XCALL(XInternAtom, xsd->display, "WM_DELETE_WINDOW", FALSE);
xsd->clipboard_atom = XCALL(XInternAtom, xsd->display, "CLIPBOARD", FALSE);
xsd->clipboard_property_atom = XCALL(XInternAtom, xsd->display, "AROS_HOSTCLIP", FALSE);
xsd->clipboard_incr_atom = XCALL(XInternAtom, xsd->display, "INCR", FALSE);
xsd->clipboard_targets_atom = XCALL(XInternAtom, xsd->display, "TARGETS", FALSE);
xtp.parent = FindTask(NULL);
xtp.ok_signal = SIGBREAKF_CTRL_E;
xtp.fail_signal = SIGBREAKF_CTRL_F;
xtp.kill_signal = SIGBREAKF_CTRL_C;
xtp.xsd = xsd;
if ((x11task = create_x11task(&xtp)))
{
if (initclasses(xsd))
{
D(bug("X11_Init succeeded\n"));
return TRUE;
}
Signal(x11task, xtp.kill_signal);
}
XCALL(XCloseDisplay, xsd->display);
}
D(bug("X11_Init failed\n"));
return FALSE;
}
开发者ID:robn, 项目名称:cake, 代码行数:76, 代码来源:x11_init.c
示例5: GC_add_roots_inner
/* xoper hunks Shell Process */
num=0;
for (data = (ULONG *)BADDR(myseglist); data != NULL;
data = (ULONG *)BADDR(data[0])) {
if (((ULONG) GC_register_data_segments < (ULONG) &data[1]) ||
((ULONG) GC_register_data_segments > (ULONG) &data[1] + data[-1])) {
# ifdef __GNUC__
if (dataSegSize == data[-1]) {
found_segment = TRUE;
}
# endif
GC_add_roots_inner((char *)&data[1],
((char *)&data[1]) + data[-1], FALSE);
}
++num;
} /* for */
# ifdef __GNUC__
if (!found_segment) {
ABORT("Can`t find correct Segments.\nSolution: Use an newer version of ixemul.library");
}
# endif
}
#if 0 /* old version */
void GC_register_data_segments()
{
extern struct WBStartup *_WBenchMsg;
struct Process *proc;
struct CommandLineInterface *cli;
BPTR myseglist;
ULONG *data;
if ( _WBenchMsg != 0 ) {
if ((myseglist = _WBenchMsg->sm_Segment) == 0) {
GC_err_puts("No seglist from workbench\n");
return;
}
} else {
if ((proc = (struct Process *)FindTask(0)) == 0) {
GC_err_puts("Cannot find process structure\n");
return;
}
if ((cli = BADDR(proc->pr_CLI)) == 0) {
GC_err_puts("No CLI\n");
return;
}
if ((myseglist = cli->cli_Module) == 0) {
GC_err_puts("No seglist from CLI\n");
return;
}
}
for (data = (ULONG *)BADDR(myseglist); data != 0;
data = (ULONG *)BADDR(data[0])) {
# ifdef AMIGA_SKIP_SEG
if (((ULONG) GC_register_data_segments < (ULONG) &data[1]) ||
((ULONG) GC_register_data_segments > (ULONG) &data[1] + data[-1])) {
# else
{
# endif /* AMIGA_SKIP_SEG */
GC_add_roots_inner((char *)&data[1],
((char *)&data[1]) + data[-1], FALSE);
}
}
}
#endif /* old version */
#endif
#ifdef GC_AMIGA_AM
#ifndef GC_AMIGA_FASTALLOC
void *GC_amiga_allocwrapper(size_t size,void *(*AllocFunction)(size_t size2)) {
return (*AllocFunction)(size);
}
void *(*GC_amiga_allocwrapper_do)(size_t size,void *(*AllocFunction)(size_t size2))
=GC_amiga_allocwrapper;
#else
void *GC_amiga_allocwrapper_firsttime(size_t size,void *(*AllocFunction)(size_t size2));
void *(*GC_amiga_allocwrapper_do)(size_t size,void *(*AllocFunction)(size_t size2))
=GC_amiga_allocwrapper_firsttime;
/******************************************************************
Amiga-spesific routines to obtain memory, and force GC to give
back fast-mem whenever possible.
These hacks makes gc-programs go many times faster when
the amiga is low on memory, and are therefore strictly necesarry.
//.........这里部分代码省略.........
开发者ID:REALTOBIZ, 项目名称:mono, 代码行数:101, 代码来源:AmigaOS.c
示例6: open_ssl_lib
int open_ssl_lib(void)
{
#ifdef NO_SSL
return 0;
#else
struct thread_s *thread;
SM_ENTER;
if (!(thread = (struct thread_s*)FindTask(NULL)->tc_UserData))
goto out;
if (!open_socket_lib())
goto out;
#ifndef USE_OPENSSL
if (!thread->amissllib)
{
#ifdef USE_AMISSL3
if (open_amissl3(thread))
{
#else
SM_DEBUGF(10,("Open amissl.library\n"));
if ((thread->amissllib = OpenLibraryInterface("amissl.library",1,&thread->iamissl)))
{
if (!InitAmiSSL(AmiSSL_Version,
AmiSSL_CurrentVersion,
AmiSSL_Revision, AmiSSL_CurrentRevision,
AmiSSL_SocketBase, (ULONG)SocketBase,
/* AmiSSL_VersionOverride, TRUE,*/ /* If you insist */
TAG_DONE))
{
#endif
#endif
if ((thread->ssl_ctx = ssl_create_context()))
{
/* Everything is ok */
thread->ssllib_opencnt = 1;
SM_DEBUGF(10,("AmiSSL opened %ld times\n",thread->ssllib_opencnt));
SM_RETURN(1,"%ld");
return 1;
}
#ifndef USE_OPENSSL
#ifdef USE_AMISSL3
close_amissl3(thread);
}
#else
CleanupAmiSSL(TAG_DONE);
}
CloseLibraryInterface(thread->amissllib,thread->iamissl);
thread->iamissl = NULL;
thread->amissllib = NULL;
}
#endif
} else
{
thread->ssllib_opencnt++;
SM_DEBUGF(10,("AmiSSL opened %ld times\n",thread->ssllib_opencnt));
SM_RETURN(1,"%ld");
return 1;
}
#else /* USE_OPENSSL */
return 1;
#endif
out:
close_socket_lib();
SM_RETURN(0,"%ld");
return 0;
#endif
}
开发者ID:sba1, 项目名称:simplemail, 代码行数:70, 代码来源:tcpip.c
示例7: ProgressWindow_SubTask
STATIC VOID ProgressWindow_SubTask( STRPTR message )
{
struct Library * MUIMasterBase;
ENTER();
DBG_STRING(message);
if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
{
Object * app, * window;
app = ApplicationObject,
MUIA_Application_Title , "AmiNZB.WNDP",
MUIA_Application_Base , "AmiNZB.WNDP",
MUIA_Application_Version , ProgramVersionTag(),
MUIA_Application_Description, ProgramDescription(),
SubWindow, window = WindowObject,
MUIA_Window_Borderless , TRUE,
MUIA_Window_CloseGadget, FALSE,
MUIA_Window_SizeGadget , FALSE,
MUIA_Window_DepthGadget, FALSE,
MUIA_Window_DragBar , FALSE,
MUIA_Window_ScreenTitle, ProgramDescription(),
WindowContents, VGroup, GroupFrameT(NULL),
InnerSpacing(2,4),
Child, TextObject,
MUIA_Text_Contents, (ULONG)message,
MUIA_Text_PreParse, "\033b\033c",
MUIA_Font, MUIV_Font_Big,
End,
Child, BusyObject, End,
End,
End,
End;
if( app )
{
DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
set(window,MUIA_Window_Open,TRUE);
if(xget( window, MUIA_Window_Open))
{
ULONG sigs = 0;
BOOL running = TRUE;
struct Window * iWindow;
if((iWindow = (struct Window *) xget( window, MUIA_Window_Window)))
{
((struct Process *)FindTask(0))->pr_WindowPtr = iWindow;
//SetWindowTitles( iWindow, NULL, ProgramDescription());
}
do {
switch(DoMethod(app,MUIM_Application_NewInput,&sigs))
{
case MUIV_Application_ReturnID_Quit:
//running = FALSE;
DisplayBeep(NULL);
break;
default:
break;
}
if(running && sigs)
{
sigs = Wait(sigs | SIGBREAKF_CTRL_C);
if (sigs & SIGBREAKF_CTRL_C) break;
}
} while(running);
set(window,MUIA_Window_Open,FALSE);
}
MUI_DisposeObject(app);
}
CloseLibrary(MUIMasterBase);
}
LEAVE();
}
开发者ID:diegocr, 项目名称:AmiNZB, 代码行数:85, 代码来源:wndp.c
示例8: fn00001000
void fn00001000(int32 d0, byte * a0)
{
struct Eq_4 * a6_8 = *(struct Eq_4 **) 0x04;
int32 d2_166 = d0;
byte * a2_249 = a0;
if (a6_8->w0014 < 0x24)
{
word32 * a0_505 = &globals->ptr2B88;
word32 d0_508 = 0x0C;
do
{
*a0_505 = 0x00;
a0_505 = a0_505 + 0x01;
d0_508 = d0_508 - 0x01;
} while (d0_508 != 0x00);
}
*&globals->ptr2B88 = fp;
*&globals->ptr2B8C = (struct Eq_4 **) a6_8;
struct Eq_25 * d0_19 = FindTask(0x00);
struct Eq_31 * d0_112 = OpenLibrary(0x12BC, 0x00);
if (d0_112 != null)
{
int32 d4_460;
*&globals->ptr2B90 = (struct Eq_31 **) d0_112;
if (d0_19->ptr00AC == null)
{
d4_460 = 0x02;
d2_166 = 0x08;
}
else
{
byte * a0_463 = a0;
d4_460 = 0x03;
do
{
if (*a0_517 == 0x20)
d4_460 = DPB(d4_460, (word16) d4_460 + 0x01, 0);
a0_463 = a0_517 + 0x01;
byte * a0_517 = a0_463;
} while (*a0_517 != 0x00);
}
int32 d0_105 = d4_460 << 0x02;
int32 d0_107 = d0_105 + d2_166;
int32 d3_110 = d0_107 + 0x11;
int32 d1_111 = 0x00010001;
d0_112 = AllocMem(d0_107 + 0x11, 0x00010001);
if (d0_112 != null)
{
Eq_119 a6_162;
struct Eq_67 * dwLoc14_159;
word32 a0_164;
d0_112->dw0000 = (word32) (d0_107 + 0x11);
Eq_126 d4_123 = d4_460 - 0x01;
d0_112[0x03] = (struct Eq_31) d4_123;
d0_112[0x02] = (struct Eq_31) (d0_112 + 0x04 + d0_105 / 0x04);
Mem131[0x00:word32] = 0x00;
struct Eq_67 * d0_132 = d0_19->ptr00AC;
d0_132->ptr0000 = d0_107 + 0x11;
d0_132->dw000C = d4_123 - 0x01;
d0_132->ptr0008 = (byte *) (&d0_132->ptr0010 + d0_105 / 0x0028);
Mem150[0x00:word32] = 0x00;
struct Eq_67 * d0_151 = d0_19->ptr00AC;
if (d0_151 == null)
{
fn00001214(d0_19);
*&globals->ptr2B94 = (struct Eq_67 **) d0_151;
*&globals->ptr2B98 = (struct Eq_67 **) d0_151;
Mem403[0x00:word32] = 0x00;
dwLoc14_159 = d0_151;
ui32 d0_406 = d0_151->dw0024;
if (d0_406 != 0x00)
Enable();
Supervisor(d0_132);
d0_132->dw0004 = d0_406;
d2_166 = 1005;
if (d0_406 == 0x00)
{
fn0000127C(0x0014);
return;
}
*&globals->dw2B9C = d0_406;
*&globals->dw2BA0 = d0_406;
*&globals->dw2BA4 = d0_406;
d0_19->dw009C = d0_406;
d0_19->dw00A0 = d0_406;
word32 d0_432 = ((word32[]) 0x08)[d0_406];
if (d0_432 != 0x00)
d0_19->dw00A4 = d0_432;
a6_162 = *&globals->ptr2B8C;
l000011F8:
a0_164 = d0_19->dw003A;
goto l00001202;
}
开发者ID:uxmal, 项目名称:reko, 代码行数:93, 代码来源:BYTEOPS.c
示例9: OpenWindow
SEE ALSO
OpenWindow(), UnlockPubScreen(), GetScreenData()
INTERNALS
*****************************************************************************/
{
AROS_LIBFUNC_INIT
struct Screen *screen = NULL;
struct List *list;
DEBUG_LOCKPUBSCREEN(dprintf("LockPubScreen: name <%s>\n",
name ? name : (CONST_STRPTR)"NULL"));
DEBUG_LOCKPUBSCREEN({struct Task *t = FindTask(NULL);
dprintf("LockPubScreen: task %p <%s>\n",
t,
t->tc_Node.ln_Name ? t->tc_Node.ln_Name : "NULL");});
list = LockPubScreenList();
if( !name )
{
screen = GetPrivIBase(IntuitionBase)->DefaultPubScreen;
/* If IntuitionBase->DefaultPubScreen is NULL, then Workbench screen
is default public screen. But note that, Workbench screen might
here not be open either. */
开发者ID:michalsc, 项目名称:AROS, 代码行数:29, 代码来源:lockpubscreen.c
示例10: intAHIsub_AllocAudio
ULONG __asm __saveds intAHIsub_AllocAudio(
register __a1 struct TagItem *tagList,
register __a2 struct AHIAudioCtrlDrv *AudioCtrl )
{
char *ext = "";
if(AslBase == NULL)
{
return AHISF_ERROR;
}
if(AudioCtrl->ahiac_DriverData = AllocVec(sizeof(struct filesave),MEMF_CLEAR))
{
dd->fs_AHIsubBase = AHIsubBase;
dd->fs_DisableSignal = -1;
dd->fs_EnableSignal = -1;
dd->fs_SlaveSignal = -1;
dd->fs_MasterSignal = AllocSignal(-1);
dd->fs_MasterTask = (struct Process *) FindTask(NULL);
dd->fs_RecSlaveSignal = -1;
dd->fs_RecMasterSignal = AllocSignal(-1);
}
else
{
return AHISF_ERROR;
}
if((dd->fs_MasterSignal == -1) || (dd->fs_RecMasterSignal == -1))
{
return AHISF_ERROR;
}
dd->fs_Format = GetTagData(AHIDB_FileSaveFormat, FORMAT_8SVX, tagList);
switch(dd->fs_Format)
{
case FORMAT_8SVX:
ext = ".8SVX";
break;
case FORMAT_AIFF:
ext = ".AIFF";
break;
case FORMAT_AIFC:
ext = ".AIFC";
break;
case FORMAT_S16:
break;
default:
break;
}
if(!(dd->fs_FileReq = AllocAslRequestTags(ASL_FileRequest,
ASLFR_InitialFile, ext,
ASLFR_DoSaveMode, TRUE,
ASLFR_RejectIcons, TRUE,
ASLFR_TitleText, _LibID,
TAG_DONE)))
{
return AHISF_ERROR;
}
if(!(dd->fs_RecFileReq = AllocAslRequestTags(ASL_FileRequest,
ASLFR_RejectIcons, TRUE,
ASLFR_TitleText, "Select a sound sample",
TAG_DONE)))
{
return AHISF_ERROR;
}
return AHISF_KNOWHIFI|AHISF_KNOWSTEREO|AHISF_CANRECORD|AHISF_MIXING|AHISF_TIMING;
}
开发者ID:BackupTheBerlios, 项目名称:arp2-svn, 代码行数:75, 代码来源:filesave.c
示例11: fprintf
char *uno_step(Tcl_Interp *interp)
{
char msg[MAX_LONG_MESSAGE];
MsgData msgData;
int from=0, to=0, dt=0;
static int prev_time;
static int first_run=1;
char source[128];
char dest[128];
int from_resourcep=0;
Task task;
int valid_message=1;
/* (1) Read in a line from the log file and parse it (This is all done
by the CV_OneStepFromFile procedure.
(2) Check what type of message the line is. */
if (CV_OneStepFromFile(global_log_file, msg, &msgData, interp))
{
if (COMVIEW_DEBUG) {
fprintf(stderr, "%s\n",msg);
}
/* For Success or Failure messages the source (from) the module
which is sending the message is not logged by central. This
information is maintained by the task-tree however, so a call to
FindTask will wean this information. */
if ((msgData->type==FAILURE) ||
(msgData->type==SUCCESS)) {
task = FindTask(msgData->name, msgData->id, task_ACTIVE);
if (!task) {
fprintf(stderr,
"Comview error line %d %s : could not FindTask %s\n",
__LINE__, __FILE__, msgData->name);
}
from=(int)task->additional;
from_resourcep = 0;
to = 0;
strcpy(source, "0");
strcpy(dest, "0");
if (COMVIEW_DEBUG) {
fprintf(stderr, "TASK: %s ", task->creator->name);
fprintf(stderr, "%d ", task->creation_time);
fprintf(stderr, "%d\n", (int)task->additional);
}
} else if (msgData->type == MODULE_CONNECT) {
/* The Tcl code expects the module name in the source element */
strcpy(source, msgData->name);
/* Read and Parse and additional line: the HOSTNAME */
CV_OneStepFromFile(global_log_file, msg, &msgData, interp);
strcpy(dest, msgData->name);
from=module_lookup(source, dest, interp);
} else if (msgData->type == MODULE_DISCONNECT) {
/* the destination string will hold the hostname (eventually) */
strcpy(dest, "0");
/* The Tcl code expects the module name in the source element */
strcpy(source, msgData->name);
from=module_lookup(source, dest, interp);
} else if (logged_message_type(msgData->type)) {
/* check if the message is coming from a resource... */
from_resourcep = resource_msg(msgData->source);
if (from_resourcep)
resource_loc(source, msgData->source);
else strcpy(source, msgData->source);
/* check if the message is going to a resource... */
if (resource_msg (msgData->dest))
resource_loc(dest, msgData->dest);
else strcpy(dest, msgData->dest);
from = module_lookup(source, "", interp);
to = module_lookup(dest, "", interp);
} else {
fprintf(stderr, "COMVIEW WARNING: message type not handled %d\n",
msgData->type);
valid_message = 0;
}
if ((logged_message_type(msgData->type)) &&
(msgData->type != MODULE_CONNECT) &&
(msgData->type != MODULE_DISCONNECT) &&
(msgData->type != HOSTNAME)) {
dt=msgData->time - prev_time;
if (first_run) {
/* the first time through the prev_time is not going to be set */
first_run=0;
dt=10;
/* we also need to tell Tcl what time the first message */
/* occurred at (as a point of reference) */
set_time_vars(interp, msgData->hours, msgData->minutes,
msgData->seconds, msgData->m_seconds);
//.........这里部分代码省略.........
开发者ID:ulyssesrr, 项目名称:carmen_lcad, 代码行数:101, 代码来源:comview.c
示例12: DoDebug
static void DoDebug(xadUINT32 mode, const xadSTRING *fmt, xadTAGPTR tags,
va_list data)
{
xadUINT32 i;
xadUINT32 Flags = 0;
if(!function && (deb_flags & DEBUGFLAG_STATIC))
return;
#ifdef AMIGA
Forbid();
#endif
if((deb_flags & DEBUGFLAG_STATIC)
|| (mode & (DEBUGFLAG_CONTINUE|DEBUGFLAG_CONTINUEEND)))
Flags = deb_flags;
else
{
xadSTRING Mode[17] = "";
#ifdef AMIGA
GetVar("XADDEBUG", (xadSTRPTR) &Mode, sizeof(Mode)-1, GVF_GLOBAL_ONLY);
#else
const xadSTRING *modePtr = getenv("XADDEBUG");
if (modePtr)
strncpy(Mode, modePtr, sizeof(Mode)-1);
#endif
function = 0;
for(i=0; Mode[i] && i < 15; ++i)
{
switch(Mode[i])
{
case 'A': Flags |= DEBUGFLAG_TAGLIST|DEBUGFLAG_RUNTIME|DEBUGFLAG_HOOK
|DEBUGFLAG_ERROR|DEBUGFLAG_OTHER|DEBUGFLAG_MEM
|DEBUGFLAG_FLAGS|DEBUGFLAG_RESOURCE|DEBUGFLAG_CLIENT
|DEBUGFLAG_SEARCHED; break;
case 'M': Flags |= DEBUGFLAG_MEM; break;
case 'O': Flags |= DEBUGFLAG_OTHER; break;
case 'E': Flags |= DEBUGFLAG_ERROR; break;
case 'C': Flags |= DEBUGFLAG_RESOURCE; break;
case 'D': Flags |= DEBUGFLAG_CLIENT|DEBUGFLAG_SEARCHED; break;
case 'F': Flags |= DEBUGFLAG_FLAGS; break;
case 'H': Flags |= DEBUGFLAG_HOOK; break;
case 'R': Flags |= DEBUGFLAG_RUNTIME; break;
case 'T': Flags |= DEBUGFLAG_TAGLIST; break;
case 'S': Flags |= DEBUGFLAG_STATIC; break;
#ifdef __MORPHOS__
case 's': function = RAWFMTFUNC_SERIAL; break;
#elif defined(AMIGA)
case 's': function = serfunc; break;
case 'p': function = parfunc; break;
#endif
case 'f': function = normfunc; break;
case 'e': function = errfunc; break;
case 'o': function = outfunc; break;
case 'n': function = 0; break;
}
}
deb_flags = Flags;
}
mode &= Flags|DEBUGFLAG_CONTINUE|DEBUGFLAG_CONTINUEEND
|DEBUGFLAG_CONTINUESTART;
if(mode & (~(DEBUGFLAG_TAGLIST|DEBUGFLAG_STATIC|DEBUGFLAG_CONTINUE
|DEBUGFLAG_CONTINUEEND|DEBUGFLAG_CONTINUESTART)))
{
#ifdef AMIGA
xadPTR fh = 0;
if(function==normfunc)
{
if((fh = (xadPTR) Open("T:xadMasterOut", MODE_READWRITE)))
{
Seek((BPTR)fh, 0, OFFSET_END);
}
else
function = 0;
}
#else
FILE *fh = NULL;
switch(function)
{
case normfunc: fh = fopen(".libxad-debug", "a"); break;
case outfunc: default: fh = stdout; break;
case errfunc: fh = stderr; break;
}
#endif
if(function)
{
#ifdef AMIGA
if(!(mode & (DEBUGFLAG_CONTINUE|DEBUGFLAG_CONTINUEEND)))
{
i = (xadUINT32) FindTask(0);
OutputDebugArgs("XadM(%08lx):", (putchtype) function, fh, i);
}
#endif
//.........这里部分代码省略.........
开发者ID:GitHubGeek, 项目名称:Sequential, 代码行数:101, 代码来源:debug.c
示例13: main
int main (int argc, char **argv)
{
struct timerequest *timereq = 0;
struct MsgPort *timeport;
struct timeval *tz_offset;
struct Device *TimerBase;
int quit = 0;
int result = calltrap (0, 0);
if (result == 1)
fputs ("timehack already running.\n", stderr);
else if (result == 2)
fputs ("timehack not supported with this version of UAE.\n", stderr);
if (result != 0)
exit (5);
timeport = (struct MsgPort *) CreatePort (0, 0);
if (timeport)
timereq = (struct timerequest *) CreateStdIO(timeport);
if (timereq == 0)
goto fail;
if (OpenDevice ("timer.device", UNIT_VBLANK, (struct IORequest *) timereq, 0) != 0)
goto fail;
TimerBase = timereq->tr_node.io_Device;
SetTaskPri (FindTask (NULL), 20); /* same as input.device */
tz_offset = get_tz_offset();
while (!quit) {
struct timeval cur_sys_time;
timereq->tr_node.io_Command = TR_GETSYSTIME;
DoIO ((struct IORequest *)timereq);
cur_sys_time = timereq->tr_time;
calltrap (1, &timereq->tr_time);
if (timereq->tr_time.tv_secs != cur_sys_time.tv_secs
|| (timereq->tr_time.tv_secs == cur_sys_time.tv_secs
&& ABS(timereq->tr_time.tv_micro - cur_sys_time.tv_micro) > 1000))
{
AddTime (&timereq->tr_time, tz_offset);
timereq->tr_node.io_Command = TR_SETSYSTIME;
DoIO ((struct IORequest *)timereq);
}
timereq->tr_time.tv_secs = 1;
timereq->tr_time.tv_micro = 0;
timereq->tr_node.io_Command = TR_ADDREQUEST;
DoIO ((struct IORequest *)timereq);
if (SetSignal(0L,SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C)
quit = TRUE;
}
/* Exit and error handling badly needs tidying up - Rich */
CloseDevice ((struct IORequest *)timereq);
DeleteStdIO ((struct IOStdReq *)timereq);
DeletePort (timeport);
exit (0);
fail:
fputs ("Couldn't start timehack (that's bad!)\n", stderr);
exit (5);
}
开发者ID:max1325, 项目名称:uae-wii, 代码行数:65, 代码来源:timehack.c
示例14: main
BOOPSI_DISPATCHER_END
int main(void) {
SetTaskPri(FindTask(NULL), 15);
struct MUI_CustomClass *mcc;
if((ps = OpenLibrary("poseidon.library", 4))) {
if((mcc = MUI_CreateCustomClass(NULL, "Area.mui", NULL, sizeof(struct InstData), classdispatcher))) {
mybug(-1,("mui custon class at %p\n", mcc));
Object *app, *window, *tick1, *custom;
app = ApplicationObject,
SubWindow, window = WindowObject,
MUIA_Window_Title, "PS3Eye",
MUIA_Window_Activate, TRUE,
WindowContents, HGroup,
Child, HGroup,
MUIA_Weight, 100,
Child, custom = NewObject(mcc->mcc_Class, NULL, TAG_DONE),
End,
Child, VGroup,
MUIA_Weight, 1,
MUIA_Group_SameWidth, TRUE,
GroupFrameT("Configuration"),
Child, HGroup,
Child, tick1 = MUI_MakeObject(MUIO_Checkmark, NULL),
Child, MUI_MakeObject(MUIO_Label,"640x480", 0),
End,
Child, (IPTR) VSpace(0),
End,
End,
End,
End;
if(app) {
ULONG sigs = 0;
DoMethod(tick1, MUIM_Notify, MUIA_Selected, TRUE, (IPTR)custom, 3, MUIM_Set, MUIA_Resolution, TRUE);
DoMethod(tick1, MUIM_Notify, MUIA_Selected, FALSE, (IPTR)custom, 3, MUIM_Set, MUIA_Resolution, FALSE);
DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
set(window, MUIA_Window_Open, TRUE);
while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit) {
if(sigs) {
sigs = Wait(sigs | SIGBREAKF_CTRL_C);
if(sigs & SIGBREAKF_CTRL_C)
break;
}
}
MUI_DisposeObject(app);
}
MUI_DeleteCustomClass(mcc);
}
CloseLibrary(ps);
}
mybug(-1,("Exiting\n"));
return 0;
}
开发者ID:michalsc, 项目名称:AROS, 代码行数:68, 代码来源:ps3eye.c
示例15: do_file_dialog
static void do_file_dialog (unsigned int type)
{
struct FileRequester *FileRequest;
struct Window *win;
char buf[80];
char path[512];
const char *req_prompt;
const char *req_pattern = 0;
const char *req_lastdir;
int req_do_save = FALSE;
#ifdef __amigaos4__
int release_asl = 0;
#endif
if (type >= FILEDIALOG_MAX)
return;
if (!AslBase) {
AslBase = OpenLibrary ("asl.library", 36);
if (!AslBase) {
write_log ("Can't open asl.library v36.\n");
return;
} else {
#ifdef __amigaos4__
IAsl = (struct AslIFace *) GetInterface ((struct Library *)AslBase, "main", 1, NULL);
if (!IAsl) {
CloseLibrary (AslBase);
AslBase = 0;
write_log ("Can't get asl.library interface\n");
}
#endif
}
#ifdef __amigaos4__
} else {
IAsl->Obtain ();
release_asl = 1;
#endif
}
FileRequest = AllocAslRequest (ASL_FileRequest, NULL);
if (!FileRequest) {
write_log ("Unable to allocate file requester.\n");
return;
}
/* Find this task's default window */
win = ((struct Process *) FindTask (NULL))->pr_WindowPtr;
if (win == (struct Window *)-1)
win = 0;
/*
* Prepare requester.
*/
switch (type) {
default: /* to stop GCC complaining */
case FILEDIALOG_INSERT_DF0:
case FILEDIALOG_INSERT_DF1:
case FILEDIALOG_INSERT_DF2:
case FILEDIALOG_INSERT_DF3:
sprintf (buf, "Select image to insert in drive DF%d:", FILEDIALOG_DRIVE(type));
req_prompt = buf;
req_pattern = "(#?.(ad(f|z)|dms|ipf|zip)#?|df?|?)";
req_lastdir = get_last_floppy_dir ();
break;
case FILEDIALOG_SAVE_STATE:
req_prompt = "Select file to save emulator state to";
req_pattern = "#?.uss";
req_lastdir = get_last_savestate_dir ();
req_do_save = TRUE;
break;
case FILEDIALOG_LOAD_STATE:
req_prompt = "Select saved state file to load";
req_pattern = "#?.uss";
req_lastdir = get_last_savestate_dir ();
break;
}
/*
* Do the file request.
*/
if (AslRequestTags (FileRequest,
ASLFR_TitleText, req_prompt,
ASLFR_InitialDrawer, req_lastdir,
ASLFR_InitialPattern, req_pattern,
ASLFR_DoPatterns, req_pattern != 0,
ASLFR_DoSaveMode, req_do_save,
ASLFR_RejectIcons, TRUE,
ASLFR_Window, win,
TAG_DONE)) {
/*
* User selected a file.
*
* Construct file path to selected image.
//.........这里部分代码省略.........
开发者ID:rzr, 项目名称:PUAE, 代码行数:101, 代码来源:ami-gui.c
示例16: par_init
int par_init(UBYTE useCRC)
{
int result = PAR_INIT_OK;
/* allocate signal for interrupt */
intSig = AllocSignal(-1);
if(intSig == -1) {
return PAR_INIT_NO_SIGNAL;
}
alloc_flags |= 8;
/* setup state structure */
state.s_Flags = 0;
state.s_IntSigMask = 1UL << intSig;
state.s_SysBase = SysBase;
state.s_ServerTask = FindTask(NULL);
state.s_UseCRC = useCRC;
/* register our time out flag */
timer_timeout_set_flag_ptr(&state.s_TimeOut);
if (MiscBase = OpenResource("misc.resource")) {
if (cia_base = OpenResource("ciaa.resource")) {
/* obtain exclusive access to the parallel hardware */
if (!AllocMiscResource(MR_PARALLELPORT, name))
{
alloc_flags |= 1;
if (!AllocMiscResource(MR_PARALLELBITS, name))
{
BOOL ok = FALSE;
alloc_flags |= 2;
/* allocate irq */
irq.is_Node.ln_Type = NT_INTERRUPT;
irq.is_Node.ln_Pri = 127;
irq.is_Node.ln_Name = name;
irq.is_Data = (APTR)&state;
irq.is_Code = (VOID (*)())&interrupt;
Disable();
/* add an interrupt handler for FLAG = ACK */
if (!AddICRVector(cia_base, CIAICRB_FLG, &irq))
{
DISABLEINT;
ok = TRUE;
}
Enable();
/* finish setting up interrupt handler */
if (ok) {
alloc_flags |= 4;
/* setup line */
PARINIT;
CLEARREQUEST;
/* irq setup */
CLEARINT;
ENABLEINT;
} else {
result = PAR_INIT_NO_CIA_IRQ;
}
} else {
result = PAR_INIT_NO_PARBITS_RES;
}
} else {
result = PAR_INIT_NO_PARPORT_RES;
}
}
}
return result;
}
开发者ID:cnvogelg, 项目名称:aminisocket, 代码行数:74, 代码来源:par.c
示例17: AROS_UFH0
/* /// "nGUITask()" */
AROS_UFH0(void, nGUITask)
{
AROS_USERFUNC_INIT
struct Task *thistask;
struct AROSXClassBase *arosxb;
struct AROSXClassController *arosxc;
struct Library *MUIBase;
struct Library *PsdBase;
struct Library *AROSXBase;
struct AROSXClassConfigGUI *gui;
thistask = FindTask(NULL);
arosxc = thistask->tc_UserData;
arosxb = arosxc->arosxb;
struct AROSX_GAMEPAD *arosx_gamepad;
arosx_gamepad = &arosxc->arosx_gamepad;
/*
TODO: Make use of OpenLibrary/CloseLibrary to keep track of lib open count...
*/
++arosxb->Library.lib_OpenCnt;
struct AROSX_EventHook *arosx_eventhook;
struct MsgPort *arosx_eventport;
if(gui = AllocVec(sizeof(struct AROSXClassConfigGUI), MEMF_CLEAR|MEMF_ANY)) {
if(AROSXBase = OpenLibrary("arosx.library", 0)) {
mybug(-1,("[AROSXClass GUI] arosx.library openened\n"));
arosx_eventport = CreateMsgPort();
arosx_eventhook = AROSX_AddEventHandler(arosx_eventport, (((1<<arosxc->id))<<28));
/*
Set to listen every controller
*/
//arosx_eventhook = AROSX_AddEventHandler(arosx_eventport, (0xf<<28));
if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN)))
{
if((ps = OpenLibrary("poseidon.library", 4)))
{
gui->App = ApplicationObject,
MUIA_Application_Title , (IPTR)libname,
MUIA_Application_Version , (IPTR)VERSION_STRING,
MUIA_Application_Copyright , (IPTR)"©2018-2019 The AROS Development Team",
MUIA_Application_Author , (IPTR)"The AROS Development Team",
MUIA_Application_Description, (IPTR)"Settings for the arosx.class",
MUIA_Application_Base , (IPTR)"AROSX",
MUIA_Application_HelpFile , (IPTR)"HELP:Poseidon.guide",
MUIA_Application_Menustrip , (IPTR)MenustripObject,
Child, (IPTR)MenuObjectT((IPTR)"Project"),
Child, (IPTR)(gui->AboutMI = MenuitemObject,
MUIA_Menuitem_Title, (IPTR)"About...",
MUIA_Menuitem_Shortcut, (IPTR)"?",
End),
End,
Child, (IPTR)MenuObjectT((IPTR)"Settings"),
Child, (IPTR)(gui->UseMI = MenuitemObject,
MUIA_Menuitem_Title, (IPTR)"Save",
MUIA_Menuitem_Shortcut, (IPTR)"S",
End),
Child, (IPTR)MenuitemObject,
MUIA_Menuitem_Title, (IPTR)NM_BARLABEL,
End,
Child, (IPTR)(gui->MUIPrefsMI = MenuitemObject,
MUIA_Menuitem_Title, (IPTR)"MUI Settings",
MUIA_Menuitem_Shortcut, (IPTR)"M",
End),
End,
End,
SubWindow, (IPTR)(gui->MainWindow = WindowObject,
MUIA_Window_ID , MAKE_ID('M','A','I','N'),
MUIA_Window_Title, (IPTR)arosxc->name,
MUIA_HelpNode, (IPTR)libname,
WindowContents, (IPTR)VGroup,
Child, (IPTR)(gui->GamepadGroupObject = ColGroup(2),
GroupFrameT("Gamepad"),
MUIA_Disabled, TRUE,
Child, (IPTR)HGroup,
Child, (IPTR)(gui->GamepadObject_button_a = ImageObject,
MUIA_Image_FontMatch, TRUE,
MUIA_Selected, FALSE,
MUIA_ShowSelState, FALSE,
MUIA_Image_Spec, MUII_RadioButton,
MUIA_Frame, MUIV_Frame_None,
End),
Child, (IPTR)(gui->GamepadObject_button_b = ImageObject,
MUIA_Image_FontMatch, TRUE,
MUIA_Selected, FALSE,
MUIA_ShowSelState, FALSE,
//.........这里部分代码省略.........
开发者ID:michalsc, 项目名称:AROS, 代码行数:101, 代码来源:arosx.class.config.gui.c
示例18: usbForceDeviceBinding
六六分期app的软件客服如何联系?不知道吗?加qq群【895510560】即可!标题:六六分期
阅读:19175| 2023-10-27
今天小编告诉大家如何处理win10系统火狐flash插件总是崩溃的问题,可能很多用户都不知
阅读:9986| 2022-11-06
今天小编告诉大家如何对win10系统删除桌面回收站图标进行设置,可能很多用户都不知道
阅读:8325| 2022-11-06
今天小编告诉大家如何对win10系统电脑设置节能降温的设置方法,想必大家都遇到过需要
阅读:8695| 2022-11-06
我们在使用xp系统的过程中,经常需要对xp系统无线网络安装向导设置进行设置,可能很多
阅读:8638| 2022-11-06
今天小编告诉大家如何处理win7系统玩cf老是与主机连接不稳定的问题,可能很多用户都不
阅读:9654| 2022-11-06
电脑对日常生活的重要性小编就不多说了,可是一旦碰到win7系统设置cf烟雾头的问题,很
阅读:8621| 2022-11-06
我们在日常使用电脑的时候,有的小伙伴们可能在打开应用的时候会遇见提示应用程序无法
阅读:7998| 2022-11-06
今天小编告诉大家如何对win7系统打开vcf文件进行设置,可能很多用户都不知道怎么对win
阅读:8652| 2022-11-06
今天小编告诉大家如何对win10系统s4开启USB调试模式进行设置,可能很多用户都不知道怎
阅读:7535| 2022-11-06
请发表评论