changed destroy_page return type

This commit is contained in:
Anselm R. Garbe 2006-02-28 13:38:24 +01:00
parent e872e07bb7
commit 757a026b2b
3 changed files with 12 additions and 5 deletions

View File

@ -601,8 +601,11 @@ xremove(IXPConn *c, Fcall *fcall)
return Enofile;
switch(type) {
case Dpage:
if(destroy_page(page[i1]) == page[i1])
return Enoperm;
{
char *ret = destroy_page(page[i1]);
if(ret)
return ret;
}
break;
case Dlabel:
{

View File

@ -27,7 +27,7 @@ alloc_page()
return p;
}
Page *
char *
destroy_page(Page *p)
{
unsigned int i;
@ -36,7 +36,7 @@ destroy_page(Page *p)
for(i = 0; i < p->narea; i++)
if(p->area[i]->nclient)
return p;
return "page not empty";
while(p->narea)
destroy_area(p->area[0]);

View File

@ -59,6 +59,8 @@ typedef struct Area Area;
typedef struct Page Page;
typedef struct Client Client;
typedef enum { COL_MAX, COL_EQUAL, COL_STACK } ColumnMode;
struct Area {
unsigned short id;
Client **client;
@ -66,6 +68,8 @@ struct Area {
size_t clientsz;
size_t sel;
size_t nclient;
size_t maxclient;
ColumnMode mode;
XRectangle rect;
};
@ -261,7 +265,7 @@ char *warp_mouse(char *arg);
/* page.c */
Page *alloc_page();
Page *destroy_page(Page *p);
char *destroy_page(Page *p);
void focus_page(Page *p);
XRectangle *rectangles(unsigned int *num);
int pid_to_index(unsigned short id);