本文整理汇总了C++中pprintf函数的典型用法代码示例。如果您正苦于以下问题:C++ pprintf函数的具体用法?C++ pprintf怎么用?C++ pprintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pprintf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pprintf
void IFFT::help() {
pprintf("-ifft performs an inverse dft on the current image, whose values are"
" complex. The input and output are images with 2*c channels, where"
" channel 2*i is the real part of the i\'th channel, and channel 2*i+1"
" is the imaginary part of the i'th channel.\n"
"\n"
"Usage: ImageStack -load a.tga -fftcomplex -save freq.tga\n\n");
}
开发者ID:mit-gfx,项目名称:ImageStack,代码行数:8,代码来源:DFT.cpp
示例2: lcd_printf
// added 28/01/2011 [email protected]
void lcd_printf(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
pprintf(lcd_write, fmt, args);
va_end(args);
}
开发者ID:jimgregory,项目名称:pinguino-libraries,代码行数:9,代码来源:lcdlib.c
示例3: decl
void decl(void) {
char decl_type[MAXTOKEN];
decl_type[0] = '\0';
gettoken();
type(decl_type);
dcl();
pprintf("%s\n", decl_type);
}
开发者ID:ytlvy,项目名称:codinghighway,代码行数:8,代码来源:dclparser2.c
示例4: com_asetemail
/*
* asetemail
*
* Usage: asetemail player [address]
*
* Sets the email address of the player to the address given. If the
* address is omited, then the player's email address is cleared. The
* person's email address is revealed to them when they use the "finger"
* command, but no other users -- except admins -- will have another
* player's email address displayed.
*/
int com_asetemail(int p, param_list param)
{
struct player *pp = &player_globals.parray[p];
int p1, connected;
char *oldemail;
if (!FindPlayer(p, param[0].val.word, &p1, &connected))
return COM_OK;
if (!check_admin2(p, p1)) {
pprintf(p, "You can only set email addr for players below your adminlevel.\n");
if (!connected)
player_remove(p1);
return COM_OK;
}
if (player_globals.parray[p1].emailAddress) {
oldemail = strdup(player_globals.parray[p1].emailAddress);
free(player_globals.parray[p1].emailAddress);
} else {
oldemail = strdup("");
}
if (param[1].type == TYPE_NULL) {
player_globals.parray[p1].emailAddress = NULL;
pprintf(p, "Email address for %s removed\n", player_globals.parray[p1].name);
pcommand(p, "addcomment %s Email address removed.\n", player_globals.parray[p1].name);
} else {
player_globals.parray[p1].emailAddress = strdup(param[1].val.word);
pprintf(p, "Email address of %s changed to \"%s\".\n", player_globals.parray[p1].name, param[1].val.word);
pcommand(p, "addcomment %s Email address changed from %s to %s.\n", player_globals.parray[p1].name, oldemail, player_globals.parray[p1].emailAddress);
}
free(oldemail);
player_save(p1);
if (connected) {
if (param[1].type == TYPE_NULL) {
pprintf_prompt(p1, "\n\n%s has removed your email address.\n\n", pp->name);
} else {
pprintf_prompt(p1, "\n\n%s has changed your email address.\n\n", pp->name);
}
} else {
player_remove(p1);
}
return COM_OK;
}
开发者ID:SKAcz,项目名称:bics-current,代码行数:56,代码来源:adminproc.c
示例5: init_linemon
static int
init_linemon(
queue_t *q
)
{
register queue_t *dq;
dq = WR(q);
/*
* we ARE doing very bad things down here (basically stealing ISR
* hooks)
*
* so we chase down the STREAMS stack searching for the driver
* and if this is a known driver we insert our ISR routine for
* status changes in to the ExternalStatus handling hook
*/
while (dq->q_next)
{
dq = dq->q_next; /* skip down to driver */
}
/*
* find appropriate driver dependent routine
*/
if (dq->q_qinfo && dq->q_qinfo->qi_minfo)
{
register char *dname = dq->q_qinfo->qi_minfo->mi_idname;
pprintf(DD_INSTALL, "init_linemon: driver is \"%s\"\n", dname);
#ifdef sun
if (dname && !strcmp(dname, "zs"))
{
return init_zs_linemon(dq, q);
}
else
#endif
{
pprintf(DD_INSTALL, "init_linemon: driver \"%s\" not suitable for CD monitoring\n", dname);
return 0;
}
}
pprintf(DD_INSTALL, "init_linemon: cannot find driver\n");
return 0;
}
开发者ID:kangaroo,项目名称:freebsd,代码行数:45,代码来源:parsesolaris.c
示例6: com_asetbug
/*
* asetbug
*
* Usage: asetbug handle rating won lost drew RD
*
* This command allows admins to set a user's statistics for Bughouse
* games. The parameters are self-explanatory: rating, # of wins,
* # of losses, # of draws, and ratings deviation.
*/
int com_asetbug(int p, param_list param)
{
int p1, connected;
if (!FindPlayer(p, param[0].val.word, &p1, &connected))
return COM_OK;
if (CheckPFlag(p1, PFLAG_REG)) {
SetRating(p1, param, &player_globals.parray[p1].bug_stats);
player_save(p1);
pprintf(p, "Bughouse rating for %s modified.\n", player_globals.parray[p1].name);
} else
pprintf(p, "%s is unregistered. Can't modify rating.\n", player_globals.parray[p1].name);
if (!connected)
player_remove(p1);
return COM_OK;
}
开发者ID:SKAcz,项目名称:bics-current,代码行数:27,代码来源:adminproc.c
示例7: netif_proc
static int netif_proc(struct proc_file *pf, void *arg) {
struct netif *netif;
for (netif = netif_list; netif != NULL; netif = netif->next) {
pprintf(pf, "%s: addr %a mask %a gw %a\n", netif->name, &netif->ipaddr, &netif->netmask, &netif->gw);
}
return 0;
}
开发者ID:HarryR,项目名称:sanos,代码行数:9,代码来源:netif.c
示例8: pprintf
void DimensionReduction::help() {
pprintf("-dimensionreduction takes a dimensionality and projects all points on"
" the image onto a linear subspace of best fit with that number of"
" dimensions. It is useful if you know an image should be low"
" dimensional (eg a sunset is mostly shades or red), and components"
" orthogonal to that dimension are unwanted (eg chromatic"
" abberation).\n\n"
"Usage: ImageStack -load sunset.jpg -dimensionreduction 2 -save fixed.jpg\n\n");
}
开发者ID:CommonLibrary,项目名称:ImageStack,代码行数:9,代码来源:Statistics.cpp
示例9: sys_converged
static int sys_converged (equation_system *sys, double *llbak,
gretlopt opt, PRN *prn, int *err)
{
double crit, tol = 0.0;
int met = 0;
if (sys->method == SYS_METHOD_SUR ||
sys->method == SYS_METHOD_WLS) {
double ll = sur_loglik(sys);
tol = SYS_LL_TOL;
crit = ll - *llbak;
if (opt & OPT_V) {
pprintf(prn, "Iteration %3d, ll = %#.8g\n", sys->iters, ll);
}
if (crit <= tol) {
met = 1;
} else if (sys->iters < SYS_MAX_ITER) {
*llbak = ll;
}
} else if (sys->method == SYS_METHOD_3SLS) {
tol = SYS_BDIFF_TOL;
crit = sys->bdiff;
if (opt & OPT_V) {
pprintf(prn, "Iteration %3d, criterion = %g\n", sys->iters, crit);
}
if (crit <= tol) {
met = 1;
}
}
if (met && tol > 0 && (opt & OPT_V)) {
pprintf(prn, "Tolerance of %g is met\n", tol);
}
if (!met && sys->iters >= SYS_MAX_ITER) {
pprintf(prn, "Reached %d iterations without meeting "
"tolerance of %g\n", sys->iters, tol);
*err = E_NOCONV;
}
return met;
}
开发者ID:HelioGuilherme66,项目名称:gretl,代码行数:44,代码来源:sysest.c
示例10: function_noargs_error
static void function_noargs_error (const char *s, parser *p)
{
parser_print_input(p);
pprintf(p->prn, _("'%s': no argument was given"), s);
pputc(p->prn, '\n');
gretl_errmsg_sprintf(_("'%s': no argument was given"), s);
p->err = E_ARGS;
}
开发者ID:agaurav,项目名称:QT-GRETL,代码行数:10,代码来源:genlex.c
示例11: gretl_array_print
int gretl_array_print (gretl_array *A, PRN *prn)
{
if (A != NULL) {
const char *s = gretl_type_get_name(A->type);
pprintf(prn, _("Array of %s, length %d\n"), s, A->n);
}
return 0;
}
开发者ID:aylusltd,项目名称:gretl,代码行数:10,代码来源:gretl_array.c
示例12: pprintf
void ComplexDivide::help() {
pprintf("-complexdivide divides the top image in the stack by the second image"
" in the stack, using 2 \"complex\" images as its input - a \"complex\""
" image is one where channel 2*n is the real part of the nth channel and"
" channel 2*n + 1 is the imaginary part of the nth channel. Using zero"
" arguments results in a straight division (a + bi) / (c + di). Using"
" one argument results in a conjugate division (a - bi) / (c + di).\n"
"\n"
"Usage: ImageStack -load a.tga -load b.tga -complexdivide -save out.tga.\n");
}
开发者ID:bayanbatn,项目名称:cs478assignment2,代码行数:10,代码来源:Complex.cpp
示例13: pprintf
void FFTConvolve::help() {
pprintf("-fftconvolve performs convolution in Fourier space. It is much faster"
" than -convolve for large kernels. The two arguments are the boundary"
" condition (zero, clamp, wrap, homogeneous) and the vector-vector"
" multiplication used (inner, outer, elementwise). The defaults are wrap"
" and outer respectively. See -convolve for a description of each"
" option.\n"
"\n"
"Usage: ImageStack -load filter.tmp -load im.jpg -fftconvolve zero inner\n");
}
开发者ID:CommonLibrary,项目名称:ImageStack,代码行数:10,代码来源:DFT.cpp
示例14: pprintf
void GPSSensorWriter::Write(Print *p) {
float lat;
float lon;
unsigned long age;
gps_->f_get_position(&lat, &lon, &age);
char buf[16]; // No %f in sprintf? What the fuck.
char buf2[16];
pprintf(p, "GPS: LAT: %s, LON: %s AGE: %lu\n", strf(buf, lat), strf(buf2, lon), age);
}
开发者ID:rehuffman,项目名称:TeensyLaunchPayload,代码行数:10,代码来源:serial_util.cpp
示例15: pprintf
void Poisson::help() {
pprintf("-poisson assumes the stack contains gradients images in x and y, and"
" attempts to find the image which fits those gradients best in a least"
" squares sense. It uses a preconditioned conjugate gradient descent"
" method. It takes one argument, which is required RMS error of the"
" result. This defaults to 0.01 if not given.\n"
"\n"
"Usage: ImageStack -load dx.tmp dy.tmp \n"
" -poisson 0.0001 -save out.tga\n\n");
}
开发者ID:daviddoria,项目名称:PatchMatchImageStack,代码行数:10,代码来源:Calculus.cpp
示例16: devices_proc
static int devices_proc(struct proc_file *pf, void *arg) {
dev_t devno;
struct dev *dev;
pprintf(pf, "devno name driver type unit\n");
pprintf(pf, "----- -------- ---------------- ------ ------------------------------\n");
for (devno = 0; devno < num_devs; devno++) {
dev = devtab[devno];
pprintf(pf, "%5d %-8s %-16s %-6s ", devno, dev->name, dev->driver->name, devtypenames[dev->driver->type]);
if (dev->unit) {
pprintf(pf, "%s unit %d.%d\n", busnames[dev->unit->bus->bustype], dev->unit->bus->busno, dev->unit->unitno);
} else {
pprintf(pf, "<none>\n");
}
}
return 0;
}
开发者ID:HarryR,项目名称:sanos,代码行数:19,代码来源:dev.c
示例17: com_asethandle
/*
* asethandle
*
* Usage: asethandle oldname newname
*
* This command changes the handle of the player from oldname to
* newname. The various player information, messages, logins, comments
* and games should be automatically transferred to the new account.
*/
int com_asethandle(int p, param_list param)
{
char *player = param[0].val.word;
char *newplayer = param[1].val.word;
char playerlower[MAX_LOGIN_NAME], newplayerlower[MAX_LOGIN_NAME];
int p1;
strcpy(playerlower, player);
stolower(playerlower);
strcpy(newplayerlower, newplayer);
stolower(newplayerlower);
if (player_find_bylogin(playerlower) >= 0) {
pprintf(p, "A player by that name is logged in.\n");
return COM_OK;
}
if (player_find_bylogin(newplayerlower) >= 0) {
pprintf(p, "A player by that new name is logged in.\n");
return COM_OK;
}
p1 = player_new();
if (player_read(p1, playerlower)) {
pprintf(p, "No player by the name %s is registered.\n", player);
player_remove(p1);
return COM_OK;
} else {
if (!check_admin2(p, p1)) {
pprintf(p, "You can't set handles for an admin with a level higher than or equal to yourself.\n");
player_remove(p1);
return COM_OK;
}
}
player_remove(p1);
p1 = player_new();
if ((!player_read(p1, newplayerlower)) && (strcmp(playerlower, newplayerlower))) {
pprintf(p, "Sorry that handle is already taken.\n");
player_remove(p1);
return COM_OK;
}
player_remove(p1);
if ((!player_rename(playerlower, newplayerlower)) && (!player_read(p1, newplayerlower))) {
pprintf(p, "Player %s renamed to %s.\n", player, newplayer);
free(player_globals.parray[p1].name);
player_globals.parray[p1].name = strdup(newplayer);
player_save(p1);
/*if (player_globals.parray[p1].s_stats.rating > 0)
UpdateRank(TYPE_STAND, newplayer, &player_globals.parray[p1].s_stats, player);
if (player_globals.parray[p1].z_stats.rating > 0)
UpdateRank(TYPE_CRAZYHOUSE, newplayer, &player_globals.parray[p1].z_stats, player);
if (player_globals.parray[p1].w_stats.rating > 0)
UpdateRank(TYPE_WILD, newplayer, &player_globals.parray[p1].w_stats, player);*/
} else {
pprintf(p, "Asethandle failed.\n");
}
player_remove(p1);
return COM_OK;
}
开发者ID:SKAcz,项目名称:bics-current,代码行数:67,代码来源:adminproc.c
示例18: com_areload
/*
force a server reload
*/
int com_areload(int p, param_list param)
{
extern unsigned chessd_reload_flag;
chessd_reload_flag = 1;
pprintf(p, "Server reload started\n");
return COM_OK;
}
开发者ID:SKAcz,项目名称:bics-current,代码行数:13,代码来源:adminproc.c
示例19: output_json_node_value
static int output_json_node_value (JsonNode *node,
PRN *prn)
{
GType type = 0;
int err = 0;
if (null_node(node)) {
gretl_errmsg_set("jsonget: got a null node");
return E_DATA;
}
type = json_node_get_value_type(node);
#if 0
fprintf(stderr, "jsonget: node type %s\n", g_type_name(type));
#endif
if (!handled_type(type)) {
gretl_errmsg_sprintf("jsonget: unhandled object type '%s'",
g_type_name(type));
err = E_DATA;
} else if (type == G_TYPE_STRING) {
const gchar *s = json_node_get_string(node);
if (s != NULL) {
pputs(prn, s);
} else {
err = E_DATA;
}
} else if (type == G_TYPE_DOUBLE) {
double x = json_node_get_double(node);
pprintf(prn, "%.15g", x);
} else {
gint64 k = json_node_get_int(node);
double x = (double) k;
pprintf(prn, "%.15g", x);
}
return err;
}
开发者ID:HelioGuilherme66,项目名称:gretl,代码行数:42,代码来源:json_get.c
示例20: com_asetadmin
/*
* asetadmin
*
* Usage: asetadmin player AdminLevel
*
* Sets the admin level of the player with the following restrictions.
* 1. You can only set the admin level of players lower than yourself.
* 2. You can only set the admin level to a level that is lower than
* yourself.
*/
int com_asetadmin(int p, param_list param)
{
struct player *pp = &player_globals.parray[p];
int p1, connected, oldlevel;
if (!FindPlayer(p, param[0].val.word,&p1, &connected))
return COM_OK;
if (!check_admin2(p, p1)) {
pprintf(p, "You can only set adminlevel for players below your adminlevel.\n");
if (!connected)
player_remove(p1);
return COM_OK;
}
if (!strcmp(player_globals.parray[p1].login, pp->login)) {
pprintf(p, "You can't change your own adminlevel.\n");
return COM_OK;
}
if (!check_admin(p, param[1].val.integer+1)) {
pprintf(p, "You can't promote someone to or above your adminlevel.\n");
if (!connected)
player_remove(p1);
return COM_OK;
}
if (param[1].val.integer < 0)
{
pprintf(p, "Level must be positive.\n");
if (!connected)
player_remove(p1);
return COM_OK;
}
oldlevel = player_globals.parray[p1].adminLevel;
player_globals.parray[p1].adminLevel = param[1].val.integer;
pprintf(p, "Admin level of %s set to %d.\n", player_globals.parray[p1].name, player_globals.parray[p1].adminLevel);
player_save(p1);
if (connected) {
pprintf_prompt(p1, "\n\n%s has set your admin level to %d.\n\n", pp->name, player_globals.parray[p1].adminLevel);
} else {
player_remove(p1);
}
return COM_OK;
}
开发者ID:SKAcz,项目名称:bics-current,代码行数:52,代码来源:adminproc.c
注:本文中的pprintf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论