当前位置: 首页>>代码示例>>C++>>正文


C++ DLIST_REMOVE函数代码示例

本文整理汇总了C++中DLIST_REMOVE函数的典型用法代码示例。如果您正苦于以下问题:C++ DLIST_REMOVE函数的具体用法?C++ DLIST_REMOVE怎么用?C++ DLIST_REMOVE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DLIST_REMOVE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Logoff

/**
   \details Logoff an Exchange store

   This function uninitializes the MAPI session associated to the
   object.

   \param obj_store pointer to the store object

   \return MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND
 */
_PUBLIC_ enum MAPISTATUS Logoff(mapi_object_t *obj_store)
{
    struct mapi_context	*mapi_ctx;
    struct mapi_session	*session;
    struct mapi_session	*el;
    bool			found = false;

    /* Sanity checks */
    session = mapi_object_get_session(obj_store);
    OPENCHANGE_RETVAL_IF(!session, MAPI_E_INVALID_PARAMETER, NULL);

    mapi_ctx = session->mapi_ctx;
    OPENCHANGE_RETVAL_IF(!mapi_ctx, MAPI_E_NOT_INITIALIZED, NULL);

    for (el = mapi_ctx->session; el; el = el->next) {
        if (session == el) {
            found = true;
            mapi_object_release(obj_store);
            DLIST_REMOVE(mapi_ctx->session, el);
            MAPIFreeBuffer(session);
            break;
        }
    }

    return (found == true) ? MAPI_E_SUCCESS : MAPI_E_NOT_FOUND;
}
开发者ID:proxymoron,项目名称:openchange,代码行数:36,代码来源:IMSProvider.c

示例2: wrepl_socket_dead

/*
  mark all pending requests as dead - called when a socket error happens
*/
static void wrepl_socket_dead(struct wrepl_socket *wrepl_socket, NTSTATUS status)
{
	wrepl_socket->dead = True;

	if (wrepl_socket->packet) {
		packet_recv_disable(wrepl_socket->packet);
		packet_set_fde(wrepl_socket->packet, NULL);
		packet_set_socket(wrepl_socket->packet, NULL);
	}

	if (wrepl_socket->event.fde) {
		talloc_free(wrepl_socket->event.fde);
		wrepl_socket->event.fde = NULL;
	}

	if (wrepl_socket->sock) {
		talloc_free(wrepl_socket->sock);
		wrepl_socket->sock = NULL;
	}

	if (NT_STATUS_EQUAL(NT_STATUS_UNSUCCESSFUL, status)) {
		status = NT_STATUS_UNEXPECTED_NETWORK_ERROR;
	}
	while (wrepl_socket->recv_queue) {
		struct wrepl_request *req = wrepl_socket->recv_queue;
		DLIST_REMOVE(wrepl_socket->recv_queue, req);
		wrepl_request_finished(req, status);
	}

	talloc_set_destructor(wrepl_socket, NULL);
	if (wrepl_socket->free_skipped) {
		talloc_free(wrepl_socket);
	}
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:37,代码来源:winsrepl.c

示例3: tevent_signal_destructor

/*
  destroy a signal event
*/
static int tevent_signal_destructor(struct tevent_signal *se)
{
	struct tevent_common_signal_list *sl;
	sl = talloc_get_type(se->additional_data,
			     struct tevent_common_signal_list);

	if (se->event_ctx) {
		DLIST_REMOVE(se->event_ctx->signal_events, se);
	}

	talloc_free(sl);

	if (sig_state->sig_handlers[se->signum] == NULL) {
		/* restore old handler, if any */
		if (sig_state->oldact[se->signum]) {
			sigaction(se->signum, sig_state->oldact[se->signum], NULL);
			sig_state->oldact[se->signum] = NULL;
		}
#ifdef SA_SIGINFO
		if (se->sa_flags & SA_SIGINFO) {
			if (sig_state->sig_info[se->signum]) {
				talloc_free(sig_state->sig_info[se->signum]);
				sig_state->sig_info[se->signum] = NULL;
			}
		}
#endif
	}

	return 0;
}
开发者ID:AIdrifter,项目名称:samba,代码行数:33,代码来源:tevent_signal.c

示例4: process_blocking_lock_cancel_message

static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
						 void *private_data,
						 uint32_t msg_type,
						 struct server_id server_id,
						 DATA_BLOB *data)
{
	NTSTATUS err;
	const char *msg = (const char *)data->data;
	struct blocking_lock_record *blr;

	if (data->data == NULL) {
		smb_panic("process_blocking_lock_cancel_message: null msg");
	}

	if (data->length != MSG_BLOCKING_LOCK_CANCEL_SIZE) {
		DEBUG(0, ("process_blocking_lock_cancel_message: "
			  "Got invalid msg len %d\n", (int)data->length));
		smb_panic("process_blocking_lock_cancel_message: bad msg");
        }

	memcpy(&blr, msg, sizeof(blr));
	memcpy(&err, &msg[sizeof(blr)], sizeof(NTSTATUS));

	DEBUG(10,("process_blocking_lock_cancel_message: returning error %s\n",
		nt_errstr(err) ));

	blocking_lock_reply_error(blr, err);
	DLIST_REMOVE(blocking_lock_cancelled_queue, blr);
	TALLOC_FREE(blr);
}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:30,代码来源:blocking.c

