您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wmalloc函数代码示例

51自学网 2021-06-03 10:01:09
  C++
这篇教程C++ wmalloc函数代码示例写得很实用,希望能帮到您。

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

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

示例1: wmalloc

static Atom *getTypeAtomList(WMScreen * scr, WMView * view, int *count){	WMArray *types;	Atom *typeAtoms;	int i;	types = view->dragSourceProcs->dropDataTypes(view);	if (types != NULL) {		*count = WMGetArrayItemCount(types);		if (*count > 0) {			typeAtoms = wmalloc((*count) * sizeof(Atom));			for (i = 0; i < *count; i++) {				typeAtoms[i] = XInternAtom(scr->display, WMGetFromArray(types, i), False);			}			/* WMFreeArray(types); */			return typeAtoms;		}		/* WMFreeArray(types); */	}	*count = 1;	typeAtoms = wmalloc(sizeof(Atom));	*typeAtoms = None;	return typeAtoms;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:29,


示例2: _wilddog_url_getKey

/* * Function:    _wilddog_url_getKey * Description: Get the Key of the path. * Input:       p_path: The path. * Output:      N/A * Return:      Pointer to the Key.*/Wilddog_Str_T * WD_SYSTEM _wilddog_url_getKey(Wilddog_Str_T * p_path){    int i, len, pos = 0;    Wilddog_Str_T* p_str = NULL;    if(NULL == p_path)        return NULL;        len = strlen((const char*)p_path);    if(len == 1 && p_path[0] == '/')    {        p_str = (Wilddog_Str_T*)wmalloc(len + 1);        if(NULL == p_str)            return NULL;        p_str[0] = '/';        return p_str;    }    for(i = len - 1; i >=0; i--)    {        if(p_path[len - 1] == '/')            continue;        if(p_path[i] == '/')        {            pos = i;            break;        }    }    p_str = (Wilddog_Str_T*)wmalloc(len - pos);    if(NULL == p_str)        return NULL;    memcpy((char*)p_str, (char*)(p_path + pos + 1), len - pos);    return p_str;}
开发者ID:WildDogTeam,项目名称:demo-c-rgblight,代码行数:39,


示例3: executeRepair_OneBlock

/***  Perform Re-Pair on one block*/static void executeRepair_OneBlock (PROG_INFO *prog_struct, BLOCK_INFO *block_struct) {    R_UINT i;    /*  Perform scanPairs  */    scanPairs (prog_struct, block_struct);    /*  Allocate queue and initialize to NULL  */    /*  Make the priority queue bigger by one since position 0 is    **  unused.  */    block_struct -> pqueue_size = block_struct -> max_count + 1;    block_struct -> pqueue = wmalloc ((block_struct -> pqueue_size) * (sizeof (TPHRASE*)));    for (i = 0; i < block_struct -> pqueue_size; i++) {        block_struct -> pqueue[i] = NULL;    }    /*  Populate queue with tentative phrases  */    initQueue (prog_struct, block_struct);    /*  Recursively pair phrases  */    rePairPhrases (prog_struct, block_struct);    /*  Sort primitives  */    sortPrimitives (block_struct);    block_struct -> sort_phrases = wmalloc (((block_struct -> num_prims) + (block_struct -> num_phrases)) * (sizeof (PHRASE)));    /*  Sort phrases  */    sortPhrases (prog_struct, block_struct);    return;}
开发者ID:rwanwork,项目名称:Re-Pair,代码行数:35,


示例4: kqueue

static struct apiState *eventInit(int nevent){    struct kevent *events = NULL;    int ep;    struct apiState *state = NULL;    ep = kqueue();    if (ep < 0) {        return NULL;    }    state = wmalloc(sizeof(struct apiState));    if (!state) {        close(ep);        return NULL;    }    events = wmalloc(nevent*sizeof(struct kevent));    if (events == NULL) {        close(ep);        wfree(state);        return NULL;    }    state->kqfd = ep;    state->events = events;    return state;}
开发者ID:alemic,项目名称:wheatserver,代码行数:28,


示例5: addWMMenuEntryCallback

/* upon fully deducing one particular menu entry, parsers call back to this * function to have said menu entry added to the wm menu. initializes wm menu * with a root element if needed. */static void addWMMenuEntryCallback(WMMenuEntry *aEntry){	WMMenuEntry *wm;	WMTreeNode *at;	wm = (WMMenuEntry *)wmalloc(sizeof(WMMenuEntry));	/* this entry */	at = (WMTreeNode *)NULL;				/* will be a child of this entry */	if (!menu) {		WMMenuEntry *root;		root = (WMMenuEntry *)wmalloc(sizeof(WMMenuEntry));		root->Name = "Applications";		root->CmdLine = NULL;		root->SubMenu = NULL;		root->Flags = 0;		menu = WMCreateTreeNode(root);	}	if (aEntry->SubMenu)		at = findPositionInMenu(aEntry->SubMenu);	if (!at)		at = menu;	wm->Flags = aEntry->Flags;	wm->Name = wstrdup(aEntry->Name);	wm->CmdLine = wstrdup(aEntry->CmdLine);	wm->SubMenu = NULL;	WMAddItemToTree(at, wm);}
开发者ID:awmaker,项目名称:awmaker,代码行数:36,


示例6: wmalloc

WMTextField *WMCreateTextField(WMWidget * parent){	TextField *tPtr;	tPtr = wmalloc(sizeof(TextField));	tPtr->widgetClass = WC_TextField;	tPtr->view = W_CreateView(W_VIEW(parent));	if (!tPtr->view) {		wfree(tPtr);		return NULL;	}	tPtr->view->self = tPtr;	tPtr->view->delegate = &_TextFieldViewDelegate;	tPtr->view->attribFlags |= CWCursor;	tPtr->view->attribs.cursor = tPtr->view->screen->textCursor;	W_SetViewBackgroundColor(tPtr->view, tPtr->view->screen->white);	tPtr->text = wmalloc(MIN_TEXT_BUFFER);	tPtr->textLen = 0;	tPtr->bufferSize = MIN_TEXT_BUFFER;	tPtr->flags.enabled = 1;	WMCreateEventHandler(tPtr->view, ExposureMask | StructureNotifyMask | FocusChangeMask, handleEvents, tPtr);	tPtr->font = WMRetainFont(tPtr->view->screen->normalFont);	tPtr->flags.bordered = DEFAULT_BORDERED;	tPtr->flags.beveled = True;	tPtr->flags.alignment = DEFAULT_ALIGNMENT;	tPtr->offsetWidth = WMAX((tPtr->view->size.height - WMFontHeight(tPtr->font)) / 2, 1);	W_ResizeView(tPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);	WMCreateEventHandler(tPtr->view, EnterWindowMask | LeaveWindowMask			     | ButtonReleaseMask | ButtonPressMask | KeyPressMask | Button1MotionMask,			     handleTextFieldActionEvents, tPtr);	WMAddNotificationObserver(selectionNotification, tPtr->view,				  WMSelectionOwnerDidChangeNotification, (void *)XA_PRIMARY);	WMAddNotificationObserver(realizeObserver, tPtr, WMViewRealizedNotification, tPtr->view);	tPtr->flags.cursorOn = 1;	return tPtr;}
开发者ID:jafd,项目名称:wmaker,代码行数:51,


示例7: wmalloc

WMHashTable *WMCreateHashTable(WMHashTableCallbacks callbacks){	HashTable *table;	table = wmalloc(sizeof(HashTable));	table->callbacks = callbacks;	table->size = INITIAL_CAPACITY;	table->table = wmalloc(sizeof(HashItem *) * table->size);	return table;}
开发者ID:crmafra,项目名称:wmaker,代码行数:14,


示例8: removeColumn

static void removeColumn(WMBrowser * bPtr, int column){	int i, clearEnd, destroyEnd;	WMList **clist;	char **tlist;	assert(bPtr != NULL);	column = (column < 0) ? 0 : column;	if (column >= bPtr->columnCount) {		return;	}	if (column < bPtr->maxVisibleColumns) {		clearEnd = bPtr->maxVisibleColumns;		destroyEnd = bPtr->columnCount;		bPtr->columnCount = bPtr->maxVisibleColumns;	} else {		clearEnd = column;		destroyEnd = bPtr->columnCount;		bPtr->columnCount = column;	}	if (column < bPtr->usedColumnCount) {		bPtr->usedColumnCount = column;	}	for (i = column; i < clearEnd; i++) {		if (bPtr->titles[i]) {			wfree(bPtr->titles[i]);			bPtr->titles[i] = NULL;		}		WMClearList(bPtr->columns[i]);	}	for (; i < destroyEnd; i++) {		if (bPtr->titles[i]) {			wfree(bPtr->titles[i]);			bPtr->titles[i] = NULL;		}		WMRemoveNotificationObserverWithName(bPtr, WMListSelectionDidChangeNotification, bPtr->columns[i]);		WMDestroyWidget(bPtr->columns[i]);		bPtr->columns[i] = NULL;	}	clist = wmalloc(sizeof(WMList *) * (bPtr->columnCount));	tlist = wmalloc(sizeof(char *) * (bPtr->columnCount));	memcpy(clist, bPtr->columns, sizeof(WMList *) * (bPtr->columnCount));	memcpy(tlist, bPtr->titles, sizeof(char *) * (bPtr->columnCount));	wfree(bPtr->titles);	wfree(bPtr->columns);	bPtr->titles = tlist;	bPtr->columns = clist;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:49,


示例9: wWorkspaceNew

int wWorkspaceNew(WScreen *scr){	WWorkspace *wspace, **list;	int i;	if (w_global.workspace.count < MAX_WORKSPACES) {		w_global.workspace.count++;		wspace = wmalloc(sizeof(WWorkspace));		wspace->name = NULL;		wspace->clip = NULL;		if (!wspace->name) {			static const char *new_name = NULL;			static size_t name_length;			if (new_name == NULL) {				new_name = _("Workspace %i");				name_length = strlen(new_name) + 8;			}			wspace->name = wmalloc(name_length);			snprintf(wspace->name, name_length, new_name, w_global.workspace.count);		}		if (!wPreferences.flags.noclip)			wspace->clip = wDockCreate(scr, WM_CLIP, NULL);		list = wmalloc(sizeof(WWorkspace *) * w_global.workspace.count);		for (i = 0; i < w_global.workspace.count - 1; i++)			list[i] = w_global.workspace.array[i];		list[i] = wspace;		if (w_global.workspace.array)			wfree(w_global.workspace.array);		w_global.workspace.array = list;		wWorkspaceMenuUpdate(w_global.workspace.menu);		wWorkspaceMenuUpdate(w_global.clip.ws_menu);		wNETWMUpdateDesktop(scr);		WMPostNotificationName(WMNWorkspaceCreated, scr, (void *)(uintptr_t) (w_global.workspace.count - 1));		XFlush(dpy);		return w_global.workspace.count - 1;	}	return -1;}
开发者ID:jafd,项目名称:wmaker,代码行数:49,


示例10: strlen

/* * Function:    _wilddog_url_getParentStr * Description: Get the Parent path of the source path. * Input:       p_src_path: The source path. * Output:      N/A * Return:      Pointer to the parent's path.*/STATIC Wilddog_Str_T * WD_SYSTEM _wilddog_url_getParentStr    (    Wilddog_Str_T* p_src_path    ){    int i;    int size = 0;    int pos = 0;    Wilddog_Str_T* p_path = NULL;    if(!p_src_path)        return NULL;        size = strlen((const char*)p_src_path);    if(size == 1 && p_src_path[0] == '/')    {        return NULL;    }    for(i = size - 1; i >= 0; i--)    {        if(p_src_path[size - 1] == '/')            continue;        if(p_src_path[i] == '/')        {            pos = i;            break;        }    }    /* path do not have '/', invalid */    if((!pos) && (p_src_path[pos] != '/'))        return p_path;    if(pos == 0)    {        p_path = (Wilddog_Str_T *)wmalloc(2);        if(NULL == p_path)            return NULL;        p_path[0] = '/';        return p_path;    }        p_path = (Wilddog_Str_T *)wmalloc(pos + 1);    if(NULL == p_path)        return NULL;        strncpy((char*)p_path, (char*)p_src_path, pos);    return p_path;}
开发者ID:WildDogTeam,项目名称:demo-c-rgblight,代码行数:55,


示例11: registerDescriptionList

static void registerDescriptionList(WMScreen * scr, WMView * view, WMArray * operationArray){	char *text, *textListItem, *textList;	int count = WMGetArrayItemCount(operationArray);	int i;	int size = 0;	/* size of XA_STRING info */	for (i = 0; i < count; i++) {		size += strlen(WMGetDragOperationItemText(WMGetFromArray(operationArray, i))) + 1 /* NULL */;	}	/* create text list */	textList = wmalloc(size);	textListItem = textList;	for (i = 0; i < count; i++) {		text = WMGetDragOperationItemText(WMGetFromArray(operationArray, i));		wstrlcpy(textListItem, text, size);		/* to next text offset */		textListItem = &(textListItem[strlen(textListItem) + 1]);	}	XChangeProperty(scr->display,			WMViewXID(view),			scr->xdndActionDescriptionAtom,			XA_STRING,			XDND_ACTION_DESCRIPTION_FORMAT, PropModeReplace, (unsigned char *)textList, size);}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:30,


示例12: _wilddog_conn_init

*/Wilddog_Conn_T * WD_SYSTEM _wilddog_conn_init(Wilddog_Repo_T* p_repo){    Wilddog_CM_InitArg_T cm_initArg;    Wilddog_Conn_T* p_repo_conn = NULL;        if(!p_repo)        return NULL;    p_repo_conn = (Wilddog_Conn_T*)wmalloc(sizeof(Wilddog_Conn_T));    if( NULL ==p_repo_conn)        return NULL;        p_repo_conn->p_conn_repo = p_repo;    p_repo->p_rp_conn = p_repo_conn;    p_repo_conn->f_conn_ioctl = (Wilddog_Func_T)_wilddog_conn_ioctl;    cm_initArg.p_repo= p_repo;    cm_initArg.f_conn_cb = (Wilddog_Func_T)_wilddog_conn_cb_ioctl;     p_repo_conn->p_cm_l = (void*)_wilddog_cm_ioctl( CM_CMD_INIT,&cm_initArg,0);    if( p_repo_conn->p_cm_l == NULL )    {        wfree(p_repo_conn);        p_repo_conn = NULL;    }        return p_repo_conn;
开发者ID:eagle518,项目名称:wilddog-client-c,代码行数:28,


示例13: get_texture_image

WTexPixmap *wTextureMakePixmap(WScreen *scr, int style, const char *pixmap_file, XColor *color){	WTexPixmap *texture;	XGCValues gcv;	RImage *image;	image = get_texture_image(scr, pixmap_file);	if (!image)		return NULL;	texture = wmalloc(sizeof(WTexture));	texture->type = WTEX_PIXMAP;	texture->subtype = style;	texture->normal = *color;	XAllocColor(dpy, scr->w_colormap, &texture->normal);	gcv.background = gcv.foreground = texture->normal.pixel;	gcv.graphics_exposures = False;	texture->normal_gc = XCreateGC(dpy, scr->w_win, GCForeground | GCBackground | GCGraphicsExposures, &gcv);	texture->pixmap = image;	return texture;}
开发者ID:d-torrance,项目名称:wmaker,代码行数:25,


示例14: WMMaskEvents

WMMaskedEvents* WMMaskEvents(WMView* view) {  W_MaskedEvents *mask;  unsigned int i;  Bool changed = False;  mask = wmalloc(sizeof(W_MaskedEvents));  mask->view = view;  mask->procs = WMCreateArray(0);  mask->data = WMCreateArray(0);  for (i = 0; i < WMGetArrayItemCount(W_GetViewEventHandlers(view)); i++) {    W_EventHandler *h = (W_EventHandler*) WMGetFromArray(W_GetViewEventHandlers(view), i);    if (h->eventMask == (ButtonPressMask|ButtonReleaseMask|                        EnterWindowMask|LeaveWindowMask|ButtonMotionMask)) {      WMAddToArray(mask->procs, h->proc);      WMAddToArray(mask->data, h->clientData);      /* we change only the first handler to our one, because they seem         to be processed upside-down and we want the dnd-handler to be processed         first. */      if (changed == False) {        h->proc = W_MaskedEventHandler;        h->clientData = (void*) mask;        changed = True;      } else {        WMDeleteEventHandler(view, h->eventMask, h->proc, h->clientData);      }    }  }  return mask;}
开发者ID:roblillack,项目名称:mmp,代码行数:32,


示例15: wstrdup

Panel *InitMouseSettings(WMWidget *parent){	_Panel *panel;	modifierNames[0] = wstrdup(_("Shift"));	modifierNames[1] = wstrdup(_("Lock"));	modifierNames[2] = wstrdup(_("Control"));	modifierNames[3] = wstrdup(_("Mod1"));	modifierNames[4] = wstrdup(_("Mod2"));	modifierNames[5] = wstrdup(_("Mod3"));	modifierNames[6] = wstrdup(_("Mod4"));	modifierNames[7] = wstrdup(_("Mod5"));	panel = wmalloc(sizeof(_Panel));	panel->sectionName = _("Mouse Preferences");	panel->description = _("Mouse speed/acceleration, double click delay,/n" "mouse button bindings etc.");	panel->parent = parent;	panel->callbacks.createWidgets = createPanel;	panel->callbacks.updateDomain = storeData;	AddSection(panel, ICON_FILE);	return panel;}
开发者ID:awmaker,项目名称:awmaker,代码行数:28,


示例16: wmalloc

WMSplitView *WMCreateSplitView(WMWidget * parent){	WMSplitView *sPtr;	sPtr = wmalloc(sizeof(WMSplitView));	sPtr->widgetClass = WC_SplitView;	sPtr->view = W_CreateView(W_VIEW(parent));	if (!sPtr->view) {		wfree(sPtr);		return NULL;	}	sPtr->view->self = sPtr;	WMSetViewNotifySizeChanges(sPtr->view, True);	WMCreateEventHandler(sPtr->view, ExposureMask | StructureNotifyMask			     | ClientMessageMask, handleEvents, sPtr);	WMCreateEventHandler(sPtr->view, ButtonPressMask | ButtonReleaseMask			     | EnterWindowMask | LeaveWindowMask, handleActionEvents, sPtr);	WMAddNotificationObserver(handleViewResized, sPtr, WMViewSizeDidChangeNotification, sPtr->view);	sPtr->subviews = WMCreateArrayWithDestructor(8, wfree);	return sPtr;}
开发者ID:crmafra,项目名称:wmaker,代码行数:28,


示例17: wmalloc

WMLabel *WMCreateLabel(WMWidget * parent){	Label *lPtr;	lPtr = wmalloc(sizeof(Label));	lPtr->widgetClass = WC_Label;	lPtr->view = W_CreateView(W_VIEW(parent));	if (!lPtr->view) {		wfree(lPtr);		return NULL;	}	lPtr->view->self = lPtr;	lPtr->textColor = WMRetainColor(lPtr->view->screen->black);	WMCreateEventHandler(lPtr->view, ExposureMask | StructureNotifyMask, handleEvents, lPtr);	W_ResizeView(lPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);	lPtr->flags.alignment = DEFAULT_ALIGNMENT;	lPtr->flags.relief = DEFAULT_RELIEF;	lPtr->flags.imagePosition = DEFAULT_IMAGE_POSITION;	lPtr->flags.noWrap = 1;	return lPtr;}
开发者ID:awmaker,项目名称:awmaker,代码行数:27,


示例18: wsheet_add_obj

boolwsheet_add_obj(struct wsheet* wsh,               uint16_t type, void* data,               int32_t l, int32_t t, int32_t r, int32_t b) {    int32_t     i, j;    struct obj* o = wmalloc(sizeof(*o));    wassert(o);    rect_set(&o->extent, l, t, r, b);    o->ty = type;    o->ref = 0;    o->priv = data;    for (i = 0; i < wsh->rowN; i++) {        for (j = 0; j < wsh->colN; j++) {            if (rect_is_overlap2(&o->extent,                                 &wsh->divs[i][j].boundary))                div_add_obj(&wsh->divs[i][j], o);        }    }    /* if obj is not added anywhere, destroy it! */    if (!o->ref) {        wfree(o);        return false;    } else        return true;}
开发者ID:yhcting,项目名称:writer,代码行数:27,


示例19: getHostFromUrl

Wilddog_Str_T * getHostFromUrl(Wilddog_Str_T *url){	int length = 0;	int m = 0, n = 0;	int i = 0;	Wilddog_Str_T *host = NULL;	length = strlen(url);	for(i = 0; i < length; i++)	{		if(*(url+i) == '/' && *(url+i+1) == '/')			break;	}	m = i+2;	for(i = m; i < length; i++)	{		if(*(url+i) == '/')			break;	}	n = i-1;	host = wmalloc(n-m+2);	if(NULL == host)	{			}	strncpy(host, url+m, n-m+1);	return host;}
开发者ID:masterpy,项目名称:liveshell,代码行数:32,


示例20: wmalloc

/*---------------------------------------------------------------------- * wCoreCreate-- * 	Creates a brand new child window. * 	The window will have a border width of 0 and color is black. * * Returns: * 	A initialized core window structure. * * Side effects: * 	A window context for the created window is saved. * * Notes: * 	The event mask is initialized to a default value. *--------------------------------------------------------------------- */WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, int width, int height){	WCoreWindow *core;	int vmask;	XSetWindowAttributes attribs;	core = wmalloc(sizeof(WCoreWindow));	vmask = CWBorderPixel | CWCursor | CWEventMask | CWColormap;	attribs.cursor = wCursor[WCUR_DEFAULT];	attribs.background_pixmap = None;	attribs.background_pixel = parent->screen_ptr->black_pixel;	attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |			     ButtonReleaseMask | ButtonMotionMask |			     ExposureMask | EnterWindowMask | LeaveWindowMask;	attribs.colormap = parent->screen_ptr->w_colormap;	core->window = XCreateWindow(dpy, parent->window, x, y, width, height, 0,			  parent->screen_ptr->w_depth, CopyFromParent,			  parent->screen_ptr->w_visual, vmask, &attribs);	core->width = width;	core->height = height;	core->screen_ptr = parent->screen_ptr;	core->descriptor.self = core;	XSaveContext(dpy, core->window, wWinContext, (XPointer) & core->descriptor);	return core;}
开发者ID:crmafra,项目名称:wmaker,代码行数:42,


示例21: WMDataBytes

static char *dataDescription(WMPropList * plist){	const unsigned char *data;	char *retVal;	int i, j, length;	data = WMDataBytes(plist->d.data);	length = WMGetDataLength(plist->d.data);	retVal = (char *)wmalloc(2 * length + length / 4 + 3);	retVal[0] = '<';	for (i = 0, j = 1; i < length; i++) {		retVal[j++] = num2char((data[i] >> 4) & 0x0f);		retVal[j++] = num2char(data[i] & 0x0f);		if ((i & 0x03) == 3 && i != length - 1) {			/* if we've just finished a 32-bit int, add a space */			retVal[j++] = ' ';		}	}	retVal[j++] = '>';	retVal[j] = '/0';	return retVal;}
开发者ID:crmafra,项目名称:wmaker,代码行数:25,


示例22: WMResetHashTable

void WMResetHashTable(WMHashTable * table){	HashItem *item, *tmp;	int i;	for (i = 0; i < table->size; i++) {		item = table->table[i];		while (item) {			tmp = item->next;			RELKEY(table, item->key);			wfree(item);			item = tmp;		}	}	table->itemCount = 0;	if (table->size > INITIAL_CAPACITY) {		wfree(table->table);		table->size = INITIAL_CAPACITY;		table->table = wmalloc(sizeof(HashItem *) * table->size);	} else {		memset(table->table, 0, sizeof(HashItem *) * table->size);	}}
开发者ID:crmafra,项目名称:wmaker,代码行数:25,


示例23: rebuildTable

static void rebuildTable(WMHashTable * table){	HashItem *next;	HashItem **oldArray;	int i;	int oldSize;	int newSize;	oldArray = table->table;	oldSize = table->size;	newSize = table->size * 2;	table->table = wmalloc(sizeof(char *) * newSize);	table->size = newSize;	for (i = 0; i < oldSize; i++) {		while (oldArray[i] != NULL) {			next = oldArray[i]->next;			rellocateItem(table, oldArray[i]);			oldArray[i] = next;		}	}	wfree(oldArray);}
开发者ID:crmafra,项目名称:wmaker,代码行数:25,


示例24: WMSetViewDragSourceProcs

void WMSetViewDragSourceProcs(WMView * view, WMDragSourceProcs * procs){	if (view->dragSourceProcs)		wfree(view->dragSourceProcs);	view->dragSourceProcs = wmalloc(sizeof(WMDragSourceProcs));	*view->dragSourceProcs = *procs;	if (procs->dropDataTypes == NULL)		view->dragSourceProcs->dropDataTypes = defDropDataTypes;	if (procs->wantedDropOperation == NULL)		view->dragSourceProcs->wantedDropOperation = defWantedDropOperation;	/*	   Note: askedOperations can be NULL, if wantedDropOperation never returns	   WDOperationAsk.	 */	if (procs->acceptDropOperation == NULL)		view->dragSourceProcs->acceptDropOperation = defAcceptDropOperation;	if (procs->beganDrag == NULL)		view->dragSourceProcs->beganDrag = defBeganDrag;	if (procs->endedDrag == NULL)		view->dragSourceProcs->endedDrag = defEndedDrag;	if (procs->fetchDragData == NULL)		view->dragSourceProcs->fetchDragData = defFetchDragData;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:31,


示例25: WMWidgetScreen

WMTabView *WMCreateTabView(WMWidget * parent){	TabView *tPtr;	WMScreen *scr = WMWidgetScreen(parent);	tPtr = wmalloc(sizeof(TabView));	tPtr->widgetClass = WC_TabView;	tPtr->view = W_CreateView(W_VIEW(parent));	if (!tPtr->view) {		wfree(tPtr);		return NULL;	}	tPtr->view->self = tPtr;	tPtr->view->delegate = &delegate;	tPtr->lightGray = WMCreateRGBColor(scr, 0xd9d9, 0xd9d9, 0xd9d9, False);	tPtr->tabColor = WMCreateRGBColor(scr, 0x8420, 0x8420, 0x8420, False);	tPtr->font = WMRetainFont(scr->normalFont);	tPtr->flags.type = WTTopTabsBevelBorder;	tPtr->flags.bordered = 1;	tPtr->flags.uniformTabs = 0;	tPtr->flags.enabled = 1;	WMCreateEventHandler(tPtr->view, ExposureMask | StructureNotifyMask | ButtonPressMask, handleEvents, tPtr);	WMResizeWidget(tPtr, DEFAULT_WIDTH, DEFAULT_HEIGHT);	tPtr->tabHeight = WMFontHeight(tPtr->font) + 3;	return tPtr;}
开发者ID:crmafra,项目名称:wmaker,代码行数:34,


示例26: initMotionProcess

static void initMotionProcess(WMView * view, WMDraggingInfo * info, XEvent * event, WMPoint * startLocation){	WMScreen *scr = W_VIEW_SCREEN(view);	/* take ownership of XdndSelection */	XDND_SELECTION_PROCS(info) = (WMSelectionProcs *) wmalloc(sizeof(WMSelectionProcs));	XDND_SELECTION_PROCS(info)->convertSelection = convertSelection;	XDND_SELECTION_PROCS(info)->selectionLost = selectionLost;	XDND_SELECTION_PROCS(info)->selectionDone = selectionDone;	XDND_TIMESTAMP(info) = event->xmotion.time;	if (!WMCreateSelectionHandler(view, scr->xdndSelectionAtom, CurrentTime, XDND_SELECTION_PROCS(info), NULL)) {		wwarning("could not get ownership or DND selection");		return;	}	registerDropTypes(scr, view, info);	if (XDND_SOURCE_ACTION(info) == W_VIEW_SCREEN(view)->xdndActionAsk)		registerSupportedOperations(view);	if (view->dragSourceProcs->beganDrag != NULL) {		view->dragSourceProcs->beganDrag(view, startLocation);	}}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:25,


示例27: wmalloc

struct W_Balloon *W_CreateBalloon(WMScreen * scr){	Balloon *bPtr;	bPtr = wmalloc(sizeof(Balloon));	bPtr->view = W_CreateUnmanagedTopView(scr);	if (!bPtr->view) {		wfree(bPtr);		return NULL;	}	bPtr->view->self = bPtr;	bPtr->textColor = WMRetainColor(bPtr->view->screen->black);	WMCreateEventHandler(bPtr->view, StructureNotifyMask, handleEvents, bPtr);	W_ResizeView(bPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);	bPtr->flags.alignment = DEFAULT_ALIGNMENT;	bPtr->table = WMCreateHashTable(WMIntHashCallbacks);	bPtr->delay = DEFAULT_DELAY;	bPtr->flags.enabled = 1;	return bPtr;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:28,



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


C++ wmb函数代码示例
C++ wm_get函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。