summaryrefslogtreecommitdiff
path: root/amiga/arexx.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2014-10-26 15:41:44 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2014-10-26 15:41:44 +0000
commit0c77d85f8976046b0c5cf2915f0618e1522099ac (patch)
tree5ea4da05ae8c4b57e306d3f61867c5670e3d7130 /amiga/arexx.c
parentb751513d6f1515976238adf68598729b9021160f (diff)
downloadnetsurf-0c77d85f8976046b0c5cf2915f0618e1522099ac.tar.gz
netsurf-0c77d85f8976046b0c5cf2915f0618e1522099ac.tar.bz2
Make window counting a generic function
Diffstat (limited to 'amiga/arexx.c')
-rw-r--r--amiga/arexx.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/amiga/arexx.c b/amiga/arexx.c
index 7a367e893..120656f69 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -537,29 +537,14 @@ STATIC VOID rx_reload(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((u
STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
{
int windows = 0, tabs = 0;
+ int window = 0;
struct nsObject *node, *nnode;
struct gui_window_2 *gwin;
+ if(cmd->ac_ArgList[0]) window = *(ULONG *)cmd->ac_ArgList[0];
cmd->ac_RC = 0;
- if(!IsMinListEmpty(window_list))
- {
- node = (struct nsObject *)GetHead((struct List *)window_list);
-
- do
- {
- nnode=(struct nsObject *)GetSucc((struct Node *)node);
-
- gwin = node->objstruct;
-
- if(node->Type == AMINS_WINDOW)
- {
- windows++;
- if((cmd->ac_ArgList[0]) && (*(ULONG *)cmd->ac_ArgList[0] == windows))
- tabs = gwin->tabs;
- }
- } while(node = nnode);
- }
+ windows = ami_gui_count_windows(window, &tabs);
if(cmd->ac_ArgList[0]) sprintf(result, "%d", tabs);
else sprintf(result, "%d", windows);