示例5: svfs_close

/*
  close a file
*/
static NTSTATUS svfs_close(struct ntvfs_module_context *ntvfs,
			   struct ntvfs_request *req,
			   union smb_close *io)
{
	struct svfs_private *p = ntvfs->private_data;
	struct svfs_file *f;

	if (io->generic.level != RAW_CLOSE_CLOSE) {
		/* we need a mapping function */
		return NT_STATUS_INVALID_LEVEL;
	}

	f = find_fd(p, io->close.in.file.ntvfs);
	if (!f) {
		return NT_STATUS_INVALID_HANDLE;
	}

	if (close(f->fd) == -1) {
		return map_nt_error_from_unix(errno);
	}

	DLIST_REMOVE(p->open_files, f);
	talloc_free(f->name);
	talloc_free(f);

	return NT_STATUS_OK;
}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:30,代码来源:vfs_simple.c

示例6: tevent_common_signal_list_destructor

static int tevent_common_signal_list_destructor(struct tevent_common_signal_list *sl)
{
	if (sig_state->sig_handlers[sl->se->signum]) {
		DLIST_REMOVE(sig_state->sig_handlers[sl->se->signum], sl);
	}
	return 0;
}
开发者ID:AIdrifter,项目名称:samba,代码行数:7,代码来源:tevent_signal.c

示例7: elog_close_tdb

int elog_close_tdb( ELOG_TDB *etdb, bool force_close )
{
	TDB_CONTEXT *tdb;

	if ( !etdb )
		return 0;

	etdb->ref_count--;

	SMB_ASSERT( etdb->ref_count >= 0 );

	if ( etdb->ref_count == 0 ) {
		tdb = etdb->tdb;
		DLIST_REMOVE( open_elog_list, etdb );
		TALLOC_FREE( etdb );
		return tdb_close( tdb );
	}

	if ( force_close ) {
		tdb = etdb->tdb;
		etdb->tdb = NULL;
		return tdb_close( tdb );
	}

	return 0;
}
开发者ID:endisd,项目名称:samba,代码行数:26,代码来源:eventlog.c

示例8: fsp_free

void fsp_free(files_struct *fsp)
{
	struct smbd_server_connection *sconn = fsp->conn->sconn;

	DLIST_REMOVE(sconn->files, fsp);
	SMB_ASSERT(sconn->num_files > 0);
	sconn->num_files--;

	TALLOC_FREE(fsp->fake_file_handle);

	if (fsp->fh->ref_count == 1) {
		TALLOC_FREE(fsp->fh);
	} else {
		fsp->fh->ref_count--;
	}

	fsp->conn->num_files_open--;

	/* this is paranoia, just in case someone tries to reuse the
	   information */
	ZERO_STRUCTP(fsp);

	/* fsp->fsp_name is a talloc child and is free'd automatically. */
	TALLOC_FREE(fsp);
}
开发者ID:andrew-aladev,项目名称:samba-talloc-debug,代码行数:25,代码来源:files.c

示例9: srv_epmapper_delete_endpoints

bool srv_epmapper_delete_endpoints(struct pipes_struct *p)
{
	struct epm_Delete r;
	struct dcesrv_ep_entry_list *el = p->ep_entries;
	error_status_t result;

	while (el) {
		struct dcesrv_ep_entry_list *next = el->next;

		r.in.num_ents = el->num_ents;
		r.in.entries = el->entries;

		DEBUG(10, ("Delete_endpoints for: %s\n",
			   el->entries[0].annotation));

		result = _epm_Delete(p, &r);
		if (result != EPMAPPER_STATUS_OK) {
			return false;
		}

		DLIST_REMOVE(p->ep_entries, el);
		TALLOC_FREE(el);

		el = next;
	}

	return true;
}
开发者ID:themiron,项目名称:asuswrt-merlin,代码行数:28,代码来源:srv_epmapper.c

示例10: query_one_hostname

void query_one_hostname(){
	smb_srv_info_t *p;
	for (p = smb_srv_info_list; p; p = p->next) {

		if(strcmp(p->name->ptr, "")!=0){
			continue;
		}

		if(p->id==0){
			Cdbg(DBE, "query_one_hostname [%s]\n", p->ip->ptr);
			//continue;
		}

		char* hostname = smbc_nmblookup(p->ip->ptr);
		
		if(hostname==NULL){
			//Cdbg(DBE, "\t\tCan't query samba server name[%s]\n", p->ip->ptr);

			buffer_free(p->ip);
			buffer_free(p->mac);
			buffer_free(p->name);
			
			DLIST_REMOVE(smb_srv_info_list, p);
			free(p);
		}
		else{
			buffer_copy_string(p->name, hostname);
		}
	}
}
开发者ID:heartshare,项目名称:asuswrt-merlin,代码行数:30,代码来源:~arpping_thread.c

示例11: SMBC_remove_unused_server

