MCPcopy Create free account
hub / github.com/DFHack/dfhack / getJobItem

Function getJobItem

plugins/jobutils.cpp:278–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276/* Main job command implementation */
277
278static df::job_item *getJobItem(color_ostream &out, df::job *job, std::string idx)
279{
280 if (!job)
281 return NULL;
282
283 int v = atoi(idx.c_str());
284 if (v < 1 || size_t(v) > job->job_items.elements.size()) {
285 out.printerr("Invalid item index.\n");
286 return NULL;
287 }
288
289 return job->job_items.elements[v-1];
290}
291
292static command_result job_cmd(color_ostream &out, vector <string> & parameters)
293{

Callers 1

job_cmdFunction · 0.85

Calls 2

c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected