本文整理汇总了C++中printlog函数的典型用法代码示例。如果您正苦于以下问题:C++ printlog函数的具体用法?C++ printlog怎么用?C++ printlog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printlog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
static DPOINT *next_location(DPOINT *loc, PRED_AT what, int random_path,
unsigned int *row, unsigned int *col, DATA **data) {
double xc, yc;
static unsigned int nr = 0;
switch (what) {
case AT_POINTS:
if (DEBUG_TRACE) {
nr++;
printlog("\rbusy with loc: %3u", nr);
}
return get_point_location(random_path);
case AT_GRIDMAP:
if (get_map_location(loc, random_path, row, col)) {
if (loc->u.stratum >= 0) { /* i.e., non-missing valued cell */
if (DEBUG_TRACE)
printlog("\rbusy with row: %3u col: %3u loc: %3u",
*row + 1, *col + 1, nr + 1);
map_rowcol2xy(masks[0], *row, *col, &xc, &yc);
loc->x = xc;
loc->y = yc;
if (!is_mv_double(&gl_zmap))
loc->z = gl_zmap;
else
loc->z = 0.0;
loc->X = get_maskX(data, loc, *row, *col);
nr++;
}
return loc;
}
break;
}
return NULL;
} /* next_location() */
开发者ID:abedzadeh,项目名称:gstat,代码行数:35,代码来源:predict.c
示例2: irc_connect
int irc_connect(char *hostname, int port) {
struct sockaddr_in saddr;
struct in_addr *peer;
struct hostent *hent;
printlog("Attempting to connect to %s:%d", hostname, port);
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
printlog("Failed to open socket.");
exit(1);
}
if (!(hent = gethostbyname(hostname))) {
printlog("Failed to resolve hostname.");
return 0;
}
saddr.sin_family = PF_INET;
saddr.sin_port = htons(port);
peer = (struct in_addr *)hent->h_addr_list[0];
saddr.sin_addr.s_addr = peer->s_addr;
if (connect(sock, (struct sockaddr*)&saddr, sizeof(saddr)) == -1) {
printlog("Failed to connect to %s:%d.", inet_ntoa(saddr.sin_addr), port);
return 0;
}
return 1;
}
开发者ID:rdgout,项目名称:ircbot,代码行数:31,代码来源:irc.c
示例3: try_receive_packet
static int
try_receive_packet(unsigned char* buf, size_t len)
{
struct net_header *nh = (struct net_header *)buf;
if (nh->version != PROTO_VERSION) {
printlog("ERROR: protocol version %x", nh->version);
return 0;
}
switch (nh->type) {
case PROTO_PKT_INFO:
len = net_receive_packet(buf, len);
break;
case PROTO_CHAN_LIST:
len = net_receive_chan_list(buf, len);
break;
case PROTO_CONF_CHAN:
len = net_receive_conf_chan(buf, len);
break;
case PROTO_CONF_FILTER:
len = net_receive_conf_filter(buf, len);
break;
default:
printlog("ERROR: unknown net packet type");
len = 0;
}
return len; /* the number of bytes we have consumed */
}
开发者ID:Lexus89,项目名称:wifi-arsenal,代码行数:30,代码来源:network.c
示例4: wait_thread
void* wait_thread(void* args)
{
int status;
while(running_flag) {
//Start server
pthread_mutex_lock(&fd_mutex);
server_pid = run_server();
if(server_pid == -1) {
pthread_mutex_unlock(&fd_mutex);
printlog(LOG_SERVER, "Failed to run server!\n");
continue;
}
pthread_mutex_unlock(&fd_mutex);
printlog(LOG_SERVER, "Server started.\n");
//Wait
waitpid(server_pid, &status, 0);
}
UNREFERRED_PARAMETER(args);
return NULL;
}
开发者ID:darknightghost,项目名称:mcserverd,代码行数:25,代码来源:game-server.c
示例5: write_protect
/*
* write_protect() - park/unpark
*/
static int write_protect (const char *path, int val)
{
int fd, ret;
char buf[BUF_LEN];
if (dry_run)
return 0;
snprintf(buf, sizeof(buf), "%d", val);
fd = open (path, O_WRONLY);
if (fd < 0) {
printlog (stderr, "Could not open %s", path);
return fd;
}
ret = write (fd, buf, strlen(buf));
if (ret < 0) {
printlog (stderr, "Could not write to %s.\nDoes your kernel/drive support IDLE_IMMEDIATE with UNLOAD?", path);
goto out;
}
ret = 0;
out:
if (close (fd))
printlog (stderr, "Could not close %s", path);
return ret;
}
开发者ID:t-8ch,项目名称:hdapsd,代码行数:33,代码来源:hdapsd.c
示例6: printlog
//destroys an object
Object::~Object()
{
//lets just hope the given pointer is ok...
printlog(1, "freeing Object");
//1: remove it from the list
if (prev == NULL) //first link
{
printlog(2, "(object is head)");
head = next;
}
else
prev->next = next;
if (next) //not last link
next->prev = prev;
else
printlog(2, "(object is last)");
//remove components
while (components)
delete components; //just removes the one in top each time
//make sure no events for this object is left
Object_Event_List::Remove(this);
}
开发者ID:KazzyMac,项目名称:RollCageX,代码行数:28,代码来源:object.cpp
示例7: logprint_qtree
static void logprint_qtree(QTREE_NODE *node, int depth) {
BBOX b;
int i;
if (node == NULL)
return;
b = node->bb;
if (!is_leaf(node)) {
printlog("newline linethickness 0.3 pts %g %g %g %g %g %g %g %g %g %g\n",
b.x, b.y, b.x+b.size, b.y, b.x+b.size,
b.y+b.size, b.x, b.y+b.size, b.x, b.y);
for (i = 0; i < N_NODES(node); i++)
logprint_qtree(node->u.node[i], depth+1);
} else {
printlog("newline pts %g %g %g %g %g %g %g %g %g %g\n",
b.x, b.y, b.x+b.size, b.y, b.x+b.size,
b.y+b.size, b.x, b.y+b.size, b.x, b.y);
/*
if (node == NULL)
printlog("newcurve marktype circle fill 1 pts %g %g\n",
b.x+0.5*b.size, b.y+0.5*b.size);
*/
if (node->n_node > 0) {
printlog("newcurve marktype cross pts");
for (i = 0; i < node->n_node; i++)
printlog(" %g %g", node->u.list[i]->x, node->u.list[i]->y);
printlog("\n");
}
}
}
开发者ID:BenGraeler,项目名称:gstat,代码行数:30,代码来源:nsearch.c
示例8: telnet_init
void telnet_init(int vdefd)
{
int sockfd;
struct sockaddr_in serv_addr;
vdehist_termread=lwip_read;
vdehist_termwrite=lwip_write;
vdehist_logincmd=telnet_logincmd;
sockfd=lwip_socket(AF_INET, SOCK_STREAM, 0);
if (!sockfd) {
printlog(LOG_ERR,"telnet socket err: %s",strerror(errno));
}
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(TELNET_TCP_PORT);
if (lwip_bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
printlog(LOG_ERR,"telnet bind err: %s",strerror(errno));
}
lwip_listen(sockfd, 5);
addpfd(sockfd,telnetaccept);
}
开发者ID:aissat,项目名称:vde2,代码行数:26,代码来源:telnet.c
示例9: alchemyalmostoff
void alchemyalmostoff(ALCHEMY_LIST list_)
{
switch(list_)
{
case ALCT_NONE:
default:
break;
case ALCT_STONE_FIST:
break;
case ALCT_DIAMOND_HARDNESS:
break;
case ALCT_POISON_BODY:
break;
case ALCT_HASTE:
if(you.s_haste < 10)
printlog("속도가 돌아오고 있다.",false,false,false,CL_blue);
break;
case ALCT_STONE_FORM:
printlog("무념무상의 경지가 끝나간다.",false,false,false,CL_blue);
break;
case ALCT_AUTUMN_BLADE:
printlog("손에 감긴 연금술의 힘이 약해지고있다.",false,false,false,CL_blue);
break;
case ALCT_PHILOSOPHERS_STONE:
printlog("현자의 돌은 거의 사라져가고있다.",false,false,false,CL_blue);
break;
}
}
开发者ID:kimjoy2002,项目名称:touhou_crawl,代码行数:28,代码来源:alchemy.cpp
示例10: autodetect_devices
/*
* autodetect_devices()
*/
int autodetect_devices ()
{
int num_devices = 0;
DIR *dp;
struct dirent *ep;
dp = opendir(SYSFS_BLOCK);
if (dp != NULL) {
while ((ep = readdir(dp))) {
char path[FILENAME_MAX];
char removable[FILENAME_MAX];
char rotational[FILENAME_MAX];
snprintf(removable, sizeof(removable), REMOVABLE_FMT, ep->d_name);
snprintf(rotational, sizeof(rotational), ROTATIONAL_FMT, ep->d_name);
if (kernel_interface == UNLOAD_HEADS)
snprintf(path, sizeof(path), UNLOAD_HEADS_FMT, ep->d_name);
else
snprintf(path, sizeof(path), QUEUE_PROTECT_FMT, ep->d_name);
if (access(path, F_OK) == 0 && read_int(removable) == 0 && read_int(path) >= 0) {
if (read_int(rotational) == 1 || forcerotational) {
printlog(stdout, "Adding autodetected device: %s", ep->d_name);
add_disk(ep->d_name);
num_devices++;
}
else {
printlog(stdout, "Not adding autodetected device \"%s\", it seems not to be a rotational drive.", ep->d_name);
}
}
}
(void)closedir(dp);
}
return num_devices;
}
开发者ID:zdzichu,项目名称:hdapsd,代码行数:37,代码来源:hdapsd.c
示例11: insert_hash
uint16_t insert_hash(uint16_t chunk_length, uint16_t *packed_upto,
unsigned char *payload,
uint16_t last_marker,
bool *dedup_flag,
time_t current_timestamp) {
uint16_t local_packed_upto = (*packed_upto);
uint32_t left = 0, right = 0;
hashlittle2((void*)(payload + last_marker), chunk_length, &right, &left);
printlog(logfile, system_loglevel, LOG_DEBUG, "Hashing chunk"
" from %d to %d\n", local_packed_upto, local_packed_upto +
chunk_length);
uint64_t hash_value = right + (((uint64_t)left)<<32);
uint16_t advance_by = 0;
if(regular_cache.find(hash_value) != regular_cache.end()) {
printlog(logfile, system_loglevel, LOG_DEBUG, "Putting regular hash %llx for chunk length %d\n", hash_value, chunk_length);
advance_by += pack_hash_value(new_packet + local_packed_upto, left, right);
*dedup_flag = true;
printlog(logfile, system_loglevel, LOG_DEBUG, "Normal hit: "
"%.llx\n", (unsigned long long)hash_value);
} else if (feedback_cache.find(hash_value) !=
feedback_cache.end()) {
printlog(logfile, system_loglevel, LOG_DEBUG, "Putting feedback hash %llx for chunk length %d\n", hash_value, chunk_length);
advance_by += pack_hash_value(new_packet + local_packed_upto, left, right);
*dedup_flag = true;
printlog(logfile, system_loglevel, LOG_DEBUG, "Advert hit\
%.llx\n", (unsigned long long)hash_value);
feedback_cache.erase(hash_value);
} else {
开发者ID:bvattikonda,项目名称:asymmetric-caching,代码行数:28,代码来源:as_base_station.cpp
示例12: main
/************************* main *******************************/
int main() {
new_packet = (unsigned char *)malloc(MTU);
if(new_packet == NULL) {
printf("Malloc failed\n");
exit(EXIT_FAILURE);
}
struct nfq_handle *h = get_handle();
fd_set rfds;
// start the downstream code, later move to a thread
initializeRabin(powers);
int max_fd = 0;
int down_fd = createQueue(h, DOWN_MOBILE_QUEUE, &cbDown);
if(down_fd > max_fd)
max_fd = down_fd;
int up_fd = createQueue(h, UP_MOBILE_QUEUE, &cbUp);
if(up_fd > max_fd)
max_fd = up_fd;
printlog(logfile, system_loglevel, LOG_DEBUG,
"Queue packet descriptors, down_fd: %d, up_fd: %d\n",
down_fd, up_fd);
int n = 0, rv = 0;
char buf[4096] __attribute__ ((aligned));
nfnl_rcvbufsiz(nfq_nfnlh(h), 4096 * 4096);
while(true) {
FD_ZERO(&rfds);
FD_SET(down_fd, &rfds);
FD_SET(up_fd, &rfds);
n = select(max_fd + 1, &rfds, NULL, NULL, NULL);
if(n == -1) {
printlog(logfile, system_loglevel, LOG_CRITICAL,
"Select returned error: %s\n", strerror(errno));
}
if(FD_ISSET(down_fd, &rfds)) {
rv = recv(down_fd, buf, sizeof(buf), 0);
if(rv < 0) {
printlog(logfile, system_loglevel, LOG_CRITICAL,
"recv call failed: %s\n", strerror(errno));
} else {
nfq_handle_packet(h, buf, rv);
}
}
if(FD_ISSET(up_fd, &rfds)) {
rv = recv(up_fd, buf, sizeof(buf), 0);
if(rv < 0) {
printlog(logfile, system_loglevel, LOG_CRITICAL,
"recv call failed: %s\n", strerror(errno));
} else {
nfq_handle_packet(h, buf, rv);
}
}
}
// start the upstream code, later move to a thread
return 0;
}
开发者ID:bvattikonda,项目名称:asymmetric-caching,代码行数:60,代码来源:as_mobile.cpp
示例13: openvme
unsigned long openvme(void *vmeaddr,size_t vme_len, bool verbose)
{
printlog("opening device", true, verbose);
//** Fill the upper 3 bits
// const int vme_regA32_fd = open("/dev/mem", O_RDWR);
int vme_regA32_fd = open("/dev/mem", O_RDWR);
if( vme_regA32_fd == -1 ) {
printf("error: open #1 /dev/mem failed, exiting ...\n");
exit(-1);
}
// ... and map the part starting at offset 0xaa000000 to memory (with
// VME seg.size as minimal size, even if it's only one register to access).
//
// definition:
// void * mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
// See: http://www.freebsd.org/cgi/man.cgi?query=mmap
volatile void *const reg_A32_mmap
= mmap(NULL, VME_SegSize, (PROT_READ | PROT_WRITE), MAP_SHARED, vme_regA32_fd, 0xaa000000);
if( reg_A32_mmap == MAP_FAILED ) {
printf("error: mmap #1 failed, exiting ...\n");
exit(-1);
}
// Now write the upper three bits of the hardware base address into
// this special register.
unsigned long NewAddr, UpperAddr, LowerAddr;
NewAddr = (unsigned long)vmeaddr;
UpperAddr = NewAddr & 0xe0000000;
LowerAddr= NewAddr & 0x1fffffff;
*((unsigned long *)reg_A32_mmap) = UpperAddr ;
//** Fill the upper 3 bits End
vme_fd = open("/dev/mem", O_RDWR);
if( vme_fd == -1 ) {
printlog("Error opening vme device, aborting", true, verbose);
closeLog(verbose);
exit(1);
}
// vmevirtbase = mmap(NULL, VME_LENGTH, PROT_READ|PROT_WRITE, MAP_SHARED, vme_fd, 0x10000000 | VMEBUSPC_EXTOFFSET); //(off_t) vmeaddr
// vmevirtbase = mmap(NULL, VME_LENGTH, PROT_READ|PROT_WRITE, MAP_SHARED, vme_fd, ((unsigned long) vmeaddr) | VMEBUSPC_EXTOFFSET); //(off_t) vmeaddr
vmevirtbase = mmap(NULL, VME_LENGTH, PROT_READ|PROT_WRITE, MAP_SHARED, vme_fd, LowerAddr | VMEBUSPC_EXTOFFSET); //(off_t) vmeaddr
if (vmevirtbase==MAP_FAILED) {
printlog("memory mapping failed, aborting", true, verbose);
closeLog(verbose);
exit(1);
}
printlog("vme virtual base is located at: ", true, verbose);
printlogInt((unsigned long) vmevirtbase, verbose);
printlog("device open", true, verbose);
return (unsigned long) vmevirtbase;
}
开发者ID:A2-Collaboration,项目名称:a2vme,代码行数:58,代码来源:vuprom.c
示例14: emalloc
DATA *get_area_centre(DATA *area, DATA *d) {
int i, j;
DPOINT p;
d->n_list = d->n_max = 0;
d->variable = area->variable;
d->x_coord = area->x_coord;
d->y_coord = area->y_coord;
d->z_coord = area->z_coord;
d->type = data_types[area->type.type];
d->fname = "";
p.x = p.y = p.z = 0.0;
p.u.stratum = 0;
d->n_X = area->n_X;
if (area->n_X > 0) {
p.X = (double *) emalloc(area->n_X * sizeof(double));
d->colX = (int *) emalloc(area->n_X * sizeof(int));
for (j = 0; j < area->n_X; j++) {
p.X[j] = 0.0;
d->colX[j] = area->colX[j];
}
} else {
p.X = NULL;
d->colX = NULL;
}
for (i = 0; i < area->n_list; i++) {
p.x += area->list[i]->x;
p.y += area->list[i]->y;
p.z += area->list[i]->z;
for (j = 0; j < area->n_X; j++)
p.X[j] += area->list[i]->X[j];
}
p.x /= area->n_list;
p.y /= area->n_list;
p.z /= area->n_list;
for (j = 0; j < area->n_X; j++)
p.X[j] /= area->n_list;
p.attr = 0.0;
printlog("prediction centre at x=%g, y=%g, z=%g",p.x,p.y,p.z);
if (d->n_X) {
printlog(" where x0 averages [");
for (j = 0; j < area->n_X; j++)
printlog("%g%s", p.X[j], j<area->n_X-1?",":"");
printlog("]\n");
} else
printlog("\n");
push_point(d, &p);
d->minX = d->maxX = p.x;
d->minY = d->maxY = p.y;
d->minZ = d->maxZ = p.z;
d->mode = area->mode;
d->n_X = area->n_X;
calc_data_mean_std(d);
return d;
}
开发者ID:BenGraeler,项目名称:gstat,代码行数:57,代码来源:data.c
示例15: printlog
void Singledata::save(vector<string> liBigEntries)
{
printlog( "Save Data = " ,ID ) ;
readEntries();
printlog( "Save Data = ", ID ) ;
saveValues();
}
开发者ID:CuonDeveloper,项目名称:cuon,代码行数:9,代码来源:Singledata.cpp
示例16: emergency_quit
//if something goes wrong (after initing physics and graphics)
void emergency_quit (void)
{
printlog(0, "ERROR REQUIRES GAME TO STOP:\n");
free_all();
graphics_quit();
physics_quit();
exit (-1);
printlog(0, "WTF?!\n");
}
开发者ID:spontificus,项目名称:rcx,代码行数:11,代码来源:main.c
示例17: load
void Singledata::fillEntries(int i)
{
load(i);
printlog("fill Entries for " + toString(i) );
clearAllFields();
Gtk::TreeIter _newIter ;
iter = _newIter ;
typedef map<string,dataEntry>::const_iterator iM ;
dataEntries = oEntries.Entries;
for(iM i = dataEntries.begin(); i != dataEntries.end(); i++) {
_entry = i->second ;
printlog( "_entry " + _entry.get_nameOfEntry() + " verify_type = " + _entry.get_verifyTypeOfEntry() +" type = " + _entry.get_typeOfEntry() ) ;
// cout << "entry Value = " << firstRecord.row_string[_entry.get_nameOfSql()] << endl ;
if(_entry.get_verifyTypeOfEntry() == "string") {
string _Value = firstRecord.row_string[_entry.get_nameOfSql()];
if(_Value == "NONE") _Value = "";
//cout << "stringValue = " << _Value << endl ;
glx.setText(_entry,_Value);
}
else if (_entry.get_verifyTypeOfEntry() == "int") {
int _Value = firstRecord.row_int[_entry.get_nameOfSql()];
//cout << "intValue = " << _Value << endl ;
glx.setText(_entry,_Value);
}
else if (_entry.get_verifyTypeOfEntry() == "float") {
float _Value = firstRecord.row_float[_entry.get_nameOfSql()];
//cout << "floatValue = " << _Value << endl ;
glx.setText(_entry,toString(_Value) );
}
else if (_entry.get_verifyTypeOfEntry() == "datetime") {
string _Value = firstRecord.row_string[_entry.get_nameOfSql()];
//cout << "datetime Value = " << _Value << endl ;
glx.setText(_entry,_Value);
}
}
// printlog("now fill other and extra entries");
fillOtherEntries();
fillExtraEntries();
}
开发者ID:CuonDeveloper,项目名称:cuon,代码行数:55,代码来源:Singledata.cpp
示例18: qtree_print
void qtree_print(DATA *d) {
/*
* plot the full tree (2D), in a format that can be read by jgraph, found
* at netlib or at http://kenner.cs.utk.edu/~plank/plank/jgraph/jgraph.html
*/
printlog("newgraph\nxaxis size 3\nyaxis size 3\n");
printlog("title : %s [n = %d]\n",
name_identifier(d->id), d->n_list);
logprint_qtree(d->qtree_root, 0);
return;
}
开发者ID:BenGraeler,项目名称:gstat,代码行数:11,代码来源:nsearch.c
示例19: discard
void discard(list<item>::iterator it, int number)
{
item *temp2 = env[current_level].AddItem(you.position,&(*it),number);
temp2->drop = true;
printlog("당신은 ",false,false,false,CL_normal);
printlog(temp2->GetName(number),false,false,false,temp2->item_color());
printlog(temp2->GetNameInfor().name_to(true),false,false,false,CL_normal);
printlog("내려놓았다.",true,false,false,CL_normal);
you.DeleteItem(it,number);
changedisplay(DT_GAME);
you.time_delay+=you.GetNormalDelay();
you.TurnEnd();
}
开发者ID:kimjoy2002,项目名称:touhou_crawl,代码行数:13,代码来源:item_action.cpp
示例20: printlog
string SingleContact::getAddress(int _id)
{
string s1 = "";
x1.callRP("Address.getAddressField",x1.add(_id), s1);
printlog ("load Addressfield = " );
printlog("load Addressfield = " , s1);
return s1;
}
开发者ID:CuonDeveloper,项目名称:cuon,代码行数:14,代码来源:SingleContact.cpp
注:本文中的printlog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论