summaryrefslogtreecommitdiff
path: root/src/number.h
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-03-07 03:14:35 +0000
committersabetts <sabetts>2003-03-07 03:14:35 +0000
commitb5659f308a72902befb87c81e1e4a4f1d98d209d (patch)
tree6056d8cbfd4d89a1190952436e747a5d3ea54faf /src/number.h
parent293fca91a75f15c696c2f1d9dd4227f558cfc26f (diff)
downloadratpoison-b5659f308a72902befb87c81e1e4a4f1d98d209d.zip
* src/main.c (main): call init_window_stuff(). Remove call to init_numbers().
(clean_up): call free_window_stuff(). Remove call to free_numbers(). * src/list.h (free_window_stuff): new prototype (init_window_stuff): likewise * src/list.c (rp_window_numset): new global (init_window_stuff): new function (free_window_stuff): new function * src/data.h (rp_window_numset): new extern * src/number.c (numset_init): new function (number_is_taken): rename to numset_num_is_taken, callers updated. (find_empty_cell): rename to numset_find_empty_cell, callers updated. (add_window_number): rename to numset_add_num, callers updated. (return_window_number): rename to numset_release, callers updated. (init_numbers): remove function (free_numbers): rename to numset_free, callers updated. (numset_num_is_taken): take struct numset* as an argument. (numset_find_empty_cell): likewise (numset_add_num): likewise (numset_request): likewise (numset_release): likewise (numset_free): likewise (numset_new): new function
Diffstat (limited to 'src/number.h')
-rw-r--r--src/number.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/number.h b/src/number.h
index caecff5..1fc6a09 100644
--- a/src/number.h
+++ b/src/number.h
@@ -22,10 +22,24 @@
#ifndef _RATPOISON_NUMBER_H
#define _RATPOISON_NUMBER_H 1
-int get_unique_window_number ();
-void return_window_number (int n);
-int add_window_number (int n);
-void init_numbers ();
-void free_numbers ();
+/* Keep track of a set of numbers. For frames and windows. */
+struct numset
+{
+ /* A list of the numbers taken. */
+ int *numbers_taken;
+
+/* the number of numbers currently stored in the numbers_taken
+ array. */
+ int num_taken;
+
+/* the size of the numbers_taken array. */
+ int max_taken;
+};
+
+struct numset *numset_new ();
+void numset_free (struct numset *ns);
+void numset_release (struct numset *ns, int n);
+int numset_request (struct numset *ns);
+int numset_add_num (struct numset *ns, int n);
#endif /* ! _RATPOISON_NUMBER_H */