本文整理汇总了C++中FskMemPtrDispose函数的典型用法代码示例。如果您正苦于以下问题:C++ FskMemPtrDispose函数的具体用法?C++ FskMemPtrDispose怎么用?C++ FskMemPtrDispose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FskMemPtrDispose函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: FskFSFileGetPathInfo
// ---------------------------------------------------------------------
FskErr FskFSFileGetPathInfo(const char *rootpath, const char *filepath, FskFileInfo *itemInfo) {
int err;
STATTYPE statbuf;
char *fullpath;
err = FskMemPtrNew(FskStrLen(rootpath) + FskStrLen(filepath) + 2, (FskMemPtr*)(void*)&fullpath);
if (err)
return err;
FskStrCopy(fullpath, rootpath);
FskStrCat(fullpath, "/");
FskStrCat(fullpath, filepath);
err = STAT(fullpath, &statbuf);
if (err == -1) {
err = errnoToFskErr(errno);
goto bail;
}
GetFileInfoFromStat(&statbuf, itemInfo);
bail:
FskMemPtrDispose(fullpath);
if (err)
FskMemSet(itemInfo, 0, sizeof(*itemInfo));
return err;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:28,代码来源:FskFilesAndroid.c
示例2: FskFSFileOpen
// ---------------------------------------------------------------------
FskErr FskFSFileOpen(const char *fullPath, UInt32 permissions, FskFSFile *frefOut) {
FskErr err;
FskFSFile fref;
FskFileInfo itemInfo;
if (frefOut)
*frefOut = NULL;
err = sCheckFullPath(fullPath, kFskPathIsFile);
BAIL_IF_ERR(err);
err = FskFSFileGetFileInfo(fullPath, &itemInfo);
BAIL_IF_ERR(err);
if (itemInfo.filetype == kFskDirectoryItemIsDirectory)
BAIL(kFskErrIsDirectory);
err = FskMemPtrNewClear(sizeof(FskFSFileRecord), (FskMemPtr*)(void*)&fref);
BAIL_IF_NONZERO(err, err, kFskErrMemFull);
fref->thePermissions = permissions;
fref->theFile = FOPEN(fullPath, sPermsToPermStr(permissions));
if (!fref->theFile) {
FskMemPtrDispose(fref);
BAIL(errnoToFskErr(errno));
}
*frefOut = fref;
bail:
return err;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:34,代码来源:FskFilesAndroid.c
示例3: FskFSVolumeIteratorDispose
// ---------------------------------------------------------------------
FskErr FskFSVolumeIteratorDispose(FskFSVolumeIterator volIt)
{
if (volIt)
FskMemPtrDispose(volIt);
return kFskErrNone;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:8,代码来源:FskFilesAndroid.c
示例4: unpackAndroid
void unpackAndroid() {
char * src, *dst, buf[4096];
int doit=0;
UInt32 amt, amtWrt;
FskFileInfo info, infoSrc;
FskFile srcFref, dstFref;
FskErr err;
dst = FskStrDoCat(gAndroidCallbacks->getStaticDataDirCB(), "ca-bundle.crt");
src = FskStrDoCat(gAndroidCallbacks->getStaticAppDirCB(), "/res/raw/kinoma.jet/ca-bundle.crt");
if (kFskErrFileNotFound == FskFileGetFileInfo(dst, &info)) {
fprintf(stderr, "dst: %s not found\n", dst);
doit = 1;
}
else if (kFskErrNone == FskFileGetFileInfo(src, &infoSrc)) {
if (infoSrc.filesize != info.filesize) {
fprintf(stderr, "src size: %lld, dstSize: %lld\n", infoSrc.filesize, info.filesize);
doit = 1;
}
}
if (doit) {
fprintf(stderr, "Need to copy it over.\n");
err = FskFileOpen(src, kFskFilePermissionReadOnly, &srcFref);
if (err) fprintf(stderr, "open %s failed %d\n", src, err);
err = FskFileCreate(dst);
if (err) fprintf(stderr, "create %s failed %d\n", dst, err);
err = FskFileOpen(dst, kFskFilePermissionReadWrite, &dstFref);
if (err) fprintf(stderr, "open %s failed %d\n", dst, err);
while (kFskErrNone == err) {
err = FskFileRead(srcFref, 4096, buf, &amt);
if (err) fprintf(stderr, "read %s (%lu bytes) failed %d\n", src, amt, err);
if (0 >= amt)
break;
while (amt) {
err = FskFileWrite(dstFref, amt, buf, &amtWrt);
if (err) fprintf(stderr, "write %s (%lu bytes) failed %d\n", dst, amt, err);
amt -= amtWrt;
}
}
err = FskFileClose(dstFref);
if (err) fprintf(stderr, "close %s failed %d\n", src, err);
err = FskFileClose(srcFref);
if (err) fprintf(stderr, "close %s failed %d\n", src, err);
}
FskMemPtrDispose(src);
FskMemPtrDispose(dst);
}
开发者ID:afrog33k,项目名称:kinomajs,代码行数:47,代码来源:FskSSL.c
示例5: loadGrammar
FskErr loadGrammar(const char *xsbPath, xsGrammar *theGrammar)
{
FskErr err;
FskFile fref = NULL;
UInt32 atom[2];
err = FskFileOpen(xsbPath, kFskFilePermissionReadOnly, &fref);
if (err) goto bail;
err = FskFileRead(fref, sizeof(atom), atom, NULL);
if (err) goto bail;
atom[0] = FskEndianU32_BtoN(atom[0]);
atom[1] = FskEndianU32_BtoN(atom[1]);
if (atom[1] == 'XS11') {
SInt32 totalSize = (SInt32)atom[0] - sizeof(atom);
while (totalSize > 0) {
UInt32 blockSize;
char *block;
err = FskFileRead(fref, sizeof(atom), atom, NULL);
if (err) break;
atom[0] = FskEndianU32_BtoN(atom[0]);
atom[1] = FskEndianU32_BtoN(atom[1]);
totalSize -= atom[0];
blockSize = atom[0] - sizeof(atom);
err = FskMemPtrNew(blockSize, &block);
if (err) break;
err = FskFileRead(fref, blockSize, block, NULL);
if (err) break;
switch (atom[1]) {
case 'SYMB':
theGrammar->symbols = block;
theGrammar->symbolsSize = blockSize;
break;
case 'CODE':
theGrammar->code = block;
theGrammar->codeSize = blockSize;
break;
default:
FskMemPtrDispose(block);
err = kFskErrBadData;
break;
}
}
}
else
err = kFskErrBadData;
bail:
FskFileClose(fref);
return err;
}
开发者ID:giapdangle,项目名称:kinomajs,代码行数:59,代码来源:FskECMAScript.c
示例6: FillJaggyPolygonContours
static FskErr
FillJaggyPolygonContours(
UInt32 nContours,
const UInt32 *nPts,
const FskFixedPoint2D *pts,
const FskColorSource *colorSource,
SInt32 fillRule,
const FskFixedMatrix3x2 *M,
FskConstRectangle clipRect,
FskBitmap dstBM
)
{
FskRectangleRecord dstRect;
LinkedEdge edges[MAX_EDGES], *pEdges = edges; /* Small polygons use auto edges, large ones need to be alloc'ed */
UInt32 numEdges, totPts;
FskSpan span;
FskErr err = kFskErrNone;
SInt32 n;
const UInt32 *np;
LinkedEdge *pe;
static FskInitSpanProc initProcs[] = {
FskInitSolidColorSpan,
FskInitLinearGradientSpan,
FskInitRadialGradientSpan,
FskInitTextureSpan,
NULL /* Procedure span is not yet implemented */
};
FskInitSpanProc initSpan;
if (clipRect == NULL) dstRect = dstBM->bounds;
else if (!FskRectangleIntersect(&dstBM->bounds, clipRect, &dstRect)) return kFskErrNothingRendered;
for (n = nContours, np = nPts, totPts = 0; n--; )
totPts += *np++;
FskInitSpan(&span, dstBM, sizeof(LinkedEdge)); /* Generic span init */
initSpan = initProcs[((n = colorSource->type) <= kFskColorSourceTypeMax) ? n : 0];
if ((err = (*initSpan)(&span, dstBM, M, 0, colorSource)) != kFskErrNone) /* Specialized span init - this may bump up the edge size */
return err;
span.edgeBytes = (span.edgeBytes + 3) & ~3; /* Ceil up to multiple of 4 bytes */
if ( CANT_USE_AUTO_EDGES(totPts) /* Either small enough for auto storage ... */
&& (err = (FskMemPtrNew(totPts * CLIP_MULTIPLIER * sizeof(LinkedEdge), (FskMemPtr*)(void*)(&pEdges))) != kFskErrNone) /* ... or we can allocate memory */
)
return err; /* Polygon is too big to render */
for (numEdges = 0, pe = pEdges; nContours--; pts += *nPts++, numEdges += n, pe += n)
BAIL_IF_NEGATIVE(n = TransformClipAndMakeEdges(*nPts, pts, M, &dstRect, &span, pe), err, kFskErrMemFull);
BAIL_IF_FALSE(numEdges >= 2, err, kFskErrNothingRendered);
err = ScanConvertLinkedEdges(numEdges, pEdges, fillRule, &span);
bail:
if (pEdges != edges)
FskMemPtrDispose(pEdges); /* Deallocate big polygon edges */
if ((span.disposeSpanData != NULL) && (span.spanData != NULL))
span.disposeSpanData(span.spanData);
return err;
}
开发者ID:kouis3940,项目名称:kinomajs,代码行数:59,代码来源:FskPolygon.c
示例7: kcl_int_free
static void
kcl_int_free(cint_t *ai)
{
if (ai->cint_data != NULL) {
FskMemPtrDispose(ai->cint_data);
ai->cint_data = NULL;
}
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:8,代码来源:arith_kcl.c
示例8: mraaPWMDispose
void mraaPWMDispose(FskPinPWM pin)
{
mraaPWM mpwm = (mraaPWM)pin;
mraaPWMSetDutyCycle(pin, 0);
mraa_pwm_enable(mpwm->context, 0);
mraa_pwm_close(mpwm->context);
FskMemPtrDispose(mpwm);
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:8,代码来源:FskPinPWMMRAA.c
示例9: androidAudioOutDispose
FskErr androidAudioOutDispose(FskAudioOut audioOut) {
androidAudioExt *ext;
FskAudioNativePrintfVerbose("audioOutDispose %x", audioOut);
if (audioOut == NULL)
return kFskErrNone;
ext = (androidAudioExt*)audioOut->ext;
FskAudioNativePrintfVerbose("audioOutDispose ext is %x", ext);
if (ext) {
androidAudioOutStop(audioOut);
audioOut->ext = 0;
FskListMutexRemove(audioOuts, audioOut);
FskAudioNativePrintfDebug("removing audioOut->blocks list %x", audioOut->blocks);
FskListMutexDispose(audioOut->blocks);
FskMutexDispose(ext->getSamplePositionMutex);
if (ext->playItf) {
SLresult res;
FskAudioNativePrintfDebug("before delete ext->playItf: %x", ext->playItf);
res = (*ext->playItf)->SetPlayState(ext->playItf, SL_PLAYSTATE_STOPPED);
CheckErr("audioOutDispose - set playstate STOPPED", res);
res = (*ext->bufferQueueItf)->Clear(ext->bufferQueueItf);
CheckErr("audioOutDispose - calling clear on bufferQueue", res);
FskAudioNativePrintfDebug("after delete ext->playItf: %x", ext->playItf);
}
if (ext->audioBuf[0])
FskMemPtrDispose(ext->audioBuf[0]);
if (ext->audioBuf[1])
FskMemPtrDispose(ext->audioBuf[1]);
if (ext->player != NULL)
(*ext->player)->Destroy(ext->player);
if (ext->outputMixObject != NULL)
(*ext->outputMixObject)->Destroy(ext->outputMixObject);
FskMemPtrDispose(ext);
}
FskMemPtrDispose(audioOut);
return kFskErrNone;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:46,代码来源:androidAudio3.cpp
示例10: xs_i2c
void xs_i2c(void *data)
{
if (data) {
xsI2C i2c = data;
FskPinI2CDispose(i2c->pin);
FskMemPtrDispose(i2c);
}
}
开发者ID:dadongdong,项目名称:kinomajs,代码行数:8,代码来源:i2c.c
示例11: KplSemaphoreDispose
FskErr KplSemaphoreDispose(KplSemaphore sem)
{
if (sem) {
sem_destroy(&sem->hSem);
FskMemPtrDispose(sem);
}
return kFskErrNone;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:8,代码来源:KplSynchronizationLinux.c
示例12: FskFSFileClose
// ---------------------------------------------------------------------
FskErr FskFSFileClose(FskFSFile fref) {
if (fref) {
fclose(fref->theFile);
FskMemPtrDispose(fref);
}
return kFskErrNone;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:9,代码来源:FskFilesAndroid.c
示例13: FskFSFileTerminate
FskErr FskFSFileTerminate()
{
if (gStatFS != NULL) {
FskMemPtrDispose(gStatFS);
gStatFS = NULL;
}
return kFskErrNone;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:8,代码来源:FskFilesMac.c
示例14: KplTimeCallbackDispose
void KplTimeCallbackDispose(KplTimeCallback callback)
{
if (NULL == callback)
return;
KplTimeCallbackCancel(callback);
FskMemPtrDispose(callback);
}
开发者ID:kouis3940,项目名称:kinomajs,代码行数:8,代码来源:KplTimeCallbackLinux.c
示例15: KprHTTPConnectionDispose
void KprHTTPConnectionDispose(KprHTTPConnection self)
{
if (self->client) {
KprHTTPConnectionClose(self);
}
FskInstrumentedItemDispose(self);
FskMemPtrDispose(self);
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:8,代码来源:kprHTTPClient.c
示例16: KplAudioDispose
FskErr KplAudioDispose(KplAudio audio)
{
FskErr err = kFskErrNone;
if (!audio) goto bail;
if (audio->thread) {
audio->stopping = true;
FskThreadJoin(audio->thread);
}
KplMutexDispose(audio->mutex);
audio->mutex = NULL;
FskMemPtrDispose(audio->data);
FskMemPtrDispose(audio);
bail:
return err;
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:17,代码来源:KplAudioLinuxALSA.c
示例17: KprDebugDispose
void KprDebugDispose(KprDebug self)
{
if (self) {
KprDebugClose(self);
FskInstrumentedItemDispose(self);
FskMemPtrDispose(self);
}
}
开发者ID:dadongdong,项目名称:kinomajs,代码行数:8,代码来源:kprDebug.c
示例18: KPR_Message
void KPR_Message(xsMachine* the)
{
xsStringValue url = NULL;
KprMessage self = NULL;
xsTry {
xsThrowIfFskErr(KprMessageURL(xsGetContext(the), xsToString(xsArg(0)), &url));
xsThrowIfFskErr(KprMessageNew(&self, url));
xsSetHostData(xsThis, self);
FskInstrumentedItemSendMessageDebug(self, kprInstrumentedMessageConstruct, self);
self->usage++; // host
FskMemPtrDispose(url);
}
xsCatch {
FskMemPtrDispose(url);
xsThrow(xsException);
}
}
开发者ID:basuke,项目名称:kinomajs,代码行数:17,代码来源:kprMessage.c
示例19: on_drag_data_received
void on_drag_data_received(GtkWidget* widget, GdkDragContext* context, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data)
{
FskGtkWindow gtkWin = user_data;
gboolean dnd_success = FALSE;
FskDragDropFile dropFileList = NULL;
FskDragDropFile droppedFile = NULL;
char* path = NULL;
if (gdk_drag_context_get_suggested_action(context) == GDK_ACTION_COPY) {
char* string = (char*)gtk_selection_data_get_data(data);
char* end;
FskFileInfo itemInfo;
for (end = FskStrStr(string, "\r\n"); end; end = FskStrStr(string, "\r\n")) {
BAIL_IF_ERR(FskMemPtrNewClear(sizeof(FskDragDropFileRecord), (FskMemPtr*)&droppedFile));
FskListAppend((FskList *)&dropFileList, droppedFile);
*end = 0;
BAIL_IF_ERR(KprURLToPath(string, &path));
BAIL_IF_ERR(FskFileGetFileInfo(path, &itemInfo));
if (itemInfo.filetype == kFskDirectoryItemIsDirectory) {
int length = FskStrLen(path);
BAIL_IF_ERR(FskMemPtrNew(length + 2, &droppedFile->fullPathName));
FskMemCopy(droppedFile->fullPathName, path, length);
droppedFile->fullPathName[length] = '/';
droppedFile->fullPathName[length + 1] = 0;
FskMemPtrDispose(path);
}
else {
droppedFile->fullPathName = path;
}
path = NULL;
string = end + 2;
*end = '\r';
}
(*gDropTargetProc)(kFskDragDropTargetEnterWindow, x, y, dropFileList, gtkWin->owner);
(*gDropTargetProc)(kFskDragDropTargetDropInWindow, x, y, dropFileList, gtkWin->owner);
dnd_success = TRUE;
}
bail:
gtk_drag_finish(context, dnd_success, TRUE, time);
FskMemPtrDispose(path);
while (NULL != dropFileList) {
droppedFile = dropFileList;
FskListRemove((FskList *)&dropFileList, droppedFile);
FskMemPtrDispose(droppedFile->fullPathName);
FskMemPtrDispose(droppedFile);
}
}
开发者ID:VzqzAc,项目名称:kinomajs,代码行数:46,代码来源:FskGtkWindow.c
示例20: KprSSDPClientDispose
void KprSSDPClientDispose(KprSSDPClient self)
{
if (!self) return;
if (FskListContains(&gKprSSDPClients, self)) {
(void)KprSSDPClientStop(self);
}
if (self->services) {
UInt32 i;
for (i = 0; self->services[i]; i++) {
FskMemPtrDispose(self->services[i]);
}
FskMemPtrDispose(self->services);
}
FskMemPtrDispose(self->type);
FskInstrumentedItemDispose(self);
FskMemPtrDispose(self);
}
开发者ID:Kazu-zamasu,项目名称:kinomajs,代码行数:17,代码来源:kprSSDPClient.c
注:本文中的FskMemPtrDispose函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论