/* 
 * Remove a server from the cached server list it's unused.
 * On success, 0 is returned. 1 is returned if the server could not be removed.
 * 
 * Also useable outside libsmbclient
 */
int
SMBC_remove_unused_server(SMBCCTX * context,
                          SMBCSRV * srv)
{
	SMBCFILE * file;

	/* are we being fooled ? */
	if (!context || !context->internal->initialized || !srv) {
                return 1;
        }

	/* Check all open files/directories for a relation with this server */
	for (file = context->internal->files; file; file = file->next) {
		if (file->srv == srv) {
			/* Still used */
			DEBUG(3, ("smbc_remove_usused_server: "
                                  "%p still used by %p.\n",
				  srv, file));
			return 1;
		}
	}

	DLIST_REMOVE(context->internal->servers, srv);

	cli_shutdown(srv->cli);
	srv->cli = NULL;

	DEBUG(3, ("smbc_remove_usused_server: %p removed.\n", srv));

	smbc_getFunctionRemoveCachedServer(context)(context, srv);

        SAFE_FREE(srv);
	return 0;
}
开发者ID:ebrainte,项目名称:Samba,代码行数:40,代码来源:libsmb_server.c

示例12: invalidate_vuid

void invalidate_vuid(uint16 vuid)
{
	user_struct *vuser = get_valid_user_struct(vuid);

	if (vuser == NULL)
		return;
	
	SAFE_FREE(vuser->homedir);
	SAFE_FREE(vuser->unix_homedir);
	SAFE_FREE(vuser->logon_script);
	
	session_yield(vuser);
	SAFE_FREE(vuser->session_keystr);

	free_server_info(&vuser->server_info);

	data_blob_free(&vuser->session_key);

	DLIST_REMOVE(validated_users, vuser);

	/* clear the vuid from the 'cache' on each connection, and
	   from the vuid 'owner' of connections */
	conn_clear_vuid_cache(vuid);

	SAFE_FREE(vuser->groups);
	delete_nt_token(&vuser->nt_user_token);
	SAFE_FREE(vuser);
	num_validated_vuids--;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:29,代码来源:password.c

示例13: remove_child_pid

static void remove_child_pid(struct smbd_parent_context *parent,
			     pid_t pid,
			     bool unclean_shutdown)
{
	struct smbd_child_pid *child;
	struct server_id child_id;
	int ret;

	child_id = pid_to_procid(pid);

	ret = messaging_cleanup(parent->msg_ctx, pid);

	if ((ret != 0) && (ret != ENOENT)) {
		DEBUG(10, ("%s: messaging_cleanup returned %s\n",
			   __func__, strerror(ret)));
	}

	smbprofile_cleanup(pid);

	for (child = parent->children; child != NULL; child = child->next) {
		if (child->pid == pid) {
			struct smbd_child_pid *tmp = child;
			DLIST_REMOVE(parent->children, child);
			TALLOC_FREE(tmp);
			parent->num_children -= 1;
			break;
		}
	}

	if (child == NULL) {
		/* not all forked child processes are added to the children list */
		DEBUG(2, ("Could not find child %d -- ignoring\n", (int)pid));
		return;
	}

	if (unclean_shutdown) {
		/* a child terminated uncleanly so tickle all
		   processes to see if they can grab any of the
		   pending locks
                */
		DEBUG(3,(__location__ " Unclean shutdown of pid %u\n",
			(unsigned int)pid));
		if (parent->cleanup_te == NULL) {
			/* call the cleanup timer, but not too often */
			int cleanup_time = lp_parm_int(-1, "smbd", "cleanuptime", 20);
			parent->cleanup_te = tevent_add_timer(parent->ev_ctx,
						parent,
						timeval_current_ofs(cleanup_time, 0),
						cleanup_timeout_fn,
						parent);
			DEBUG(1,("Scheduled cleanup of brl and lock database after unclean shutdown\n"));
		}
	}

	if (!serverid_deregister(child_id)) {
		DEBUG(1, ("Could not remove pid %d from serverid.tdb\n",
			  (int)pid));
	}
}
开发者ID:aoa141,项目名称:samba,代码行数:59,代码来源:server.c

示例14: smb2srv_request_destructor

static int smb2srv_request_destructor(struct smb2srv_request *req)
{
	DLIST_REMOVE(req->smb_conn->requests2.list, req);
	if (req->pending_id) {
		idr_remove(req->smb_conn->requests2.idtree_req, req->pending_id);
	}
	return 0;
}
开发者ID:srimalik,项目名称:samba,代码行数:8,代码来源:receive.c

示例15: wrepl_request_destructor

/*
  destroy a wrepl_request
*/
static int wrepl_request_destructor(struct wrepl_request *req)
{
    if (req->state == WREPL_REQUEST_RECV) {
        DLIST_REMOVE(req->wrepl_socket->recv_queue, req);
    }
    req->state = WREPL_REQUEST_ERROR;
    return 0;
}
开发者ID:gojdic,项目名称:samba,代码行数:11,代码来源:winsrepl.c


注:本文中的DLIST_REMOVE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。