diff options
Diffstat (limited to 'plugins/WhoUsesMyFiles/src/list.cpp')
-rw-r--r-- | plugins/WhoUsesMyFiles/src/list.cpp | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/plugins/WhoUsesMyFiles/src/list.cpp b/plugins/WhoUsesMyFiles/src/list.cpp index 7b9251cc19..8452df05fb 100644 --- a/plugins/WhoUsesMyFiles/src/list.cpp +++ b/plugins/WhoUsesMyFiles/src/list.cpp @@ -1,13 +1,6 @@ #include "stdafx.h"
-PWumf new_wumf( uint32_t dwID,
- LPTSTR szUser,
- LPTSTR szPath,
- LPTSTR szComp,
- LPTSTR szUNC,
- uint32_t dwSess,
- uint32_t dwPerm,
- uint32_t dwAttr)
+PWumf new_wumf(uint32_t dwID, LPTSTR szUser, LPTSTR szPath, LPTSTR szComp, LPTSTR szUNC, uint32_t dwSess, uint32_t dwPerm, uint32_t dwAttr)
{
PWumf w = (PWumf)mir_calloc(sizeof(Wumf));
if (!w)
@@ -16,13 +9,13 @@ PWumf new_wumf( uint32_t dwID, w->szUser = mir_wstrdup(szUser);
w->szPath = mir_wstrdup(szPath);
w->szComp = mir_wstrdup(szComp);
- w->szUNC = mir_wstrdup(szUNC);
+ w->szUNC = mir_wstrdup(szUNC);
- switch(dwPerm) {
- case PERM_FILE_READ: mir_wstrcpy(w->szPerm, L"Read");break;
- case PERM_FILE_WRITE: mir_wstrcpy(w->szPerm, L"Write");break;
- case PERM_FILE_CREATE: mir_wstrcpy(w->szPerm, L"Create");break;
- default: mir_wstrcpy(w->szPerm, L"Execute");
+ switch (dwPerm) {
+ case PERM_FILE_READ: mir_wstrcpy(w->szPerm, L"Read"); break;
+ case PERM_FILE_WRITE: mir_wstrcpy(w->szPerm, L"Write"); break;
+ case PERM_FILE_CREATE: mir_wstrcpy(w->szPerm, L"Create"); break;
+ default: mir_wstrcpy(w->szPerm, L"Execute");
}
mir_snwprintf(w->szID, L"%i", dwID);
@@ -32,7 +25,7 @@ PWumf new_wumf( uint32_t dwID, w->dwPerm = dwPerm;
w->mark = FALSE;
w->next = nullptr;
- return w;
+ return w;
}
BOOL del_wumf(PWumf w)
@@ -46,14 +39,14 @@ BOOL del_wumf(PWumf w) return TRUE;
}
-BOOL add_cell(PWumf* l, PWumf w)
+BOOL add_cell(PWumf *l, PWumf w)
{
if (!w || !l)return FALSE;
if (!(*l))
*l = w;
else {
PWumf p = *l;
- while(p->next) p = p->next;
+ while (p->next) p = p->next;
p->next = w;
}
w->next = nullptr;
@@ -67,7 +60,7 @@ BOOL del_cell(PWumf *l, PWumf w) if (w == *l)
*l = p->next;
else {
- while(p && p->next != w) p = p->next;
+ while (p && p->next != w) p = p->next;
if (!p) return FALSE;
p->next = w->next;
}
@@ -76,7 +69,7 @@ BOOL del_cell(PWumf *l, PWumf w) BOOL cpy_cell(PWumf *l, PWumf w)
{
- PWumf w1 = new_wumf(w->dwID, w->szUser, w->szPath, w->szComp,w->szUNC, w->dwSess, w->dwPerm, w->dwAttr);
+ PWumf w1 = new_wumf(w->dwID, w->szUser, w->szPath, w->szComp, w->szUNC, w->dwSess, w->dwPerm, w->dwAttr);
if (!w1)
return FALSE;
w1->mark = w->mark;
@@ -89,7 +82,7 @@ PWumf cpy_list(PWumf *l) if (!l || !*l) return nullptr;
w = *l;
- while(w) {
+ while (w) {
if (!cpy_cell(&p, w))return nullptr;
w = w->next;
}
@@ -100,7 +93,7 @@ PWumf fnd_cell(PWumf *l, uint32_t dwID) {
if (!l || !*l)return nullptr;
PWumf w = *l;
- while(w && w->dwID != dwID) w = w->next;
+ while (w && w->dwID != dwID) w = w->next;
return w;
}
@@ -108,9 +101,9 @@ BOOL del_all(PWumf *l) {
if (!l || !*l) return FALSE;
PWumf w = *l;
- while(w) {
+ while (w) {
PWumf p = w->next;
- if (!del_cell(l, w))
+ if (!del_cell(l, w))
return FALSE;
w = p;
@@ -124,7 +117,7 @@ BOOL del_marked(PWumf *l) PWumf w, p;
if (!l)return FALSE;
w = *l;
- while(w) {
+ while (w) {
p = w->next;
if (w->mark)
if (!del_cell(l, w))
@@ -138,7 +131,7 @@ BOOL del_marked(PWumf *l) void mark_all(PWumf *l, BOOL mark)
{
PWumf w = *l;
- while(w) {
+ while (w) {
w->mark = mark;
w = w->next;
}
|