void getselections(const char *const *argv) { struct pkg_array array; struct pkginfo *pkg; const char *thisarg; int i, found; modstatdb_init(admindir,msdbrw_readonly); pkg_array_init_from_db(&array); pkg_array_sort(&array, pkg_sorter_by_name); if (!*argv) { for (i = 0; i < array.n_pkgs; i++) { pkg = array.pkgs[i]; if (pkg->status == stat_notinstalled) continue; getsel1package(pkg); } } else { while ((thisarg= *argv++)) { found= 0; for (i = 0; i < array.n_pkgs; i++) { pkg = array.pkgs[i]; if (fnmatch(thisarg,pkg->name,0)) continue; getsel1package(pkg); found++; } if (!found) fprintf(stderr,_("No packages found matching %s.\n"),thisarg); } } m_output(stdout, _("<standard output>")); m_output(stderr, _("<standard error>")); pkg_array_destroy(&array); }
int getselections(const char *const *argv) { struct pkg_array array; struct pkginfo *pkg; const char *thisarg; int i, found; modstatdb_open(msdbrw_readonly); pkg_array_init_from_db(&array); pkg_array_sort(&array, pkg_sorter_by_nonambig_name_arch); if (!*argv) { for (i = 0; i < array.n_pkgs; i++) { pkg = array.pkgs[i]; if (pkg->status == PKG_STAT_NOTINSTALLED) continue; getsel1package(pkg); } } else { while ((thisarg= *argv++)) { struct pkg_spec pkgspec; found= 0; pkg_spec_init(&pkgspec, PKG_SPEC_PATTERNS | PKG_SPEC_ARCH_WILDCARD); pkg_spec_parse(&pkgspec, thisarg); for (i = 0; i < array.n_pkgs; i++) { pkg = array.pkgs[i]; if (!pkg_spec_match_pkg(&pkgspec, pkg, &pkg->installed)) continue; getsel1package(pkg); found++; } if (!found) notice(_("no packages found matching %s"), thisarg); pkg_spec_destroy(&pkgspec); } } m_output(stdout, _("<standard output>")); m_output(stderr, _("<standard error>")); pkg_array_destroy(&array); return 0; }
static void DPKG_ATTR_NORET usage(const struct cmdinfo *cip, const char *value) { printf(_( "Usage: %s [<option> ...] <command>\n" "\n"), dpkg_get_progname()); printf(_( "Commands:\n" " --add <owner> <group> <mode> <path>\n" " add a new <path> entry into the database.\n" " --remove <path> remove <path> from the database.\n" " --list [<glob-pattern>] list current overrides in the database.\n" "\n")); printf(_( "Options:\n" " --admindir <directory> set the directory with the statoverride file.\n" " --update immediately update <path> permissions.\n" " --force force an action even if a sanity check fails.\n" " --quiet quiet operation, minimal output.\n" " --help show this help message.\n" " --version show the version.\n" "\n")); m_output(stdout, _("<standard output>")); exit(0); }
bool VaapiDecoderH265::DPB::output(const PicturePtr& picture) { picture->m_picOutputFlag = false; // ERROR("DPB: output picture(Poc:%d)", picture->m_poc); return m_output(picture) == DECODE_SUCCESS; }
static void setdebug(const struct cmdinfo *cpi, const char *value) { char *endp; if (*value == 'h') { printf(_( "%s debugging option, --debug=<octal> or -D<octal>:\n" "\n" " number ref. in source description\n" " 1 general Generally helpful progress information\n" " 2 scripts Invocation and status of maintainer scripts\n" " 10 eachfile Output for each file processed\n" " 100 eachfiledetail Lots of output for each file processed\n" " 20 conff Output for each configuration file\n" " 200 conffdetail Lots of output for each configuration file\n" " 40 depcon Dependencies and conflicts\n" " 400 depcondetail Lots of dependencies/conflicts output\n" " 10000 triggers Trigger activation and processing\n" " 20000 triggersdetail Lots of output regarding triggers\n" " 40000 triggersstupid Silly amounts of output regarding triggers\n" " 1000 veryverbose Lots of drivel about eg the dpkg/info directory\n" " 2000 stupidlyverbose Insane amounts of drivel\n" "\n" "Debugging options are be mixed using bitwise-or.\n" "Note that the meanings and values are subject to change.\n"), DPKG); m_output(stdout, _("<standard output>")); exit(0); } f_debug= strtoul(value,&endp,8); if (value == endp || *endp) badusage(_("--debug requires an octal argument")); }
Vamp::Plugin::FeatureSet VampPlugin::process(const float *const *inputBuffers, Vamp::RealTime) { Vamp::Plugin::FeatureSet feature_set; Vamp::Plugin::FeatureList feature_list; for(mrs_natural c = 0; c < (mrs_natural) m_channels; ++c) { for(mrs_natural s = 0; s < (mrs_natural) m_block_size; ++s) { m_input(c,s) = inputBuffers[c][s]; } } m_system->process(m_input, m_output); for(mrs_natural s = 0; s < m_output.getCols(); ++s) { Feature features; for(mrs_natural o = 0; o < m_output.getRows(); ++o) { features.values.push_back( (float) m_output(o,s) ); } feature_list.push_back(features); } feature_set[0] = feature_list; return feature_set; }
static void set_debug(const struct cmdinfo *cpi, const char *value) { char *endp; long mask; const struct debuginfo *dip; if (*value == 'h') { printf(_( "%s debugging option, --debug=<octal> or -D<octal>:\n" "\n" " Number Ref. in source Description\n"), DPKG); for (dip = debuginfos; dip->name; dip++) printf(" %6o %-16s %s\n", dip->flag, dip->name, gettext(dip->desc)); printf(_("\n" "Debugging options can be mixed using bitwise-or.\n" "Note that the meanings and values are subject to change.\n")); m_output(stdout, _("<standard output>")); exit(0); } errno = 0; mask = strtol(value, &endp, 8); if (value == endp || *endp || mask < 0 || errno == ERANGE) badusage(_("--%s requires a positive octal argument"), cpi->olong); debug_set_mask(mask); }
int do_info(const char *const *argv) { const char *thisarg; struct partinfo *pi, ps; struct dpkg_ar *part; if (!*argv) badusage(_("--%s requires one or more part file arguments"), cipaction->olong); while ((thisarg= *argv++)) { part = dpkg_ar_open(thisarg); if (!part) ohshite(_("cannot open archive part file '%.250s'"), thisarg); pi = read_info(part, &ps); dpkg_ar_close(part); if (pi) { print_info(pi); } else { printf(_("file '%s' is not an archive part\n"), thisarg); } m_output(stdout, _("<standard output>")); } return 0; }
static void DPKG_ATTR_NORET usage(const struct cmdinfo *ci, const char *value) { printf(_( "Usage: %s [<options> ...] <trigger-name>\n" " %s [<options> ...] <command>\n" "\n"), dpkg_get_progname(), dpkg_get_progname()); printf(_( "Commands:\n" " --check-supported Check if the running dpkg supports triggers.\n" "\n")); printf(_( " -?, --help Show this help message.\n" " --version Show the version.\n" "\n")); printf(_( "Options:\n" " --admindir=<directory> Use <directory> instead of %s.\n" " --by-package=<package> Override trigger awaiter (normally set\n" " by dpkg).\n" " --await Package needs to await the processing.\n" " --no-await No package needs to await the processing.\n" " --no-act Just test - don't actually change anything.\n" "\n"), ADMINDIR); m_output(stdout, _("<standard output>")); exit(0); }
void parse_force(const char *value, bool set) { const char *comma; size_t l; const struct forceinfo *fip; if (strcmp(value, "help") == 0) { printf(_( "%s forcing options - control behaviour when problems found:\n" " warn but continue: --force-<thing>,<thing>,...\n" " stop with error: --refuse-<thing>,<thing>,... | --no-force-<thing>,...\n" " Forcing things:\n"), dpkg_get_progname()); for (fip = forceinfos; fip->name; fip++) if ((enum force_flags)fip->flag == FORCE_ALL || (fip->flag & force_mask) == fip->flag) print_forceinfo(fip); printf(_( "\n" "WARNING - use of options marked [!] can seriously damage your installation.\n" "Forcing options marked [*] are enabled by default.\n")); m_output(stdout, _("<standard output>")); printf(_( "\n" "Currently enabled options:\n" " %s\n"), get_force_string()); exit(0); } for (;;) { comma = strchrnul(value, ','); l = (size_t)(comma - value); for (fip = forceinfos; fip->name; fip++) if (strncmp(fip->name, value, l) == 0 && strlen(fip->name) == l) break; if (!fip->name) { badusage(_("unknown force/refuse option '%.*s'"), (int)min(l, 250), value); } else if (fip->flag) { if (set) set_force(fip->flag); else reset_force(fip->flag); } else { warning(_("obsolete force/refuse option '%s'"), fip->name); } if (*comma == '\0') break; value = ++comma; } }
void printarch(const char *const *argv) { if (*argv) badusage(_("--%s takes no arguments"), cipaction->olong); printf("%s\n", architecture); m_output(stdout, _("<standard output>")); }
void do_queue(const char *const *argv) { struct partqueue *pq, *qq; struct partinfo ti; const char *head; struct stat stab; unsigned long bytes; unsigned int i; if (*argv) badusage(_("--%s takes no arguments"), cipaction->olong); scandepot(); head= N_("Junk files left around in the depot directory:\n"); for (pq= queue; pq; pq= pq->nextinqueue) { if (pq->info.md5sum) continue; fputs(gettext(head),stdout); head= ""; if (lstat(pq->info.filename,&stab)) ohshit(_("unable to stat `%.250s'"),pq->info.filename); if (S_ISREG(stab.st_mode)) { bytes= stab.st_size; printf(_(" %s (%lu bytes)\n"),pq->info.filename,bytes); } else { printf(_(" %s (not a plain file)\n"),pq->info.filename); } } if (!*head) putchar('\n'); head= N_("Packages not yet reassembled:\n"); for (pq= queue; pq; pq= pq->nextinqueue) { if (!pq->info.md5sum) continue; mustgetpartinfo(pq->info.filename,&ti); fputs(gettext(head),stdout); head= ""; printf(_(" Package %s: part(s) "), ti.package); bytes= 0; for (i=0; i<ti.maxpartn; i++) { for (qq= pq; qq && !(partmatches(&qq->info,&ti) && qq->info.thispartn == i+1); qq= qq->nextinqueue); if (qq) { printf("%d ",i+1); if (lstat(qq->info.filename,&stab)) ohshite(_("unable to stat `%.250s'"),qq->info.filename); if (!S_ISREG(stab.st_mode)) ohshit(_("part file `%.250s' is not a plain file"),qq->info.filename); bytes+= stab.st_size; /* Don't find this package again. */ qq->info.md5sum = NULL; } } printf(_("(total %lu bytes)\n"),bytes); } m_output(stdout, _("<standard output>")); }
static void info_field(const char *debar, const char *directory, const char *const *fields, bool showfieldname) { FILE *cc; char fieldname[MAXFIELDNAME+1]; char *pf; const char *const *fp; int c, lno, fnl; bool doing; if (!(cc= fopen("control","r"))) ohshite(_("could not open the `control' component")); doing = true; lno = 1; for (;;) { c = getc(cc); if (c == EOF) { doing = false; break; } if (c == '\n') { lno++; doing = true; continue; } if (!isspace(c)) { for (pf=fieldname, fnl=0; fnl <= MAXFIELDNAME && c!=EOF && !isspace(c) && c!=':'; c= getc(cc)) { *pf++= c; fnl++; } *pf = '\0'; doing= fnl >= MAXFIELDNAME || c=='\n' || c==EOF; for (fp=fields; !doing && *fp; fp++) if (!strcasecmp(*fp, fieldname)) doing = true; if (showfieldname) { if (doing) fputs(fieldname,stdout); } else { if (c==':') c= getc(cc); while (c != '\n' && isspace(c)) c= getc(cc); } } for(;;) { if (c == EOF) break; if (doing) putc(c,stdout); if (c == '\n') { lno++; break; } c= getc(cc); } if (c == EOF) break; } if (ferror(cc)) ohshite(_("failed during read of `control' component")); if (fclose(cc)) ohshite(_("error closing the '%s' component"), "control"); if (doing) putc('\n',stdout); m_output(stdout, _("<standard output>")); }
void PacketProbe::SetValue (Ptr<const Packet> packet) { NS_LOG_FUNCTION (this << packet); m_packet = packet; m_output (packet); uint32_t packetSizeNew = packet->GetSize (); m_outputBytes (m_packetSizeOld, packetSizeNew); m_packetSizeOld = packetSizeNew; }
void TimingCovertChannel::startTimeoutTimer() { // wait until timeout point, repeat if timeout was changed during sleep while (m_timeout_changed) { m_timeout_changed = false; this_thread::sleep_until(m_timeout_end); } // all packets received (timed out) m_receiving = false; string message = m_coder->decodeMessage(m_received_delays); m_received_delays.clear(); m_output(message); }
void PacketLengthCovertChannel::receivePacket(GenericPacket& packet){ UdpPacket udp_packet; udp_packet.setPacket(packet.packet()); unsigned int length = udp_packet.length(); if (m_packetcount == -1){ if (length == 8 + m_baselength){ m_output(""); return; } m_packetcount = length - 8 - m_baselength; } else { m_packetlengths.push_back(length); m_received++; } if (m_received == m_packetcount){ m_output(m_coder->decodeMessage(m_packetlengths)); m_received = 0; m_packetcount = -1; } }
int printarch(const char *const *argv) { if (*argv) badusage(_("--%s takes no arguments"), cipaction->olong); printf("%s\n", dpkg_arch_get(DPKG_ARCH_NATIVE)->name); m_output(stdout, _("<standard output>")); return 0; }
AxisController::AxisController() { Servo m_axisServo; m_pinNum = DEFAULT_PIN_NUM; SoftwareSerial m_output(DEFAULT_RX_PIN, DEFAULT_TX_PIN); m_outMin = DEFAULT_OUTMIN; m_outMax = DEFAULT_OUTMAX; m_axisServo.attach(m_pinNum); m_output.begin(9600); calibrate(MAX_SAMPLES); }
static void DPKG_ATTR_NORET printversion(const struct cmdinfo *cip, const char *value) { printf(_("Debian `%s' package archive backend version %s.\n"), BACKEND, DPKG_VERSION_ARCH); printf(_( "This is free software; see the GNU General Public License version 2 or\n" "later for copying conditions. There is NO warranty.\n")); m_output(stdout, _("<standard output>")); exit(0); }
static void DPKG_ATTR_NORET printversion(const struct cmdinfo *ci, const char *value) { printf(_("Debian '%s' package management program version %s.\n"), DPKG, PACKAGE_RELEASE); printf(_( "This is free software; see the GNU General Public License version 2 or\n" "later for copying conditions. There is NO warranty.\n")); m_output(stdout, _("<standard output>")); exit(0); }
void PacketProbe::TraceSink (Ptr<const Packet> packet) { NS_LOG_FUNCTION (this << packet); if (IsEnabled ()) { m_packet = packet; m_output (packet); uint32_t packetSizeNew = packet->GetSize (); m_outputBytes (m_packetSizeOld, packetSizeNew); m_packetSizeOld = packetSizeNew; } }
static void DPKG_ATTR_NORET printversion(const struct cmdinfo *ci, const char *value) { printf(_("Debian %s package trigger utility version %s.\n"), dpkg_get_progname(), DPKG_VERSION_ARCH); printf(_( "This is free software; see the GNU General Public License version 2 or\n" "later for copying conditions. There is NO warranty.\n")); m_output(stdout, _("<standard output>")); exit(0); }
AxisController::AxisController(Servo axisServo, int pinNum, SoftwareSerial output, int outMin=0, int outMax=179) { m_axisServo = axisServo; m_pinNum = pinNum; SoftwareSerial m_output(DEFAULT_RX_PIN, DEFAULT_TX_PIN); m_outMin = outMin; m_outMax = outMax; m_axisServo.attach(m_pinNum); m_output.begin(9600); calibrate(MAX_SAMPLES); }
void static naive_scan_addition_cpu(oclMat& input, oclMat& output) { Mat m_input = input, m_output(output.size(), output.type()); MatIterator_<int> i_mit = m_input.begin<int>(); MatIterator_<int> o_mit = m_output.begin<int>(); *o_mit = 0; ++i_mit; ++o_mit; for(; i_mit != m_input.end<int>(); ++i_mit, ++o_mit) { *o_mit = *(o_mit - 1) + *(i_mit - 1); } output = m_output; }
static void printversion(const struct cmdinfo *cip, const char *value) { printf(_("Debian %s version %s.\n"), dpkg_get_progname(), PACKAGE_RELEASE); printf(_( "This is free software; see the GNU General Public License version 2 or\n" "later for copying conditions. There is NO warranty.\n")); m_output(stdout, _("<standard output>")); exit(0); }
static void set_force(const struct cmdinfo *cip, const char *value) { const char *comma; size_t l; const struct forceinfo *fip; if (strcmp(value, "help") == 0) { printf(_( "%s forcing options - control behaviour when problems found:\n" " warn but continue: --force-<thing>,<thing>,...\n" " stop with error: --refuse-<thing>,<thing>,... | --no-force-<thing>,...\n" " Forcing things:\n"), DPKG); for (fip = forceinfos; fip->name; fip++) print_forceinfo(fip); printf(_( "\n" "WARNING - use of options marked [!] can seriously damage your installation.\n" "Forcing options marked [*] are enabled by default.\n")); m_output(stdout, _("<standard output>")); exit(0); } for (;;) { comma= strchr(value,','); l = comma ? (size_t)(comma - value) : strlen(value); for (fip=forceinfos; fip->name; fip++) if (strncmp(fip->name, value, l) == 0 && strlen(fip->name) == l) break; if (!fip->name) { badusage(_("unknown force/refuse option '%.*s'"), (int)min(l, 250), value); } else if (strcmp(fip->name, "all") == 0) { for (fip = forceinfos; fip->name; fip++) if (fip->opt) *fip->opt = cip->arg_int; } else if (fip->opt) { *fip->opt = cip->arg_int; } else { warning(_("obsolete force/refuse option '%s'"), fip->name); } if (!comma) break; value= ++comma; } }
int audit(const char *const *argv) { const struct audit_problem *problem; struct pkg_array array; bool head_running = false; int i; modstatdb_open(msdbrw_readonly); if (!*argv) pkg_array_init_from_db(&array); else pkg_array_init_from_names(&array, pkg_array_mapper, (const char **)argv); pkg_array_sort(&array, pkg_sorter_by_nonambig_name_arch); for (problem = audit_problems; problem->check; problem++) { bool head = false; for (i = 0; i < array.n_pkgs; i++) { struct pkginfo *pkg = array.pkgs[i]; if (!problem->check(pkg, problem)) continue; if (!head_running) { if (modstatdb_is_locked()) puts(_( "Another process has locked the database for writing, and might currently be\n" "modifying it, some of the following problems might just be due to that.\n")); head_running = true; } if (!head) { fputs(gettext(problem->explanation), stdout); head = true; } describebriefly(pkg); } if (head) putchar('\n'); } pkg_array_destroy(&array); m_output(stdout, _("<standard output>")); return 0; }
void TestRunner::it(string name, TestRunner::Function testCase) { if (m_isInsideTestCase) { m_logger.write().stream() << "Syntax error - unexpected \"it\""; return; } m_isInsideTestCase = true; m_logger.clear(); m_callStack.emplace_back(std::move(name)); testCase(); auto messages = m_logger.content(); if (!messages.empty()) m_output(m_callStack, messages); m_callStack.pop_back(); m_isInsideTestCase = false; }
int audit(const char *const *argv) { const struct badstatinfo *bsi; bool head_running = false; enum modstatdb_rw msdb_status; if (*argv) badusage(_("--%s takes no arguments"), cipaction->olong); msdb_status = modstatdb_open(msdbrw_readonly); pkg_infodb_init(msdb_status); for (bsi= badstatinfos; bsi->yesno; bsi++) { struct pkgiterator *it; struct pkginfo *pkg; bool head = false; it = pkg_db_iter_new(); while ((pkg = pkg_db_iter_next_pkg(it))) { if (!bsi->yesno(pkg,bsi)) continue; if (!head_running) { if (modstatdb_is_locked()) puts(_( "Another process has locked the database for writing, and might currently be\n" "modifying it, some of the following problems might just be due to that.\n")); head_running = true; } if (!head) { fputs(gettext(bsi->explanation),stdout); head = true; } describebriefly(pkg); } pkg_db_iter_free(it); if (head) putchar('\n'); } m_output(stdout, _("<standard output>")); return 0; }
static void usage(const struct cmdinfo *cip, const char *value) { printf(_( "Usage: %s [<option> ...] <command>\n" "\n"), dpkg_get_progname()); printf(_( "Commands:\n" " [--add] <file> add a diversion.\n" " --remove <file> remove the diversion.\n" " --list [<glob-pattern>] show file diversions.\n" " --listpackage <file> show what package diverts the file.\n" " --truename <file> return the diverted file.\n" "\n")); printf(_( "Options:\n" " --package <package> name of the package whose copy of <file> will not\n" " be diverted.\n" " --local all packages' versions are diverted.\n" " --divert <divert-to> the name used by other packages' versions.\n" " --rename actually move the file aside (or back).\n" " --no-rename do not move the file aside (or back) (default).\n" " --admindir <directory> set the directory with the diversions file.\n" " --instdir <directory> set the root directory, but not the admin dir.\n" " --root <directory> set the directory of the root filesystem.\n" " --test don't do anything, just demonstrate.\n" " --quiet quiet operation, minimal output.\n" " --help show this help message.\n" " --version show the version.\n" "\n")); printf(_( "When adding, default is --local and --divert <original>.distrib.\n" "When removing, --package or --local and --divert must match if specified.\n" "Package preinst/postrm scripts should always specify --package and --divert.\n")); m_output(stdout, _("<standard output>")); exit(0); }