static int _Everything_CompareA(const VOID *a,const VOID *b) { int i; i = stricmp(EVERYTHING_IPC_ITEMPATH(_Everything_List,a),EVERYTHING_IPC_ITEMPATH(_Everything_List,b)); if (!i) { return stricmp(EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,a),EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,b)); } else if (i > 0) { return 1; } else { return -1; } }
LPCSTR EVERYTHINGAPI Everything_GetResultFileNameA(int nIndex) { LPCSTR ret; _Everything_Lock(); if ((_Everything_List) && (!_Everything_IsUnicodeQuery)) { if (nIndex < 0) { _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; ret = NULL; goto exit; } if (nIndex >= (int)((EVERYTHING_IPC_LISTA *)_Everything_List)->numitems) { _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; ret = NULL; goto exit; } ret = EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex]); } else { _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; ret = NULL; } exit: _Everything_Unlock(); return ret; }
int EVERYTHINGUSERAPI Everything_GetResultFullPathNameA(int nIndex,LPSTR buf,int bufsize) { int len; _Everything_Lock(); if (_Everything_List) { if (nIndex < 0) { _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; len = _Everything_CopyA(buf,bufsize,0,""); goto exit; } if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems) { _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; len = _Everything_CopyA(buf,bufsize,0,""); goto exit; } len = 0; if (_Everything_IsUnicodeQuery) { len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); } else { len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); } if (len) { len = _Everything_CopyA(buf,bufsize,len,"\\"); } if (_Everything_IsUnicodeQuery) { len = _Everything_CopyAFromW(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); } else { len = _Everything_CopyA(buf,bufsize,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); } } else { _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; len = _Everything_CopyA(buf,bufsize,0,""); } exit: _Everything_Unlock(); return len; }
int EVERYTHINGAPI Everything_GetResultFullPathNameW(int nIndex,LPWSTR wbuf,int wbuf_size_in_wchars) { int len; _Everything_Lock(); if (_Everything_List) { if (nIndex < 0) { _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); goto exit; } if (nIndex >= (int)((EVERYTHING_IPC_LISTW *)_Everything_List)->numitems) { _Everything_LastError = EVERYTHING_ERROR_INVALIDINDEX; len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); goto exit; } len = 0; if (_Everything_IsUnicodeQuery) { len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMPATHW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); } else { len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMPATHA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); } if (len) { len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,L"\\"); } if (_Everything_IsUnicodeQuery) { len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEW(_Everything_List,&((EVERYTHING_IPC_LISTW *)_Everything_List)->items[nIndex])); } else { len = _Everything_CopyWFromA(wbuf,wbuf_size_in_wchars,len,EVERYTHING_IPC_ITEMFILENAMEA(_Everything_List,&((EVERYTHING_IPC_LISTA *)_Everything_List)->items[nIndex])); } } else { _Everything_LastError = EVERYTHING_ERROR_INVALIDCALL; len = _Everything_CopyW(wbuf,wbuf_size_in_wchars,0,L""); } exit: _Everything_Unlock(); return len; }