⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kill.c

📁 At can be given its arguments in a file. You can comment out lines by preceding them with either #
💻 C
字号:
/* =========================================================
*
*  KILL.C --- Kill a process.
*
*  Version 1.0
*
*  CALLED BY   :
*  CALLS       :
*
*  COPYRIGHT(c)   :  Martti Ylikoski
*/
static char *VERSION="Version  1.0. Copyright(c) Martti Ylikoski, 1992. " ;

/*
*  CREATED        :  21.3.1992
*  PROGRAMMER     :  Martti Ylikoski
*  LAST UPDATE    :
*
* ==========================================================*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define INCL_DOS
#include <os2.h>
#include <param.h>
#include <paramstd.h>
ParamEntry pentry[12] = {
     "P", &ParamSetPause, 0,
     "F", &ParamSetFold, 0,
     "V", &ParamSetVerbose, 1,
     "R", &ParamSetReport, 1,
     "S", &ParamSetSubDirs, 0,
     "?", &ParamSetHelp, 1,
     "H", &ParamSetHelp, 1,
     "NOD", &ParamSetNoDefault, 0,
     "TEST", &ParamSetTest, 0,
     "Y", &ParamSetYes, 0,
     "N", &ParamSetTest, 0,
     "\0", NULL, 0
} ;

ParamBlock params = {
    "/-",   IGNORECASE | NOPRIORITY | NOTRIGGERSALLOWED ,
    pentry
} ;

static char *progname ;
extern unsigned long pflags ; /* needed because of paramstd */

/* local prototypes */
static void usage( void ) ;
 
main( int argc, char *argv[] )
{
PID pid ;
USHORT ret ;
int i ;

   progname = argv[0] ;

   if (argc != 2)
   {
      usage() ;
      return( 1 ) ;

   }
   ParamHandle(&params, &argc, argv) ;

   if (pflags & PA_HELP)
   {
      usage() ;
      return( 0 ) ;
   }

   pid = (USHORT) atoi( argv[1] ) ;
   ret = DosKillProcess(DKP_PROCESS, pid) ;

   return( 0 ) ;
}

static void usage( void )
{

   fprintf(stderr,"KILL - Kill a process.\n") ;
   fprintf(stderr, VERSION) ;
   fprintf(stderr, "\nUsage: %s process_id \n", progname) ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -