34 using namespace basis;
40 int main(
int argc,
char *argv[])
47 "this takes a single parameter, which is the name of a program\n"
48 "to hunt down and eradicate. this will zap the program without\n"
49 "any warning or any chance for it to save its state.", ALWAYS_PRINT);
60 for (
int i = 0; i <
processes.length(); i++) {
64 if (base == program_name) {
71 + program_name +
astring(
"]"), ALWAYS_PRINT);
73 out.
log(
astring(astring::SPRINTF,
"Failed to zap process %d [",
80 out.
log(
astring(
"Could not find the program named ") + program_name, ALWAYS_PRINT);
81 if (!success)
return 123;
85 #ifdef __BUILD_STATIC_APPLICATION__
int entries() const
Returns the number of fields found on the command line.
filesystem::filename program_name() const
Returns the program name found in the command line.
const command_parameter & get(int field) const
Returns the parameter at the "field" specified.
const basis::astring & text() const
observes the string contents.
parameter_types type() const
observes the type of the parameter.
a_sprintf is a specialization of astring that provides printf style support.
Provides a dynamically resizable ASCII character string.
void to_lower()
to_lower modifies "this" by replacing capitals with lower-case.
Provides operations commonly needed on file names.
const basis::astring & raw() const
returns the astring that we're holding onto for the path.
filename basename() const
returns the base of the filename; no directory.
virtual basis::outcome log(const basis::base_string &info, int filter)
sends the string "info" to the standard output device.
Provides a bridge to the operating system for information on processes.
bool zap_process(basis::un_int to_zap)
preemptively zaps the process "to_zap".
bool query_processes(process_entry_array &to_fill)
finds the processes that are running and drops them into "to_fill".
a handy class that implements an array of process entries.
#define non_continuable_error(c, f, i)
an extra piece of information used, if available, in bounds_halt below.
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
A platform independent way to obtain the timestamp of a file.
A logger that sends to the console screen using the standard output device.
A dynamic container class that holds any kind of object via pointers.
Aids in achievement of platform independence.
int main(int argc, char *argv[])