本文整理汇总了C++中release_buffer函数的典型用法代码示例。如果您正苦于以下问题:C++ release_buffer函数的具体用法?C++ release_buffer怎么用?C++ release_buffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了release_buffer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: make_map
void make_map(int map[21][21], char *output, int chsec) {
int x,y;
char *result;
sprintf(output, "\r\n%s\r\n", "-----------------------");
for(y=0;y<21;y++) {
strcat(output, "|");
for(x=0;x<21;x++) {
switch(map[x][y]) {
case 100:
strcat(output, " ");
break;
case 75:
strcat(output, "\x1B[39;1m:\x1B[0m");
break;
case 50:
result = get_buffer(64);
sprintf(result, "\x1B[%s;31;[email protected]\x1B[0m", scodes[chsec].back);
strcat(output, result);
release_buffer(result);
break;
default:
result = get_buffer(64);
sprintf(result,"\x1B[%s;%sm%s\x1B[0m",
scodes[map[x][y]].back, scodes[map[x][y]].fore,
scodes[map[x][y]].sym);
strcat(output, result);
release_buffer(result);
break;
}
}
strcat(output, "|\r\n");
}
strcat(output,"-----------------------\r\n");
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:34,代码来源:map.c
示例2: find_help_entry
int find_help_entry(const char *argument)
{
int rec_count;
MYSQL_RES *helpindex;
char *searcharg=NULL, *line;
if (!*argument)
return (0);
line = str_dup(argument);
SQL_MALLOC(LOWERALL(line), searcharg);
SQL_ESC(LOWERALL(line), searcharg);
if (!(helpindex = mysqlGetResource(TABLE_HLP_INDEX, "SELECT keyword FROM %s WHERE keyword LIKE '%%%s%%' LIMIT 1;", TABLE_HLP_INDEX, searcharg))) {
if (*searcharg)
SQL_FREE(searcharg);
release_buffer(line);
return (0);
}
release_buffer(line);
rec_count = mysql_num_rows(helpindex);
mysql_free_result(helpindex);
if (*searcharg)
SQL_FREE(searcharg);
if (rec_count == 1)
return (1);
return (0);
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:34,代码来源:act.help.c
示例3: cdfs_find_in_dir
static int cdfs_find_in_dir(struct cdfs *cdfs, int dir, char *name, int len, struct buf **dirbuf, struct iso_directory_record **dirrec) {
struct buf *buf;
char *p;
struct iso_directory_record *rec;
int blk;
int left;
int reclen;
int namelen;
// The first two directory records are . (current) and .. (parent)
blk = cdfs->path_table[dir]->extent;
buf = get_buffer(cdfs->cache, blk++);
if (!buf) return -EIO;
// Get length of directory from the first record
p = buf->data;
rec = (struct iso_directory_record *) p;
left = isonum_733(rec->size);
// Find named entry in directory
while (left > 0) {
// Read next block if all records in current block has been read
// Directory records never cross block boundaries
if (p >= buf->data + CDFS_BLOCKSIZE) {
release_buffer(cdfs->cache, buf);
if (p > buf->data + CDFS_BLOCKSIZE) return -EIO;
buf = get_buffer(cdfs->cache, blk++);
if (!buf) return -EIO;
p = buf->data;
}
// Check for match
rec = (struct iso_directory_record *) p;
reclen = isonum_711(rec->length);
namelen = isonum_711(rec->name_len);
if (reclen > 0) {
if (cdfs_fnmatch(cdfs, name, len, (char *) rec->name, namelen)) {
*dirrec = rec;
*dirbuf = buf;
return 0;
}
// Skip to next record
p += reclen;
left -= reclen;
} else {
// Skip to next block
left -= (buf->data + CDFS_BLOCKSIZE) - p;
p = buf->data + CDFS_BLOCKSIZE;
}
}
release_buffer(cdfs->cache, buf);
return -ENOENT;
}
开发者ID:HarryR,项目名称:sanos,代码行数:56,代码来源:cdfs.c
示例4: list_wands_staves
void list_wands_staves (struct char_data *ch, char *input)
{
int type=0;
int i=0;
int j=0;
int k=0;
char *wsbuf = get_buffer(MAX_STRING_LENGTH);
skip_spaces(&input);
switch (input[0]) {
case 'T':
case 't':
type = ITEM_STAFF;
break;
case 'W':
case 'w':
type = ITEM_WAND;
break;
default:
extended_mudlog(NRM, SYSL_BUGS, TRUE, "Default reached in list_scrolls_potions (arg = %s)", input);
release_buffer(wsbuf);
return;
} /*switch...*/
wsbuf[0]='\0';
for (i=0;i<top_of_objt;i++) {
j=obj_proto[i].obj_flags.type_flag; /*look for specific sort of item*/
if (j == type) { /*found one*/
sprintf(wsbuf+strlen(wsbuf),"[%5d] %-30s", /*print vnum, short description*/
GET_OBJ_VNUM(&obj_proto[i]),
obj_proto[i].short_description);
/*
* values 0-3:
* Potion, Scroll - up to three spells [values 1-3]
*/
sprintf(wsbuf+strlen(wsbuf), " Spells: ");
if (type==ITEM_STAFF) { /*staves have only one spell*/
if ((GET_OBJ_VAL(&obj_proto[i], 3)) != (-1))
sprintf(wsbuf+strlen(wsbuf), "%s ", skill_name(GET_OBJ_VAL(&obj_proto[i], 3)));
} else {
for (k=1; k < 4; k++) {
if ((GET_OBJ_VAL(&obj_proto[i], k)) != (-1))
sprintf(wsbuf+strlen(wsbuf), "%s ", skill_name(GET_OBJ_VAL(&obj_proto[i], k)));
}
sprintf(wsbuf+strlen(wsbuf), "\r\n");
}
} /*if j == type*/
} /*for i...*/
page_string (ch->desc, wsbuf, 1);
release_buffer(wsbuf);
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:53,代码来源:reports.c
示例5: release_buffer
int BIKPlayer::EndVideo()
{
int i;
release_buffer(&c_pic);
release_buffer(&c_last);
for (i = 0; i < BINK_NB_SRC; i++) {
av_freep((void **) &c_bundle[i].data);
}
video->DrawMovieSubtitle(0);
return 0;
}
开发者ID:scriptedfate,项目名称:gemrb,代码行数:12,代码来源:BIKPlayer.cpp
示例6: list_scrolls_potions
void list_scrolls_potions (struct char_data *ch, char *input)
{
int type=0;
int i=0;
int j=0;
int k=0;
char *spbuf = get_buffer(MAX_STRING_LENGTH);
skip_spaces(&input);
switch (input[0]) {
case 'S':
case 's':
type = ITEM_SCROLL;
break;
case 'P':
case 'p':
type = ITEM_POTION;
break;
default :
mlog("SYSERR: Default reached in list_scrolls_potions (arg = %s)", input);
release_buffer(spbuf);
return;
}/*switch...*/
spbuf[0]='\0';
for (i=0;i<top_of_objt;i++) {
j=obj_proto[i].obj_flags.type_flag; /*look for specific sort of item*/
if (j == type) { /*found one*/
sprintf(spbuf+strlen(spbuf),"[%5d] %-20s", /*print vnum, short description*/
GET_OBJ_VNUM(&obj_proto[i]),
obj_proto[i].short_description);
/*
* values 0-3:
* Potion, Scroll - up to three spells [values 1-3]
*/
sprintf(spbuf+strlen(spbuf), " Spells: ");
for (k=1;k<4;k++) {
if ((GET_OBJ_VAL(&obj_proto[i], k)) != (-1))
sprintf(spbuf+strlen(spbuf), "%s ", skill_name(GET_OBJ_VAL(&obj_proto[i], k)));
}
sprintf(spbuf+strlen(spbuf), "\r\n");
}/*if j == type*/
}/*for i...*/
page_string (ch->desc, spbuf, 1);
release_buffer(spbuf);
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:51,代码来源:reports.c
示例7: do_list_wear
void do_list_wear (struct char_data *ch, char *input)
{
char j = atoi(input);
int i=0;
char *wbuf = get_buffer(MAX_STRING_LENGTH);
if (input[0] == '?') {
j=0;
send_to_char ("Wear positions:\r\n", ch);
for (i = 0; i < NUM_ITEM_WEARS; i++) {
sprintf(buf, "(%2d) %-20.20s %s",
i + 1, wear_bits[i],
!(++j % 2) ? "\r\n" : "");
send_to_char(buf, ch);
}
send_to_char("\r\nIf you choose TAKE, you will be shown item that are !Take\r\n",ch);
release_buffer(wbuf);
return;
}
wbuf[0]='\0';
j--; /*to be used with NAMES array*/
if (j==0) { /*Show ony !Take items for this option*/
for (i=0;i<top_of_objt;i++) /*cycle through every obj*/
if (!(CAN_WEAR(&obj_proto[i], (1<<j)))) { /*check exact bit for requested position*/
sprintf(wbuf+strlen(wbuf),"[%5d] %-32s !TAKE\r\n",
GET_OBJ_VNUM(&obj_proto[i]),
obj_proto[i].short_description);
}
page_string (ch->desc, wbuf, 1);
release_buffer(wbuf);
return;
}
for (i=0;i<top_of_objt;i++) { /*cycle through every obj*/
if (CAN_WEAR(&obj_proto[i], (1<<j))) { /*check exact bit for requested position*/
sprintf(wbuf+strlen(wbuf),"[%5d] %-32s ",
GET_OBJ_VNUM(&obj_proto[i]),
obj_proto[i].short_description);
sprintf(wbuf+strlen(wbuf),"%s\r\n", wear_bits[(int)j]); /*repeat position*/
}
}
if (!buf)
send_to_char("There are no items of that type in the object files.c",ch);
page_string (ch->desc, wbuf, 1);
release_buffer(wbuf);
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:50,代码来源:reports.c
示例8: cdfs_stat
int cdfs_stat(struct fs *fs, char *name, struct stat64 *buffer) {
struct cdfs *cdfs = (struct cdfs *) fs->data;
struct iso_directory_record *rec;
struct buf *buf;
int rc;
int size;
rc = cdfs_find_file(cdfs, name, strlen(name), &buf, &rec);
if (rc < 0) return rc;
size = isonum_733(rec->size);
if (buffer) {
memset(buffer, 0, sizeof(struct stat64));
if (rec->flags[0] & 2) {
buffer->st_mode = S_IFDIR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
} else {
buffer->st_mode = S_IFREG | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
}
buffer->st_ino = isonum_733(rec->extent);
buffer->st_nlink = 1;
buffer->st_dev = cdfs->devno;
buffer->st_atime = buffer->st_mtime = buffer->st_ctime = cdfs_isodate(rec->date);
buffer->st_size = size;
};
release_buffer(cdfs->cache, buf);
return size;
}
开发者ID:HarryR,项目名称:sanos,代码行数:31,代码来源:cdfs.c
示例9: intel_bufferobj_buffer
drm_intel_bo *
intel_bufferobj_buffer(struct intel_context *intel,
struct intel_buffer_object *intel_obj,
GLuint flag)
{
if (intel_obj->region) {
if (flag == INTEL_WRITE_PART)
intel_bufferobj_cow(intel, intel_obj);
else if (flag == INTEL_WRITE_FULL) {
intel_bufferobj_release_region(intel, intel_obj);
intel_bufferobj_alloc_buffer(intel, intel_obj);
}
}
if (intel_obj->source)
release_buffer(intel_obj);
if (intel_obj->buffer == NULL) {
intel_bufferobj_alloc_buffer(intel, intel_obj);
drm_intel_bo_subdata(intel_obj->buffer,
0, intel_obj->Base.Size,
intel_obj->sys_buffer);
free(intel_obj->sys_buffer);
intel_obj->sys_buffer = NULL;
intel_obj->offset = 0;
}
return intel_obj->buffer;
}
开发者ID:nikai3d,项目名称:mesa,代码行数:30,代码来源:intel_buffer_objects.c
示例10: smtp_from
// ------------------------------------------------
// Function: smtp_from()
// ------------------------------------------------
// Input: Sender email address
// Output: TRUE if succesful
// ------------------------------------------------
// Description: Adds one MAIL FROM clause
// ------------------------------------------------
BOOL smtp_from(char *s)
{
PPBUF buf;
BOOL res;
if(smtp_state != SMTP_FROM) return FALSE;
// ----------------------
// send MAIL FROM command
// ----------------------
buf = tcp_new(SOCKET_SMTP);
if(buf == NULL) return FALSE;
write_string(buf, "MAIL FROM:<");
write_string(buf, s);
write_string(buf, ">\r\n");
res = tcp_send(SOCKET_SMTP, buf);
release_buffer(buf);
if(!res) return FALSE;
if(!smtp_ok()) return FALSE;
smtp_state = SMTP_RCPT;
return TRUE;
}
开发者ID:BrunoBasseto,项目名称:Hermes,代码行数:33,代码来源:smtp.c
示例11: cdfs_opendir
int cdfs_opendir(struct file *filp, char *name) {
struct cdfs *cdfs = (struct cdfs *) filp->fs->data;
struct iso_directory_record *rec;
struct cdfs_file *cdfile;
struct buf *buf;
time_t date;
int size;
int extent;
int flags;
int rc;
// Locate directory
rc = cdfs_find_file(cdfs, name, strlen(name), &buf, &rec);
if (rc < 0) return rc;
flags = isonum_711(rec->flags);
extent = isonum_733(rec->extent);
date = cdfs_isodate(rec->date);
size = isonum_733(rec->size);
release_buffer(cdfs->cache, buf);
if (!(flags & 2)) return -ENOTDIR;
// Allocate and initialize file block
cdfile = (struct cdfs_file *) kmalloc(sizeof(struct cdfs_file));
if (!cdfile) return -ENOMEM;
cdfile->extent = extent;
cdfile->date = date;
cdfile->size = size;
filp->data = cdfile;
filp->mode = S_IFDIR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
return 0;
}
开发者ID:HarryR,项目名称:sanos,代码行数:34,代码来源:cdfs.c
示例12: read_stderr
/**
* @brief read process stderr
* @param c the child to read stderr from
* @returns 0 on success, -1 on error.
*/
int read_stderr(child_node *c) {
buffer bigbuff;
char buff[255];
char *line;
int count, ret;
ret = 0;
memset(&(bigbuff), 0, sizeof(buffer));
while((count=read(c->stderr_fd, buff, 255)) > 0) {
if(append_to_buffer(&(bigbuff), buff, count)) {
ret = -1;
goto exit;
}
while((line = get_line_from_buffer(&(bigbuff)))) {
ret = on_cmd_stderr(c, line);
free(line);
if(ret)
goto exit;
}
}
exit:
if(count<0) {
print( ERROR, "read: %s", strerror(errno));
ret = -1;
}
release_buffer(&(bigbuff));
return ret;
}
开发者ID:Monkey-Media,项目名称:daemon,代码行数:40,代码来源:child.c
示例13: intel_bufferobj_data
/**
* The BufferData() driver hook.
*
* Implements glBufferData(), which recreates a buffer object's data store
* and populates it with the given data, if present.
*
* Any data that was previously stored in the buffer object is lost.
*
* \return true for success, false if out of memory
*/
static GLboolean
intel_bufferobj_data(struct gl_context * ctx,
GLenum target,
GLsizeiptrARB size,
const GLvoid * data,
GLenum usage, struct gl_buffer_object *obj)
{
struct brw_context *brw = brw_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
/* Part of the ABI, but this function doesn't use it.
*/
(void) target;
intel_obj->Base.Size = size;
intel_obj->Base.Usage = usage;
assert(!obj->Pointer); /* Mesa should have unmapped it */
if (intel_obj->buffer != NULL)
release_buffer(intel_obj);
if (size != 0) {
intel_bufferobj_alloc_buffer(brw, intel_obj);
if (!intel_obj->buffer)
return false;
if (data != NULL)
drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
}
return true;
}
开发者ID:DirectFB,项目名称:mesa,代码行数:43,代码来源:intel_buffer_objects.c
示例14: intel_bufferobj_subdata
/**
* Replace data in a subrange of buffer object. If the data range
* specified by size + offset extends beyond the end of the buffer or
* if data is NULL, no copy is performed.
* Called via glBufferSubDataARB().
*/
static void
intel_bufferobj_subdata(struct gl_context * ctx,
GLintptrARB offset,
GLsizeiptrARB size,
const GLvoid * data, struct gl_buffer_object *obj)
{
struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
bool busy;
if (size == 0)
return;
assert(intel_obj);
/* If we have a single copy in system memory, update that */
if (intel_obj->sys_buffer) {
if (intel_obj->source)
release_buffer(intel_obj);
if (intel_obj->buffer == NULL) {
memcpy((char *)intel_obj->sys_buffer + offset, data, size);
return;
}
free(intel_obj->sys_buffer);
intel_obj->sys_buffer = NULL;
}
/* Otherwise we need to update the copy in video memory. */
busy =
drm_intel_bo_busy(intel_obj->buffer) ||
drm_intel_bo_references(intel->batch.bo, intel_obj->buffer);
if (busy) {
if (size == intel_obj->Base.Size) {
/* Replace the current busy bo with fresh data. */
drm_intel_bo_unreference(intel_obj->buffer);
intel_bufferobj_alloc_buffer(intel, intel_obj);
drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
} else {
perf_debug("Using a blit copy to avoid stalling on %ldb "
"glBufferSubData() to a busy buffer object.\n",
(long)size);
drm_intel_bo *temp_bo =
drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64);
drm_intel_bo_subdata(temp_bo, 0, size, data);
intel_emit_linear_blit(intel,
intel_obj->buffer, offset,
temp_bo, 0,
size);
drm_intel_bo_unreference(temp_bo);
}
} else {
drm_intel_bo_subdata(intel_obj->buffer, offset, size, data);
}
}
开发者ID:blckshrk,项目名称:Mesa,代码行数:66,代码来源:intel_buffer_objects.c
示例15: ping_request
// ------------------------------------------------
// Function: ping_request()
// ------------------------------------------------
// Input: IP address
// Network interface ID
// Output: -
// ------------------------------------------------
// Description: Sends a ping request message
// ------------------------------------------------
void ping_request(IPV4 ip, BYTE interface)
{
PPBUF buf;
buf = ip_new(ip, 64, interface);
if(buf == NULL) return;
// ---------------------
// assemble ICMP message
// ---------------------
IPH(buf->start)->prot = IP_PROT_ICMP;
ICMP(buf->data)->type = PING_REQUEST;
ICMP(buf->data)->code = 0;
ICMP(buf->data)->checksum = 0;
ICMP(buf->data)->id = random();
ICMP(buf->data)->seq = random();
buf->size = sizeof(ICMP_HDR);
// ------------------
// calculate checksum
// ------------------
icmp_checksum(buf->data, buf->size);
ICMP(buf->data)->checksum = HTONS(~WORDOF(chk_H, chk_L));
// -----------------------------
// sends message to IP interface
// -----------------------------
ip_send(buf);
release_buffer(buf);
}
开发者ID:BrunoBasseto,项目名称:Hermes,代码行数:39,代码来源:icmp.c
示例16: bio_do_io
static ssize_t bio_do_io(struct bio_vec *vec, char *iobuf, size_t len,
size_t pos, int rw)
{
size_t nr_bytes = 0;
blkcnt_t blocks = io_block_count(vec->blksize, pos, len);
blkcnt_t first_block = io_off_to_block(vec->blksize, pos);
off_t start = io_block_off(vec->blksize, pos);
off_t end = MIN((unsigned long)vec->blksize, start + len);
for (blkcnt_t b = first_block; b - first_block < blocks; b++) {
// do I/O within a single block
struct buffer *buffer = read_block(vec->dev, vec->block[b],
vec->blksize);
if (rw == READ) {
memcpy(iobuf+nr_bytes, buffer->b_data+start, end-start);
} else {
memcpy(buffer->b_data+start, iobuf+nr_bytes, end-start);
buffer->b_flags |= BUF_DIRTY;
}
release_buffer(buffer);
// update counts
nr_bytes += end - start;
start = 0;
end = MIN((unsigned long)vec->blksize, len - nr_bytes);
}
return nr_bytes;
}
开发者ID:drewt,项目名称:Telos,代码行数:28,代码来源:rw_block.c
示例17: dfs_write
int dfs_write(struct file *filp, void *data, size_t size)
{
struct inode *inode;
size_t written;
size_t count;
char *p;
unsigned int iblock;
unsigned int start;
vfs_blkno_t blk;
struct buf *buf;
inode = (struct inode *) filp->data;
written = 0;
p = (char *) data;
while (size > 0)
{
iblock = filp->pos / inode->fs->blocksize;
start = filp->pos % inode->fs->blocksize;
count = inode->fs->blocksize - start;
if (count > size) count = size;
if (iblock < inode->desc->blocks)
blk = get_inode_block(inode, iblock);
else if (iblock == inode->desc->blocks)
blk = expand_inode(inode);
else
return written;
if (blk == -1) return written;
if (count == inode->fs->blocksize)
buf = alloc_buffer(inode->fs->cache, blk);
else
buf = get_buffer(inode->fs->cache, blk);
if (!buf) return written;
memcpy(buf->data + start, p, count);
filp->flags |= F_MODIFIED;
mark_buffer_updated(buf);
release_buffer(inode->fs->cache, buf);
filp->pos += count;
p += count;
written += count;
size -= count;
if (filp->pos > inode->desc->size)
{
inode->desc->size = filp->pos;
mark_inode_dirty(inode);
}
}
return written;
}
开发者ID:HarryR,项目名称:sanos,代码行数:58,代码来源:file.c
示例18: main
int main(int argc, char* argv[]) {
SharedVariable v;
int runningTimeInSec = 10;
if (argc == 2) {
runningTimeInSec = atoi(argv[1]);
}
if (wiringPiSetup() == -1) {
printf("Failed to setup wiringPi.");
return 1;
}
printf("start");
// Initialize for the interfaces provided
signal(SIGINT, signal_handler);
init_deferred_buffer(1024*1024); // 1MB
init_userspace_governor();
init_workload();
printf("stop");
// Initializers that you need to implement
init_shared_variable(&v);
init_sensors(&v);
learn_workloads(&v);
printf("Init scheduler start");
// Init scheduler
int aliveTasks[NUM_TASKS];
init_scheduler(runningTimeInSec);
set_by_max_freq(); // reset to the max freq
printf("Init scheduler stop");
printDBG("Start Scheduling with %d threads\n", NUM_TASKS);
TaskSelection sel;
long long idleTime;
while (v.bProgramExit != 1) {
// 1. Prepare tasks
idleTime = prepare_tasks(aliveTasks, &v);
if (idleTime < 0)
break;
// 2. Select a process: You need to implement.
sel = select_task(&v, aliveTasks, idleTime);
if (sel.task < 0)
break;
// 3. Run the selected task
execute_task(sel);
}
finish_workload();
release_buffer(fileno(stdout));
printf("Scheduler program finished.\n");
return 0;
}
开发者ID:jluttrell,项目名称:cse190_edf_scheduling,代码行数:57,代码来源:main_section2.c
示例19: display_help_categories
/*
* Help categories are fairly static, and it would be a pain to execute another
* query just to get them, so we've already read them in in db.c into an array,
* and here we just loop them over.
* Torgny Bjers, 2001-11-12
*/
void display_help_categories(struct char_data *ch)
{
int qend, i;
char *name, *help = get_buffer(MAX_STRING_LENGTH);
MYSQL_RES *stats;
MYSQL_ROW row;
int numentries = 0;
time_t modified;
strcpy(help, "&CARCANE REALMS HELP TOPICS&n\r\n\r\nType 'HELP <topic>' for more information on a specific topic.\r\nYou can use HELP ? <search phrase> to issue a fulltext search.\r\n\r\n");
for (qend = 0, i = 0; i <= top_of_help_categories; i++) {
if (!GOT_RIGHTS(ch, help_categories[i].rights) && !GOT_RIGHTS(ch, RIGHTS_HELPFILES))
continue;
name = str_dup(help_categories[i].name);
sprintf(help + strlen(help), "%s%-22.22s", ((qend % 3 == 0)?" ":""), ALLCAP(name));
release_buffer(name);
if (qend++ % 3 == 2) {
strcat(help, "\r\n");
send_to_char(help, ch);
*help = '\0';
}
}
if (*help)
send_to_char(help, ch);
if (!(--qend % 3 == 2))
send_to_char("\r\n", ch);
*help = '\0';
release_buffer(help);
if (!(stats = mysqlGetResource(TABLE_HLP_INDEX, "SELECT COUNT(keyword) AS count, MAX(modified) AS modfied FROM %s ORDER BY modified;", TABLE_HLP_INDEX))) {
send_to_char("&YA database error has occured. Please notify an administrator.&n\r\n", ch);
extended_mudlog(NRM, SYSL_BUGS, TRUE, "Error loading help statistics.");
return;
}
mysql_free_result(stats);
row = mysql_fetch_row(stats);
modified = atoi(row[1]);
numentries = atoi(row[0]);
send_to_charf(ch, "\r\nThere are &W%d&n help entries, latest updated: &W%s&n", numentries, ctime(&modified));
}
开发者ID:tbjers,项目名称:arcanerealms,代码行数:50,代码来源:act.help.c
示例20: intel_bufferobj_release_region
/* Break the COW tie to the region. The region gets to keep the data.
*/
void
intel_bufferobj_release_region(struct intel_context *intel,
struct intel_buffer_object *intel_obj)
{
assert(intel_obj->region->buffer == intel_obj->buffer);
intel_obj->region->pbo = NULL;
intel_obj->region = NULL;
release_buffer(intel_obj);
}
开发者ID:nikai3d,项目名称:mesa,代码行数:12,代码来源:intel_buffer_objects.c
注:本文中的release_buffer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论