本文整理汇总了C++中send_int函数的典型用法代码示例。如果您正苦于以下问题:C++ send_int函数的具体用法?C++ send_int怎么用?C++ send_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_int函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: issue_spadcommand
/* issue a AXIOM command to the buffer associated with a page */
void
issue_spadcommand(HyperDocPage *page, TextNode *command, int immediate,
int type)
{
char *buf;
int ret_val;
ret_val = connect_spad();
if (ret_val == NotConnected || ret_val == SpadBusy)
return;
if (page->sock == NULL)
start_user_buffer(page);
ret_val = send_int(page->sock, TestLine);
if (ret_val == -1) {
page->sock = NULL;
clear_execution_marks(page->depend_hash);
issue_spadcommand(page, command, immediate, type);
return;
}
issue_dependent_commands(page, command, type);
ret_val = send_int(page->sock, ReceiveInputLine);
buf = print_to_string(command);
if (immediate) {
buf[strlen(buf) + 1] = '\0';
buf[strlen(buf)] = '\n';
}
if (type == Spadsrc)
send_pile(page->sock, buf);
else
send_string(page->sock, buf);
mark_as_executed(page, command, type);
gIsEndOfOutput = 0;
}
开发者ID:acralfs,项目名称:fricas,代码行数:35,代码来源:spadint.c
示例2: process_execute
/*
* Send execute messae. "conn" should at the point right after the message
* kind was read.
*/
void
process_execute(char *buf, PGconn *conn)
{
int len;
char *portal;
int maxrows;
char *bufp;
SKIP_TABS(buf);
len = sizeof(int);
portal = buffer_read_string(buf, &bufp);
buf = bufp;
len += strlen(portal) + 1;
SKIP_TABS(buf);
fprintf(stderr, "FE=> Execute(portal=\"%s\")\n", portal);
SKIP_TABS(buf);
maxrows = buffer_read_int(buf, &bufp);
len += sizeof(int);
send_char('E', conn);
send_int(len, conn);
send_string(portal, conn);
send_int(maxrows, conn);
}
开发者ID:pgpool,项目名称:pgpool2,代码行数:35,代码来源:extended_query.c
示例3: connect_to_local_server
Sock *
connect_to_local_server(char *server_name, int purpose, int time_out)
{
int max_con=(time_out == 0 ? 1000000 : time_out), i, code=-1;
Sock *sock;
char name[256];
make_server_name(name, server_name);
sock = (Sock *) calloc(sizeof(Sock), 1);
if (sock == NULL) {
perror("allocating socket space");
return NULL;
}
sock->purpose = purpose;
/* create the socket */
sock->socket = fricas_communication_link(FRICAS_AF_LOCAL);
if (is_invalid_socket(sock)) {
perror("opening client socket");
free(sock);
return NULL;
}
/* connect socket using name specified in command line */
memset(server[1].addr.u_addr.sa_data, 0,
sizeof(server[1].addr.u_addr.sa_data));
sock->addr.u_addr.sa_family = FRICAS_AF_LOCAL;
strcpy(sock->addr.u_addr.sa_data, name);
for(i=0; i<max_con; i++) {
code = connect(sock->socket, &sock->addr.u_addr,
sizeof(sock->addr.u_addr));
if (code == -1) {
if (
/* @@@ Why we need this */
errno != ENOENT &&
/* Needed on Cygwin, on Linux this should never happen. */
errno != EBADF &&
!fricas_connection_refused()) {
perror("connecting server stream socket");
return NULL;
} else {
if (i != max_con - 1)
fricas_sleep(40);
continue;
}
} else break;
}
if (code == -1) {
return NULL;
}
send_int(sock, getpid());
send_int(sock, sock->purpose);
send_int(sock, sock->socket);
sock->pid = get_int(sock);
/* fprintf(stderr, "Got int form socket\n"); */
sock->remote = get_int(sock);
return sock;
}
开发者ID:oldk1331,项目名称:fricas,代码行数:57,代码来源:sockio-c.c
示例4: send_data_int
/* Send EV_DATA and the integer value. Return 0 on error. */
static int send_data_int (const struct client *cli, const int data)
{
assert (cli->socket != -1);
if (!send_int(cli->socket, EV_DATA) || !send_int(cli->socket, data))
return 0;
return 1;
}
开发者ID:jonsafari,项目名称:mocp,代码行数:10,代码来源:server.c
示例5: decimate_header
void decimate_header() /* includefile */
{
/* go no further here if not interested in header parameters */
if (headerless) return;
/* broadcast the header parameters to the output stream */
send_string("HEADER_START");
if (!strings_equal(source_name,"")) {
send_string("source_name");
send_string(source_name);
}
send_int("telescope_id",telescope_id);
send_int("machine_id",machine_id);
send_coords(src_raj,src_dej,az_start,za_start);
if (nchans/naddc==1) {
send_int("data_type",2);
// send_double("refdm",0.0);
send_double("refdm",refdm);
/*== MKEITH: A hack to stop the dminfo being lost when decimating after dedisperse! ==*/
} else {
send_int("data_type",1);
}
send_double("fch1",fch1);
send_double("foff",foff*(double)naddc);
send_int("nchans",nchans/naddc);
send_int("nbits",obits);
send_double ("tstart",tstart);
send_double("tsamp",tsamp*(double)naddt);
send_int("nifs",nifs);
send_int("barycentric",barycentric);
send_string("HEADER_END");
}
开发者ID:llevin,项目名称:sigproc,代码行数:33,代码来源:decimate_header.c
示例6: windows_kodi_load
static void windows_kodi_load(Window *window){
// Create title TextLayer
s_title_info_layer = text_layer_create(GRect(0, 10, 144, 25));
text_layer_set_background_color(s_title_info_layer, GColorClear);
text_layer_set_text_color(s_title_info_layer, GColorRed);
text_layer_set_text(s_title_info_layer, "Kodi");
// s_weather_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_PERFECT_DOS_20));
// text_layer_set_font(s_title_info_layer, s_weather_font);
// Add it as a child layer to the Window's root layer
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_title_info_layer));
// Create Movie TextLayer
s_album_info_layer = text_layer_create(GRect(0, 60, 144, 25));
text_layer_set_background_color(s_album_info_layer, GColorClear);
text_layer_set_text_color(s_album_info_layer, GColorRed);
text_layer_set_text(s_album_info_layer, "Movie");
// s_weather_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_PERFECT_DOS_20));
// text_layer_set_font(s_album_info_layer, s_weather_font);
// Add it as a child layer to the Window's root layer
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_album_info_layer));
//Load action bar
action_bar_nav_h_kodi(window);
//Request info
send_int("kodi", "init");
}
开发者ID:gibald,项目名称:telemator,代码行数:27,代码来源:telemator.c
示例7: vsend_int
int vsend_int(int val, int nr_of_roles, ...)
{
int rc = 0;
int i;
role *r;
va_list roles;
#ifdef __DEBUG__
fprintf(stderr, " --> %s(%d)@%d ", __FUNCTION__, val, nr_of_roles);
#endif
va_start(roles, nr_of_roles);
for (i=0; i<nr_of_roles; i++) {
r = va_arg(roles, role *);
#ifdef __DEBUG__
fprintf(stderr, " +");
#endif
rc |= send_int(val, r, NULL);
if (rc != 0) perror(__FUNCTION__);
}
va_end(roles);
#ifdef __DEBUG__
fprintf(stderr, ".\n");
#endif
return rc;
}
开发者ID:D4vidH4mm3r,项目名称:sessc,代码行数:28,代码来源:primitives.c
示例8: menu_select_callback
void menu_select_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *data) {
switch (cell_index->section) {
case 0:
switch (cell_index->row) {
case 0:
if (loading==0) carga_calendario();
break;
case 1:
if (loading==0) carga_fpp();
break;
}
break;
case 1:
switch (cell_index->row) {
case 0:
if (loading==0){
send_int(5,5);
char version[20];
time_t now = time(NULL);
struct tm *tick_time = localtime(&now);
snprintf(version, 20, "Versión: %i-%i-%i",tick_time->tm_mday,(tick_time->tm_mon)+1,(tick_time->tm_year)-100);
vibes_short_pulse();
loading = 0;
layer_mark_dirty(menu_layer_get_layer(menu_layer));
}
break;
}
break;
}
}
开发者ID:pjexposito,项目名称:HorarioMiguel,代码行数:31,代码来源:main.c
示例9: sock_send_int
int
sock_send_int(int purpose,int val)
{
if (accept_if_needed(purpose) != -1)
return send_int(purpose_table[purpose], val);
return -1;
}
开发者ID:oldk1331,项目名称:fricas,代码行数:7,代码来源:sockio-c.c
示例10: get_client_plist
/* Handle CMD_GET_PLIST. Return 0 on error. */
static int get_client_plist (struct client *cli)
{
int first;
debug ("Client with fd %d requests the playlist", cli->socket);
/* Find the first connected client, and ask it to send the playlist.
* Here, send 1 if there is a client with the playlist, or 0 if there
* isn't. */
cli->requests_plist = 1;
first = find_sending_plist ();
if (first == -1) {
debug ("No clients with the playlist");
cli->requests_plist = 0;
if (!send_data_int(cli, 0))
return 0;
return 1;
}
if (!send_data_int(cli, 1))
return 0;
if (!send_int(clients[first].socket, EV_SEND_PLIST))
return 0;
return 1;
}
开发者ID:jonsafari,项目名称:mocp,代码行数:30,代码来源:server.c
示例11: qPrintable
// send header
long NetThread::sendHeader(SOCKET sock, const char *buf, long size)
{
// 0123456789ABCDEF
char key[ENCRYPTION_KEY_LENGTH + 1] = {"@@@@@@@@@@@@@@@@"};
// copy encryption key
#if 1 // simple description
const char *encryption_key = qPrintable(settings->getPassword());
#else
const char *encryption_key = settings->getPassword().toUtf8().constData();
#endif
for (int i = 0;i < ENCRYPTION_KEY_LENGTH; i++){
if (encryption_key[i] == '\0')
break;
key[i] = encryption_key[i];
}
COM_DATA *com_data = (COM_DATA*)buf;
long data_long = com_data->data_type + (com_data->data_size & 0x0000ffff);
com_data->encryption = ENCRYPTION_OFF;
com_data->check_digit = ~data_long;
for (int i = 0; i < ENCRYPTION_KEY_LENGTH; i++){
char key_char = ~key[i];
key_char += (char)((long)i * ~com_data->check_digit);
com_data->check_digit_enc[i] = key_char;
}
//saveHeader("sentHeader.dat");
// send
return send_int(sock, buf, size, 0);
}
开发者ID:funfun-dc5,项目名称:qtbrynhildr,代码行数:36,代码来源:netthread.cpp
示例12: get_block
static int get_block(int conn, int fd, int max_size, int encrypt)
{
char *data;
long len;
int n_read, n, i, code;
recv_string(conn, &data, &len);
if (encrypt)
{
#ifdef HAVE_KRB4
char *unenc = malloc(len);
if (!unenc)
{
send_int(conn, ENOMEM);
return -1;
}
des_pcbc_encrypt((des_cblock *)data, (des_cblock *)unenc, len, sched, &ivec, 1);
for (i = 0; i < 8; i++)
ivec[i] = data[len - 8 + i] ^ unenc[len - 8 + i];
free(data);
data = unenc;
#endif
}
n_read = MIN(len, max_size);
n = 0;
while (n < n_read)
{
int n_wrote;
n_wrote = write(fd, data + n, n_read - n);
if (n_wrote == -1)
{
code = errno;
com_err(whoami, errno, "writing file (get_file)");
send_int(conn, code);
free(data);
close(fd);
return -1;
}
n += n_wrote;
}
free(data);
return n;
}
开发者ID:sipb,项目名称:athena-svn-mirror,代码行数:47,代码来源:get_file.c
示例13: tick_callback
void tick_callback(struct tm *tick_time, TimeUnits units_changed) {
//Every five minutes
if(tick_time->tm_min % 1 == 0)
{
//Send an arbitrary message, the response will be handled by in_received_handler()
send_int(1, 1);
}
}
开发者ID:MacBoyPro98,项目名称:Pebble,代码行数:8,代码来源:weather.c
示例14: send_str
/*** send_str *********************************************************
Send a character string through a socket.
Input: socket - the socket to send on.
str - the string to send
Output: none.
**********************************************************************/
void send_str( int socket, char str[] )
{
int len;
len = strlen( str );
send_int( socket, len );
send_data( socket, str, len );
}
开发者ID:VisualIdeation,项目名称:vis5d--1.3.1,代码行数:14,代码来源:socketio.c
示例15: emergency_conf_select_click_callback
void emergency_conf_select_click_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *callback_context)
{
switch(cell_index->row)
{
case 0:
send_int(0);
init();
//remove this window frmo the stack
window_stack_remove(window, false);
break;
case 1:
send_int(4);
emergency_init();
//remove this window frmo the stack
window_stack_remove(window, false);
break;
}
}
开发者ID:lezzago,项目名称:PeaceOfMind,代码行数:18,代码来源:emergency_conf.c
示例16: down_click_handler
void down_click_handler(ClickRecognizerRef recognizer, void *context)
{
text_layer_set_text(incoming_text, "Declining Call");
vibes_cancel();
confirm_vibe();
send_int(KEY_BUTTON_EVENT, BUTTON_EVENT_DOWN);
exit_counter = 2;
tick_timer_service_subscribe(SECOND_UNIT, exit_timer);
}
开发者ID:Virophage,项目名称:HFAStPebbleCallApp,代码行数:9,代码来源:main.c
示例17: up_click_handler
void up_click_handler(ClickRecognizerRef recognizer, void *context)
{
text_layer_set_text(incoming_text, "Call Accepted");
vibes_cancel();
confirm_vibe();
send_int(KEY_BUTTON_EVENT, BUTTON_EVENT_UP);
call_counter = 10;
tick_timer_service_subscribe(SECOND_UNIT, timer);
}
开发者ID:Virophage,项目名称:HFAStPebbleCallApp,代码行数:9,代码来源:main.c
示例18: UARTWriteRes
void UARTWriteRes(unsigned int res_[2])
{
while (!(IFG2&UCA0TXIFG)); // Check the buffer
print("Current I = ");
send_int(res_[0]);
print(", Voltage V = ");
send_intln(res_[1]);
}
开发者ID:mexanick,项目名称:msp-dev,代码行数:9,代码来源:main.c
示例19: send_ints
int
send_ints(Sock *sock, int *vals, int num)
{
int i;
for(i=0; i<num; i++)
if (send_int(sock, *vals++) == -1)
return -1;
return 0;
}
开发者ID:oldk1331,项目名称:fricas,代码行数:9,代码来源:sockio-c.c
示例20: menu_select_callback
static void menu_select_callback(int index, void *ctx) {
if(index == 0) {
APP_LOG( APP_LOG_LEVEL_INFO, "Quick Reply" );
send_int(0, 0); //
} else {
APP_LOG( APP_LOG_LEVEL_INFO, "Text reply" );
tertiary_text_prompt( "What's your name?", callback, NULL );
}
}
开发者ID:Dotmatrix812,项目名称:Pebgram,代码行数:10,代码来源:main.c
注:本文中的send_int函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论