本文整理汇总了C++中ArrayList_Count函数的典型用法代码示例。如果您正苦于以下问题:C++ ArrayList_Count函数的具体用法?C++ ArrayList_Count怎么用?C++ ArrayList_Count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ArrayList_Count函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}