home *** CD-ROM | disk | FTP | other *** search
-
- /*******************************************************************
- $CRT 13 Sep 1996 : hb
-
- $AUT Holger Burkarth
- $DAT >>PrtProcess.c<< 25 Sep 1996 15:48:39 - (C) ProDAD
- *******************************************************************/
-
- //##ex mcpp:cppc -gs -o pos:pos/Ex/PrtProcess p:pLib/StartCode.o p:/pOS_RKRM/pDos/PrtProcess.c p:pLib/StdIO.o -l pOSStub -l pOS
-
- /***********************************************************
- pOS programing example - Copyright (C) 1995-97 proDAD
-
- This code was written as an easy to understand example,
- how to program pOS features. It is provided 'as-is',
- without any express or implied warranty.
-
- Permission is hereby granted to use, copy and modify
- this source code for any purpose, without fee, subject
- to the following conditions:
-
- (1) This notice may not be removed or altered from any
- source distribution.
-
- (2) Altered source versions must be plainly marked as
- such, and must not be misrepresented as being
- the original source code.
-
- (3) If only executable code is distributed, then the
- accompanying documentation have to state that
- "this software is based in part on examples of
- the pOS developer packet".
-
- (4) Permission for use of this code is granted only
- if the user accepts full responsibility for any
- undesirable consequences. proDAD accept NO LIABILITY
- for damages of any kind.
-
- ©proDAD
- ***********************************************************/
-
- /*\
- *** Example:
- ***
- \*/
-
-
- #define __COMPUTER_AMIGA 1
- #define NOMYDEBUG
-
- #include "p:pExec/Types.h"
- #include "p:pDOS/ArgTags.h"
- #include "p:pDOS/DosSig.h"
- #include "p:pDOS/DosErrors.h"
- #include "p:pDOS/Process.h"
- #include "p:proto/pLibExt.h"
- #include "p:proto/pExec2.h"
- #include "p:proto/pDOS2.h"
-
- #ifdef _____ME_____
- #include "grund/inc_string.h"
- #include "grund/inc_stdio.h"
- #else
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <string.h>
- #include <stdio.h>
- #ifdef __cplusplus
- }
- #endif
- #endif
-
-
- const CHAR *HelpText=
- ""
- ;
-
- const CHAR *PrgHeader=
- "";
-
- const CHAR *PrgVerText=
- "$VER: 1.0 ("__DATE2__") (Copyright 1996 by proDAD) (Created by Holger Burkarth)";
-
-
-
- /*----------------------------------
- -----------------------------------*/
- #ifdef __cplusplus
- extern "C"
- #endif
-
- VOID main()
- {
- struct pOS_DosArgs* Args;
- UWORD Err=0;
- ULONG Ops[1]={0};
-
- Args=pOS_ReadDosArgs(
- // 0
- "",
- Ops,sizeof(Ops)/sizeof(ULONG),
-
- ARGTAG_PrgHeaderText, (ULONG)PrgHeader, /* kurze Programm-Beschreibung */
- ARGTAG_HelpText, (ULONG)HelpText, /* Help-Texte */
- ARGTAG_PrgVerText, (ULONG)PrgVerText, /* VER-String */
- TAG_END);
-
- if(Args) {
- const struct pOS_Process *const Proc=(struct pOS_Process*)pOS_FindTask(NULL);
- dosname_t Buffer[pOS_DosPathName_MAX];
-
- printf("Process=0x%lx ln_Pri=%ld ln_Name=%s\n",
- Proc,Proc->pr_Task.tc_Node.ln_Pri,Proc->pr_Task.tc_Node.ln_Name);
-
- if(Proc->pr_CurrentDir) {
- if(!pOS_NameFromObjectLock(Proc->pr_CurrentDir,Buffer,sizeof(Buffer)))
- Buffer[0]=0;
- printf("pr_CurrentDir=0x%lx Path=<%s>\n",Proc->pr_CurrentDir,Buffer);
- }
- else printf("pr_CurrentDir=NULL\n");
-
- if(Proc->pr_CIS) {
- printf("pr_CIS=0x%lx\n",Proc->pr_CIS);
- }
- else printf("pr_CIS=NULL\n");
-
- if(Proc->pr_COS) {
- printf("pr_COS=0x%lx\n",Proc->pr_COS);
- }
- else printf("pr_COS=NULL\n");
-
- if(Proc->pr_CES) {
- printf("pr_CES=0x%lx\n",Proc->pr_CES);
- }
- else printf("pr_CES=NULL\n");
-
- if(Proc->pr_ConsoleFH) {
- printf("pr_ConsoleFH=0x%lx\n",Proc->pr_ConsoleFH);
- }
- else printf("pr_CES=NULL\n");
-
- if(Proc->pr_ProgDirLock) {
- if(!pOS_NameFromObjectLock(Proc->pr_ProgDirLock,Buffer,sizeof(Buffer)))
- Buffer[0]=0;
- printf("pr_ProgDirLock=0x%lx Path=<%s>\n",Proc->pr_ProgDirLock,Buffer);
- }
- else printf("pr_ProgDirLock=NULL\n");
-
-
- printf("pr_TaskNum=%ld pr_HomeShell=0x%lx pr_ReqWindow=0x%lx\n",
- Proc->pr_TaskNum,Proc->pr_HomeShell,Proc->pr_ReqWindow);
-
-
- pOS_DeleteDosArgs(Args);
- }
- else Err=DOSFAIL_FAIL; /* vollkommen fehlgeschlagen */
-
- pOS_SetShellFail(Err);
- }
-