本文整理汇总了C++中ArrayList_Count函数的典型用法代码示例。如果您正苦于以下问题:C++ ArrayList_Count函数的具体用法?C++ ArrayList_Count怎么用?C++ ArrayList_Count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ArrayList_Count函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: xf_event_execute_action_script
static BOOL xf_event_execute_action_script(xfContext* xfc, XEvent* event)
{
int index;
int count;
char* name;
FILE* actionScript;
BOOL match = FALSE;
const char* xeventName;
char buffer[1024] = { 0 };
char command[1024] = { 0 };
if (!xfc->actionScript || !xfc->xevents)
return FALSE;
if (event->type > (sizeof(X11_EVENT_STRINGS) / sizeof(const char*)))
return FALSE;
xeventName = X11_EVENT_STRINGS[event->type];
count = ArrayList_Count(xfc->xevents);
for (index = 0; index < count; index++)
{
name = (char*) ArrayList_GetItem(xfc->xevents, index);
if (_stricmp(name, xeventName) == 0)
{
match = TRUE;
break;
}
}
if (!match)
return FALSE;
sprintf_s(command, sizeof(command), "%s xevent %s %lu",
xfc->actionScript, xeventName, (unsigned long) xfc->window->handle);
actionScript = popen(command, "r");
if (!actionScript)
return FALSE;
while (fgets(buffer, sizeof(buffer), actionScript))
{
strtok(buffer, "\n");
}
pclose(actionScript);
return TRUE;
}
开发者ID:awakecoding,项目名称:FreeRDP,代码行数:49,代码来源:xf_event.c
示例2: tsmf_presentation_sync
void tsmf_presentation_sync(TSMF_PRESENTATION* presentation)
{
UINT32 index;
UINT32 count;
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
TSMF_STREAM* stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);
WaitForSingleObject(stream->ready, 500);
}
ArrayList_Unlock(presentation->stream_list);
}
开发者ID:EmiyaShilong,项目名称:FreeRDP,代码行数:15,代码来源:tsmf_media.c
示例3: if
void RDPListener::on_property_call(Glib::VariantBase &property,
const Glib::RefPtr<Gio::DBus::Connection> &,
const Glib::ustring &,
const Glib::ustring &,
const Glib::ustring &,
const Glib::ustring &property_name)
{
if (property_name == "Port") {
property = Glib::Variant<uint16_t>::create(port);
} else if (property_name == "NumConnectedPeers") {
property = Glib::Variant<uint32_t>::create(ArrayList_Count(this->server->clients));
} else if (property_name == "RequiresAuthentication") {
property = Glib::Variant<bool>::create(authenticating);
}
}
开发者ID:datto,项目名称:RDPMux,代码行数:15,代码来源:RDPListener.cpp
示例4: AreaFilter_CreateHull
int AreaFilter_CreateHull (AreaFilter* self, ArrayList* points)
{
int u = AreaFilter_MakeChain (self, points, AreaFilter_CompareLow);
if (ArrayList_Count(points) == 0)
return (0);
/*
int k;
for (k = 0 ; k < u ; ++k)
WriteLine ("point %d: %f %f", k, ((FilterPoint*)ArrayList_GetItem(points, k)[k])->x,
((FilterPoint*)ArrayList_GetItem(points, k)[k])->y);
*/
ArrayList* pointsHigh = ArrayList_new(ArrayList_Count(points)+1-u, NULL);
//WriteLine ("points.Length = %d, u = %d", ArrayList_Count(points), u);
ArrayList_Copy (points, u, pointsHigh, 0, ArrayList_Count(points) - u);
ArrayList_SetItem(pointsHigh, ArrayList_Count(pointsHigh) - 1, ArrayList_GetItem(points, 0));
int h = AreaFilter_MakeChain (self, pointsHigh, AreaFilter_CompareHigh);
int p;
for ( p = u ; p < ArrayList_Count(points) ; ++p) {
ArrayList_SetItem(points, p, ArrayList_GetItem(pointsHigh, p-u));
}
/*
WriteLine ("h = %d, u = %d", h, u);
int k;
for (k = 0 ; k < (h + u) ; ++k)
WriteLine ("point %d: %f %f", k, ((FilterPoint*)ArrayList_GetItem(points, k)[k])->x,
((FilterPoint*)ArrayList_GetItem(points, k)[k])->y);
*/
return (h + u);
}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:36,代码来源:AreaFilter.c
示例5: tsmf_presentation_set_geometry_info
void tsmf_presentation_set_geometry_info(TSMF_PRESENTATION *presentation,
UINT32 x, UINT32 y, UINT32 width, UINT32 height, int num_rects, RDP_RECT *rects)
{
UINT32 index;
UINT32 count;
TSMF_STREAM *stream;
/* The server may send messages with invalid width / height.
* Ignore those messages. */
if (!width || !height)
return;
if ((width == presentation->width) && (height == presentation->height) &&
(x == presentation->x) && (y == presentation->y) &&
(num_rects == presentation->nr_rects) &&
(0 == memcmp(rects, presentation->rects, num_rects * sizeof(RDP_RECT))))
{
return;
}
presentation->x = x;
presentation->y = y;
presentation->width = width;
presentation->height = height;
presentation->nr_rects = num_rects;
presentation->rects = realloc(presentation->rects, sizeof(RDP_RECT) * num_rects);
if (presentation->rects)
memcpy(presentation->rects, rects, sizeof(RDP_RECT) * num_rects);
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);
if (!stream->decoder)
continue;
if (stream->decoder->UpdateRenderingArea)
{
stream->decoder->UpdateRenderingArea(stream->decoder, x, y, width, height, num_rects, rects);
}
}
ArrayList_Unlock(presentation->stream_list);
}
开发者ID:JozLes77,项目名称:FreeRDP,代码行数:48,代码来源:tsmf_media.c
示例6: tsmf_presentation_start
void tsmf_presentation_start(TSMF_PRESENTATION* presentation)
{
UINT32 index;
UINT32 count;
TSMF_STREAM* stream;
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);
tsmf_stream_start(stream);
}
ArrayList_Unlock(presentation->stream_list);
}
开发者ID:EmiyaShilong,项目名称:FreeRDP,代码行数:16,代码来源:tsmf_media.c
示例7: tsmf_presentation_restarted
BOOL tsmf_presentation_restarted(TSMF_PRESENTATION* presentation)
{
UINT32 index;
UINT32 count;
TSMF_STREAM* stream;
BOOL ret = TRUE;
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
stream = (TSMF_STREAM*) ArrayList_GetItem(presentation->stream_list, index);
ret &= tsmf_stream_restart(stream);
}
ArrayList_Unlock(presentation->stream_list);
return ret;
}
开发者ID:JunaidLoonat,项目名称:FreeRDP,代码行数:18,代码来源:tsmf_media.c
示例8: tsmf_presentation_volume_changed
void tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume, UINT32 muted)
{
UINT32 index;
UINT32 count;
TSMF_STREAM* stream;
presentation->volume = newVolume;
presentation->muted = muted;
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);
tsmf_stream_change_volume(stream, newVolume, muted);
}
ArrayList_Unlock(presentation->stream_list);
}
开发者ID:EmiyaShilong,项目名称:FreeRDP,代码行数:18,代码来源:tsmf_media.c
示例9: shadow_client_boardcast_quit
int shadow_client_boardcast_quit(rdpShadowServer* server, int nExitCode)
{
wMessageQueue* queue = NULL;
int count = 0;
int index = 0;
ArrayList_Lock(server->clients);
for (index = 0; index < ArrayList_Count(server->clients); index++)
{
queue = ((rdpShadowClient*)ArrayList_GetItem(server->clients, index))->MsgQueue;
if (MessageQueue_PostQuit(queue, nExitCode))
{
count++;
}
}
ArrayList_Unlock(server->clients);
return count;
}
开发者ID:Graf3x,项目名称:FreeRDP,代码行数:19,代码来源:shadow_client.c
示例10: MultiMatch_CreatePointList
ArrayList* MultiMatch_CreatePointList (MultiMatch* self, ArrayList* matches)
{
ArrayList* points = ArrayList_new0 (FilterPoint_delete);
// Create a point list.
int i;
for(i=0; i<ArrayList_Count(matches); i++) {
Match* m = (Match*) ArrayList_GetItem(matches, i);
FilterPoint* p = FilterPoint_new0 ();
p->x = m->kp1->x;
p->y = m->kp1->y;
p->user = m;
WriteLine ("%f %f # CPOINTS", p->x, p->y);
ArrayList_AddItem(points, p);
}
return (points);
}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:20,代码来源:MatchKeys.c
示例11: rpc_client_call_find_by_id
RpcClientCall* rpc_client_call_find_by_id(rdpRpc* rpc, UINT32 CallId)
{
int index;
int count;
RpcClientCall* clientCall;
ArrayList_Lock(rpc->client->ClientCallList);
clientCall = NULL;
count = ArrayList_Count(rpc->client->ClientCallList);
for (index = 0; index < count; index++)
{
clientCall = (RpcClientCall*) ArrayList_GetItem(rpc->client->ClientCallList, index);
if (clientCall->CallId == CallId)
break;
}
ArrayList_Unlock(rpc->client->ClientCallList);
return clientCall;
}
开发者ID:a1154043439,项目名称:FreeRDP,代码行数:20,代码来源:rpc_client.c
示例12: dvcman_free
void dvcman_free(IWTSVirtualChannelManager* pChannelMgr)
{
int i;
int count;
IWTSPlugin* pPlugin;
DVCMAN_LISTENER* listener;
DVCMAN_CHANNEL* channel;
DVCMAN* dvcman = (DVCMAN*) pChannelMgr;
ArrayList_Lock(dvcman->channels);
count = ArrayList_Count(dvcman->channels);
for (i = 0; i < count; i++)
{
channel = (DVCMAN_CHANNEL*) ArrayList_GetItem(dvcman->channels, i);
dvcman_channel_free(channel);
}
ArrayList_Unlock(dvcman->channels);
ArrayList_Free(dvcman->channels);
for (i = 0; i < dvcman->num_listeners; i++)
{
listener = (DVCMAN_LISTENER*) dvcman->listeners[i];
free(listener->channel_name);
free(listener);
}
for (i = 0; i < dvcman->num_plugins; i++)
{
pPlugin = dvcman->plugins[i];
if (pPlugin->Terminated)
pPlugin->Terminated(pPlugin);
}
StreamPool_Free(dvcman->pool);
free(dvcman);
}
开发者ID:Oshirowanen,项目名称:FreeRDP,代码行数:41,代码来源:dvcman.c
示例13: winpr_unref_named_pipe
static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe)
{
int index;
NamedPipeServerSocketEntry* baseSocket;
if (!pNamedPipe)
return;
assert(pNamedPipe->name);
assert(g_NamedPipeServerSockets);
//WLog_VRB(TAG, "%p (%s)", pNamedPipe, pNamedPipe->name);
ArrayList_Lock(g_NamedPipeServerSockets);
for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++)
{
baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem(
g_NamedPipeServerSockets, index);
assert(baseSocket->name);
if (!strcmp(baseSocket->name, pNamedPipe->name))
{
assert(baseSocket->references > 0);
assert(baseSocket->serverfd != -1);
if (--baseSocket->references == 0)
{
//WLog_DBG(TAG, "removing shared server socked resource");
//WLog_DBG(TAG, "closing shared serverfd %d", baseSocket->serverfd);
ArrayList_Remove(g_NamedPipeServerSockets, baseSocket);
close(baseSocket->serverfd);
free(baseSocket->name);
free(baseSocket);
}
break;
}
}
ArrayList_Unlock(g_NamedPipeServerSockets);
}
开发者ID:matthew-n,项目名称:FreeRDP,代码行数:40,代码来源:pipe.c
示例14: CreateFileA
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
int i;
if (!lpFileName)
return INVALID_HANDLE_VALUE;
if (pthread_once(&_HandleCreatorsInitialized, _HandleCreatorsInit) != 0)
{
SetLastError(ERROR_DLL_INIT_FAILED);
return INVALID_HANDLE_VALUE;
}
if (_HandleCreators == NULL)
{
SetLastError(ERROR_DLL_INIT_FAILED);
return INVALID_HANDLE_VALUE;
}
ArrayList_Lock(_HandleCreators);
for (i=0; i <= ArrayList_Count(_HandleCreators); i++)
{
HANDLE_CREATOR* creator = ArrayList_GetItem(_HandleCreators, i);
if (creator && creator->IsHandled(lpFileName))
{
HANDLE newHandle = creator->CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,
dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
ArrayList_Unlock(_HandleCreators);
return newHandle;
}
}
ArrayList_Unlock(_HandleCreators);
return INVALID_HANDLE_VALUE;
}
开发者ID:bceverly,项目名称:FreeRDP,代码行数:38,代码来源:generic.c
示例15: FreeRDP_WTSCloseServer
VOID WINAPI FreeRDP_WTSCloseServer(HANDLE hServer)
{
int index;
int count;
rdpPeerChannel* channel;
WTSVirtualChannelManager* vcm;
vcm = (WTSVirtualChannelManager*) hServer;
if (vcm)
{
HashTable_Remove(g_ServerHandles, (void*) (UINT_PTR) vcm->SessionId);
ArrayList_Lock(vcm->dynamicVirtualChannels);
count = ArrayList_Count(vcm->dynamicVirtualChannels);
for (index = 0; index < count; index++)
{
channel = (rdpPeerChannel*) ArrayList_GetItem(vcm->dynamicVirtualChannels, index);
WTSVirtualChannelClose(channel);
}
ArrayList_Unlock(vcm->dynamicVirtualChannels);
ArrayList_Free(vcm->dynamicVirtualChannels);
if (vcm->drdynvc_channel)
{
WTSVirtualChannelClose(vcm->drdynvc_channel);
vcm->drdynvc_channel = NULL;
}
MessageQueue_Free(vcm->queue);
free(vcm);
}
}
开发者ID:Auto-Droid,项目名称:FreeRDP,代码行数:38,代码来源:server.c
示例16: tsmf_presentation_sync
/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT tsmf_presentation_sync(TSMF_PRESENTATION* presentation)
{
UINT32 index;
UINT32 count;
UINT error;
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
TSMF_STREAM* stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);
if (WaitForSingleObject(stream->ready, 500) == WAIT_FAILED)
{
error = GetLastError();
WLog_ERR(TAG, "WaitForSingleObject failed with error %lu!", error);
return error;
}
}
ArrayList_Unlock(presentation->stream_list);
return CHANNEL_RC_OK;
}
开发者ID:artemh,项目名称:FreeRDP,代码行数:28,代码来源:tsmf_media.c
示例17: ArrayList_Lock
TSMF_STREAM *tsmf_stream_find_by_id(TSMF_PRESENTATION *presentation, UINT32 stream_id)
{
UINT32 index;
UINT32 count;
BOOL found = FALSE;
TSMF_STREAM *stream;
ArrayList_Lock(presentation->stream_list);
count = ArrayList_Count(presentation->stream_list);
for (index = 0; index < count; index++)
{
stream = (TSMF_STREAM *) ArrayList_GetItem(presentation->stream_list, index);
if (stream->stream_id == stream_id)
{
found = TRUE;
break;
}
}
ArrayList_Unlock(presentation->stream_list);
return (found) ? stream : NULL;
}
开发者ID:JozLes77,项目名称:FreeRDP,代码行数:23,代码来源:tsmf_media.c
示例18: winpr_unref_named_pipe
static void winpr_unref_named_pipe(WINPR_NAMED_PIPE* pNamedPipe)
{
int index;
NamedPipeServerSocketEntry *baseSocket;
if (!pNamedPipe)
return;
assert(pNamedPipe->name);
assert(g_NamedPipeServerSockets);
//fprintf(stderr, "%s: %p (%s)\n", __FUNCTION__, pNamedPipe, pNamedPipe->name);
ArrayList_Lock(g_NamedPipeServerSockets);
for (index = 0; index < ArrayList_Count(g_NamedPipeServerSockets); index++)
{
baseSocket = (NamedPipeServerSocketEntry*) ArrayList_GetItem(
g_NamedPipeServerSockets, index);
assert(baseSocket->name);
if (!strcmp(baseSocket->name, pNamedPipe->name))
{
assert(baseSocket->references > 0);
assert(baseSocket->serverfd != -1);
if (--baseSocket->references == 0)
{
//fprintf(stderr, "%s: removing shared server socked resource\n", __FUNCTION__);
//fprintf(stderr, "%s: closing shared serverfd %d\n", __FUNCTION__, baseSocket->serverfd);
ArrayList_Remove(g_NamedPipeServerSockets, baseSocket);
close(baseSocket->serverfd);
free(baseSocket->name);
free(baseSocket);
}
break;
}
}
ArrayList_Unlock(g_NamedPipeServerSockets);
}
开发者ID:10084462,项目名称:FreeRDP,代码行数:37,代码来源:pipe.c
示例19: AreaFilter_MakeChain
int AreaFilter_MakeChain (AreaFilter* self, ArrayList* points, int (*comp)(const FilterPoint*, const FilterPoint*))
{
IComparator comparator;
comparator.compareTo = (int ( *)(IComparator *,const void *,const void *)) comp;
ArrayList_Sort(points, &comparator);
int s = 1;
int pCount = ArrayList_Count(points);
int i;
for (i = 2 ; i < pCount ; ++i) {
int j;
for (j = s ; j >= 1 && AreaFilter_ccw (points, i, j, j - 1) ; --j)
;
s = j + 1;
// Swap
FilterPoint* t = (FilterPoint*) ArrayList_GetItem(points, s);
ArrayList_SetItem(points, s, ArrayList_GetItem(points, i));
ArrayList_SetItem(points, i, t);
}
return (s);
}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:24,代码来源:AreaFilter.c
示例20: x11_shadow_pointer_position_update
int x11_shadow_pointer_position_update(x11ShadowSubsystem* subsystem)
{
SHADOW_MSG_OUT_POINTER_POSITION_UPDATE* msg;
UINT32 msgId = SHADOW_MSG_OUT_POINTER_POSITION_UPDATE_ID;
rdpShadowClient* client;
rdpShadowServer* server;
int count = 0;
int index = 0;
msg = (SHADOW_MSG_OUT_POINTER_POSITION_UPDATE*) calloc(1, sizeof(SHADOW_MSG_OUT_POINTER_POSITION_UPDATE));
if (!msg)
return -1;
msg->xPos = subsystem->pointerX;
msg->yPos = subsystem->pointerY;
msg->Free = x11_shadow_message_free;
server = subsystem->server;
ArrayList_Lock(server->clients);
for (index = 0; index < ArrayList_Count(server->clients); index++)
{
client = (rdpShadowClient*)ArrayList_GetItem(server->clients, index);
/* Skip the client which send us the latest mouse event */
if (client == subsystem->lastMouseClient)
continue;
if (shadow_client_post_msg(client, NULL, msgId, (SHADOW_MSG_OUT*) msg, NULL))
count++;
}
ArrayList_Unlock(server->clients);
return count;
}
开发者ID:DavBfr,项目名称:FreeRDP,代码行数:36,代码来源:x11_shadow.c
注:本文中的ArrayList_Count函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论