本文整理汇总了C++中set_message函数的典型用法代码示例。如果您正苦于以下问题:C++ set_message函数的具体用法?C++ set_message怎么用?C++ set_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: handle_key
void handle_key(struct wdata *data, int c)
{
if (c == 27) {
reset();
states_pop();
} else if (c == 9) {
autocomplete_handle();
} else if (c == 13) {
execute(data);
reset();
states_pop();
} else if (c == 263) {
if (cmd_data.bufpos > 0) {
autocomplete_clear();
cmd_data.buf[--cmd_data.bufpos] = '\0';
set_message(M_INFO, ":%s", cmd_data.buf);
} else {
set_message(M_INFO, "");
states_pop();
}
} else if (c >= 32) {
if (cmd_data.bufpos < CMD_BUFSIZE) {
autocomplete_clear();
cmd_data.buf[cmd_data.bufpos++] = c;
cmd_data.buf[cmd_data.bufpos] = '\0';
set_message(M_INFO, ":%s", cmd_data.buf);
}
}
}
开发者ID:dstenb,项目名称:tfm,代码行数:29,代码来源:cmd_state.c
示例2: execute
void execute(struct wdata *data)
{
char tmp[CMD_BUFSIZE + 1];
char *name;
int i;
struct arg arg;
strcpy(tmp, cmd_data.buf);
name = strtok(tmp, " ");
arg.s = strtok(NULL, " ");
if (!name) {
/* no command entered, leave cmd state */
set_message(M_INFO, "");
} else {
for (i = 0; i < ARRSIZE(cmds); i++) {
if (streq(name, cmds[i].name)) {
cmds[i].func(data, &arg);
return;
}
}
/* no command found, print error message */
set_message(M_ERROR, "no such command: '%s' ", name);
}
}
开发者ID:dstenb,项目名称:tfm,代码行数:27,代码来源:cmd_state.c
示例3: search_upwards
bool
edit_interface_rep::set_hybrid_footer (tree st) {
// WARNING: update edit_dynamic_rep::activate_hybrid when updating this
if (is_atomic (st))
if (is_func (subtree (et, path_up (tp, 2)), HYBRID, 1)) {
string msg;
// macro argument
string name= st->label;
path mp= search_upwards (MACRO);
if (!is_nil (mp)) {
tree mt= subtree (et, mp);
int i, n= N(mt)-1;
for (i=0; i<n; i++)
if (mt[i] == name) {
set_message (concat (kbd ("return"), ": insert argument ", name),
"hybrid command");
return true;
}
}
// macro application
tree f= get_env_value (name);
if (drd->contains (name) && (f == UNINIT))
set_message (concat (kbd ("return"), ": insert primitive ", name),
"hybrid command");
else if (is_func (f, MACRO) || is_func (f, XMACRO))
set_message (concat (kbd ("return"), ": insert macro ", name),
"hybrid command");
else if (f != UNINIT)
set_message (concat (kbd ("return"), ": insert value ", name),
"hybrid command");
else return false;
return true;
}
return false;
}
开发者ID:xywei,项目名称:texmacs,代码行数:35,代码来源:edit_footer.cpp
示例4: creation_message_erreur
creation_message_erreur(char nom[]) {
int fd = creation_fichier_liste("erreur.txt");
set_message("le fichier suivant n'existe pas : ");
write(fd,get_message(),size_message());
write(fd,nom,strlen(nom));
set_message("\n\n");
write(fd,get_message(),size_message());
ajout_info_liste(fd);
}
开发者ID:apprensemble,项目名称:code_rouge,代码行数:9,代码来源:serveur.c
示例5: cmd_set_sort
void cmd_set_sort(struct wdata *data, const struct arg *arg)
{
if (arg->i < 0 || arg->i >= N_SORTMETHODS)
return;
set_message(M_INFO, "");
dwindow_set_sort(data->wsel, arg->i);
set_message(M_INFO, "sorted by: %s", strsort(data->wsel->sort));
}
开发者ID:dstenb,项目名称:tfm,代码行数:10,代码来源:commands.c
示例6: gwy_tip_estimate_partial
/**
* gwy_tip_estimate_partial:
* @tip: Tip data to be refined (allocated).
* @surface: Surface data.
* @threshold: Threshold for noise supression.
* @use_edges: Whether use also edges of image.
* @count: Where to store the number of places that produced refinements to.
* @set_fraction: Function that sets fraction to output (or %NULL).
* @set_message: Function that sets message to output (or %NULL).
*
* Performs partial blind estimation algorithm published by Villarrubia. This
* function converts all fields into form requested by "morph_lib.c" library,
* that is almost identical with original Villarubia's library. Note that the
* threshold value must be chosen sufficently high value to supress small
* fluctulations due to noise (that would lead to very sharp tip) but
* sufficiently low value to put algorithm at work. A value similar to 1/10000
* of surface range can be good. Otherwise we recommend to start with zero
* threshold and increase it slowly to observe changes and choose right value.
*
* Returns: Estimated tip. May return %NULL if aborted.
**/
GwyDataField*
gwy_tip_estimate_partial(GwyDataField *tip,
GwyDataField *surface,
gdouble threshold,
gboolean use_edges,
gint *count,
GwySetFractionFunc set_fraction,
GwySetMessageFunc set_message)
{
gint **ftip;
gint **fsurface;
gdouble tipmin, surfacemin, step;
gint cnt;
if (set_message && !set_message(N_("Converting fields")))
return NULL;
tipmin = gwy_data_field_get_min(tip);
surfacemin = gwy_data_field_get_min(surface);
step = (gwy_data_field_get_max(surface)-surfacemin)/10000;
ftip = i_datafield_to_field(tip, TRUE, tipmin, step);
fsurface = i_datafield_to_field(surface, FALSE, surfacemin, step);
if (set_message && !set_message(N_("Starting partial estimation"))) {
_gwy_morph_lib_ifreematrix(ftip, tip->xres);
_gwy_morph_lib_ifreematrix(fsurface, surface->xres);
return NULL;
}
cnt = _gwy_morph_lib_itip_estimate0(fsurface, surface->yres, surface->xres,
tip->yres, tip->xres,
tip->yres/2, tip->xres/2,
ftip, threshold/step, use_edges,
set_fraction, set_message);
if (cnt == -1 || (set_fraction && !set_fraction(0.0))) {
_gwy_morph_lib_ifreematrix(ftip, tip->xres);
_gwy_morph_lib_ifreematrix(fsurface, surface->xres);
return NULL;
}
gwy_debug("Converting fields");
if (set_message)
set_message(N_("Converting fields"));
tip = i_field_to_datafield(ftip, tip, tipmin, step);
gwy_data_field_add(tip, -gwy_data_field_get_min(tip));
_gwy_morph_lib_ifreematrix(ftip, tip->xres);
_gwy_morph_lib_ifreematrix(fsurface, surface->xres);
if (count)
*count = cnt;
return tip;
}
开发者ID:svn2github,项目名称:gwyddion,代码行数:75,代码来源:tip.c
示例7: probe_monitors
static void probe_monitors(GtkWidget *widget, gpointer data) {
if (combo_box_changed_handler_id)
g_signal_handler_disconnect(G_OBJECT(combo_box), combo_box_changed_handler_id);
gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(combo_box))));
set_message(_(
"Probing for available monitors..."
));
if (widget == NULL)
monlist = ddcci_load_list();
else
monlist = NULL;
if (!monlist) {
monlist = ddcci_probe();
ddcci_save_list(monlist);
}
struct monitorlist* current;
char buffer[256];
for (current = monlist; current != NULL; current = current->next)
{
snprintf(buffer, 256, "%s: %s",
current->filename, current->name);
gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), buffer);
}
combo_box_changed_handler_id = g_signal_connect(G_OBJECT(combo_box), "changed", G_CALLBACK(combo_change), NULL);
currentid = -1;
nextid = -1;
if (monlist) {
widgets_set_sensitive(TRUE);
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0);
}
else {
widgets_set_sensitive(FALSE);
gtk_widget_set_sensitive(close_button, TRUE);
gtk_widget_set_sensitive(refresh_controls_button, TRUE);
set_message(_(
"No monitor supporting DDC/CI available.\n\n"
"If your graphics card need it, please check all the required kernel modules are loaded (i2c-dev, and your framebuffer driver)."
));
}
}
开发者ID:larstobi,项目名称:ddccontrol,代码行数:51,代码来源:main.c
示例8: load_metadata
/* load metadata file */
int load_metadata() {
FILE *f;
unsigned int stp;
mylog("::load_metadata()\n");
if (metaurl[0] != '@') {
/* not for @ code: it is not updated */
f = fopen(tpl, "w");
if (f == NULL) {
update_ok = UP_INT;
set_message("Failed to create local metadata file (check /tmp).");
return(0);
}
}
if (metaurl[0] == '@') {
/* user ask for a local program to update file */
/* run it with "system". may change */
if (system(metaurl+1) != 0) {
update_ok = UP_404; /* fail. same error than 404 */
set_message("Failed to execute updater program for metadata.");
return(0);
}
return(1);
} else {
/* we just dl the metadata file from website */
if (!wget_meta(metaurl, f)) {
fclose(f);
update_ok = UP_404;
return(0);
}
fclose(f);
}
/* now check for timestamp value */
f = fopen(tpl, "r");
if (f == NULL) {
update_ok = UP_INT;
set_message("Failed to open local metadata file (check /tmp).");
return(0);
}
if (fscanf(f, "%u", &stp) != 1) {
fclose(f);
update_ok = UP_TREE;
set_message("Failed to find timestamp in metadata file (bad format?).");
return(0);
}
fclose(f);
set_message(NULL);
return(1);
}
开发者ID:Hexasoft,项目名称:WebFS,代码行数:52,代码来源:webfs.c
示例9: show_message
void show_message(char message[]){
window_stack_pop(true);
window_stack_push(message_window, true);
set_message(message);
last_screen = current_screen;
current_screen = SCREEN_MESSAGE_KEY;
}
开发者ID:CodeWithASmile,项目名称:BoatRemote,代码行数:7,代码来源:main.c
示例10: cli_setatr
BOOL cli_setatr(struct cli_state *cli, const char *fname, uint16 attr, time_t t)
{
char *p;
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
set_message(cli->outbuf,8,0,True);
SCVAL(cli->outbuf,smb_com,SMBsetatr);
SSVAL(cli->outbuf,smb_tid,cli->cnum);
cli_setup_packet(cli);
SSVAL(cli->outbuf,smb_vwv0, attr);
put_dos_date3(cli->outbuf,smb_vwv1, t);
p = smb_buf(cli->outbuf);
*p++ = 4;
p += clistr_push(cli, p, fname, -1, STR_TERMINATE);
*p++ = 4;
cli_setup_bcc(cli, p);
cli_send_smb(cli);
if (!cli_receive_smb(cli)) {
return False;
}
if (cli_is_error(cli)) {
return False;
}
return True;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:34,代码来源:clifile.c
示例11: cli_rmdir
BOOL cli_rmdir(struct cli_state *cli, const char *dname)
{
char *p;
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
set_message(cli->outbuf,0, 0, True);
SCVAL(cli->outbuf,smb_com,SMBrmdir);
SSVAL(cli->outbuf,smb_tid,cli->cnum);
cli_setup_packet(cli);
p = smb_buf(cli->outbuf);
*p++ = 4;
p += clistr_push(cli, p, dname, -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
cli_send_smb(cli);
if (!cli_receive_smb(cli)) {
return False;
}
if (cli_is_error(cli)) {
return False;
}
return True;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:30,代码来源:clifile.c
示例12: cli_nt_hardlink
BOOL cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst)
{
char *p;
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
set_message(cli->outbuf, 4, 0, True);
SCVAL(cli->outbuf,smb_com,SMBntrename);
SSVAL(cli->outbuf,smb_tid,cli->cnum);
cli_setup_packet(cli);
SSVAL(cli->outbuf,smb_vwv0,aSYSTEM | aHIDDEN | aDIR);
SSVAL(cli->outbuf,smb_vwv1, RENAME_FLAG_HARD_LINK);
p = smb_buf(cli->outbuf);
*p++ = 4;
p += clistr_push(cli, p, fname_src, -1, STR_TERMINATE);
*p++ = 4;
p += clistr_push(cli, p, fname_dst, -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
cli_send_smb(cli);
if (!cli_receive_smb(cli))
return False;
if (cli_is_error(cli))
return False;
return True;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:33,代码来源:clifile.c
示例13: setup
void setup(void) {
bank_init();
set_message("The following commands are available at the bank:\n" +
"\tbalance : Get your balance.\n" +
"\tdeposit # : Deposit # coins in the bank.\n" +
"\twithdraw # : Withdraw # coins from the bank.\n");
}
开发者ID:Lundex,项目名称:gurbalib,代码行数:7,代码来源:bank_sign.c
示例14: cli_message_text_build
/****************************************************************************
send a message
****************************************************************************/
int cli_message_text_build(struct cli_state *cli, char *msg, int len, int grp)
{
char *msgdos;
int lendos;
char *p;
memset(cli->outbuf,'\0',smb_size);
set_message(cli->outbuf,1,0,True);
SCVAL(cli->outbuf,smb_com,SMBsendtxt);
SSVAL(cli->outbuf,smb_tid,cli->cnum);
cli_setup_packet(cli);
SSVAL(cli->outbuf,smb_vwv0,grp);
p = smb_buf(cli->outbuf);
*p++ = 1;
if ((lendos = (int)convert_string_allocate(NULL,CH_UNIX, CH_DOS, msg,len, (void **)(void *)&msgdos, True)) < 0 || !msgdos) {
DEBUG(3,("Conversion failed, sending message in UNIX charset\n"));
SSVAL(p, 0, len); p += 2;
memcpy(p, msg, len);
p += len;
} else {
SSVAL(p, 0, lendos); p += 2;
memcpy(p, msgdos, lendos);
p += lendos;
SAFE_FREE(msgdos);
}
cli_setup_bcc(cli, p);
return(PTR_DIFF(p, cli->outbuf));
}
开发者ID:AllardJ,项目名称:Tomato,代码行数:36,代码来源:climessage.c
示例15: reply_pipe_read_and_X
/****************************************************************************
reply to a read and X
This code is basically stolen from reply_read_and_X with some
wrinkles to handle pipes.
****************************************************************************/
int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize)
{
pipes_struct *p = get_rpc_pipe_p(inbuf,smb_vwv2);
int smb_maxcnt = SVAL(inbuf,smb_vwv5);
int smb_mincnt = SVAL(inbuf,smb_vwv6);
int nread = -1;
char *data;
/* we don't use the offset given to use for pipe reads. This
is deliberate, instead we always return the next lump of
data on the pipe */
#if 0
uint32 smb_offs = IVAL(inbuf,smb_vwv3);
#endif
if (!p)
return(ERROR(ERRDOS,ERRbadfid));
set_message(outbuf,12,0,True);
data = smb_buf(outbuf);
nread = (int)read_from_pipe(p, data, (size_t)smb_maxcnt);
if (nread < 0)
return(UNIXERROR(ERRDOS,ERRnoaccess));
SSVAL(outbuf,smb_vwv5,nread);
SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf));
SSVAL(smb_buf(outbuf),-2,nread);
DEBUG(3,("readX-IPC pnum=%04x min=%d max=%d nread=%d\n",
p->pnum, smb_mincnt, smb_maxcnt, nread));
return chain_reply(inbuf,outbuf,length,bufsize);
}
开发者ID:AllardJ,项目名称:Tomato,代码行数:40,代码来源:pipes.c
示例16: CHECK_PERMISSION_OR_GO_TO_LOGIN
void Articles::remove(const std::string slug) {
CHECK_PERMISSION_OR_GO_TO_LOGIN();
const bool success = articlesModel->remove(
get_interface_lang(),
slug
);
if (success) {
set_message(_("The article has been removed"));
} else {
set_message(_("A problem occured while trying to remove"));
}
go_to_main_page();
}
开发者ID:qdii,项目名称:tatowiki,代码行数:16,代码来源:Articles.cpp
示例17: cli_negprot_send
void cli_negprot_send(struct cli_state *cli)
{
char *p;
int numprots;
memset(cli->outbuf,'\0',smb_size);
/* setup the protocol strings */
set_message(cli->outbuf,0,0,True);
p = smb_buf(cli->outbuf);
for (numprots=0;
prots[numprots].name && prots[numprots].prot<=cli->protocol;
numprots++) {
*p++ = 2;
p += clistr_push(cli, p, prots[numprots].name, -1, STR_CONVERT|STR_TERMINATE);
}
SCVAL(cli->outbuf,smb_com,SMBnegprot);
cli_setup_bcc(cli, p);
cli_setup_packet(cli);
SCVAL(smb_buf(cli->outbuf),0,2);
cli_send_smb(cli);
}
开发者ID:jophxy,项目名称:samba,代码行数:26,代码来源:cliconnect.c
示例18: set_priority_proc
void set_priority_proc(void) {
/*sends message to kcd to register the command types*/
ENVELOPE *msg = (ENVELOPE *)request_memory_block();
msg->message_type = MSG_COMMAND_REGISTRATION;
msg->sender_pid = SET_PRIORITY_PID;
msg->destination_pid = KCD_PID;
set_message(msg, "%C" + '\0', 4*sizeof(char));
send_message(KCD_PID, msg);
while(1){
int priority, pid;
ENVELOPE * rec_msg = (ENVELOPE*) receive_message(NULL);
char * char_message = (char *) rec_msg->message;
if ((char_message[3] >= '1')&&(char_message[3] <= '6')&&(char_message[4] == ' ')&&(char_message[5] >= '0')&&(char_message[5] <= '3') && (char_message[6] == '\0')){
pid = char_message[3] - '0';
priority = char_message[5] - '0';
//printf("message %s", char_message);
//printf("pid %d priority %d", pid, priority);
set_process_priority(pid, priority);
}
else {
ENVELOPE * error_msg = (ENVELOPE*) request_memory_block();
error_msg->sender_pid = SET_PRIORITY_PID;
error_msg->destination_pid = CRT_PID;
error_msg->message_type = MSG_CRT_DISPLAY;
error_msg->message = error_msg + HEADER_OFFSET;
sprintf(error_msg->message, "You have entered an invalid input\n\r");
send_message(CRT_PID, error_msg);
}
release_memory_block(rec_msg);
}
}
开发者ID:Scourae,项目名称:SE350-RTX,代码行数:35,代码来源:k_sys_proc.c
示例19: kcd_proc
void kcd_proc(void)
{
ENVELOPE* msg;
int i;
while(1)
{
msg = (ENVELOPE*) receive_message(NULL);
if (msg != NULL)
{
if (msg->message_type == MSG_COMMAND_REGISTRATION)
{
for (i = 0; i < KC_MAX_COMMANDS; i++)
{
if (g_kc_reg[i].pid == -1)
{
g_kc_reg[i].pid = msg->sender_pid;
strcpy(g_kc_reg[i].command, msg->message);
break;
}
}
}
else if (msg->message_type == MSG_CONSOLE_INPUT)
{
int i = 0;
int j;
char command[KC_MAX_CHAR];
char* message_curr = msg->message;
while ((i < KC_MAX_CHAR)&&(message_curr[i] != ' ')&&(message_curr[i] != '\0'))
{
command[i] = message_curr[i];
i++;
}
command[i] = '\0';
// find end of message
while (message_curr[i] != '\0')
{
i++;
}
for (j = 0; j < KC_MAX_COMMANDS; j++)
{
if ((strcmp(command,g_kc_reg[j].command) == 0)&&(g_kc_reg[j].pid != -1))
{
ENVELOPE* kcd_msg = (ENVELOPE*) request_memory_block();
kcd_msg->sender_pid = KCD_PID;
kcd_msg->destination_pid = g_kc_reg[j].pid;
kcd_msg->nextMsg = NULL;
kcd_msg->message_type = MSG_KCD_DISPATCH;
kcd_msg->delay = 0;
set_message(kcd_msg, message_curr, i*sizeof(char));
send_message(g_kc_reg[j].pid, kcd_msg);
break;
}
}
}
}
release_memory_block(msg);
}
}
开发者ID:Scourae,项目名称:SE350-RTX,代码行数:60,代码来源:k_sys_proc.c
示例20: set_condemn_building
void set_condemn_building( string building ) {
object ob;
if( ob = single_present(building, environment(this_player())) ) {
string bname = ob->query_distant();
if( !ob->query_is_building() ) {
msg( "That's not a building, and may not be condemned." );
return;
}
if( ob->query_name() == "foundstone" ) {
msg( "Condemnation signs may not be used to destroy a foundstone." );
return;
}
condemn_time = time() + 2 * 365 * 24 * 120; // 120 seconds per hour on Walraven...
condemn_time = (condemn_time/2880) * 2880; // Round to an even date.
condemn_obj = to_objectref(ob);
drop_interface();
set_message( "This building, "+ob->query_distant()+", was ~CWRNcondemned~CDEF by ~CBRT" +
capitalize(this_player()->query_name()) + "~CDEF on " +
"/daemon/time"->query_date() + ". To remove "
"the condemnation, simply raze this sign. To enforce the condemnation, you "
"should ~CCOMuse sign~CDEF after the warning time expires. Warning expires two years from the date posted." );
msg( "OK, you'll condemn " + bname + ". Come back when the warning expires!" ) ;
return;
}
else if( building == "cancel" ) {
msg( "Never mind, then." );
destruct(this_object());
return;
}
else {
msg( "Couldn't identify that building. Try again, or type 'cancel' to quit." );
return;
}
}
开发者ID:shentino,项目名称:simud,代码行数:35,代码来源:condemn_sign.c
注:本文中的set_message函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论