exposurses

Check-in [bd27f3bed9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rename arrays to free up name for functions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: bd27f3bed99041a067e4559b2ea40bfbb215fa925c9fadf4d69a0b068f179b9a
User & Date: base@atomicules.co.uk 2013-08-17 12:18:10
Context
2013-08-17
12:23
Add exposure equations (don't do anything yet though) check-in: 2264820974 user: base@atomicules.co.uk tags: origin/master, trunk
12:18
Rename arrays to free up name for functions check-in: bd27f3bed9 user: base@atomicules.co.uk tags: origin/master, trunk
2013-07-13
22:13
Make "make clean" actually clean everything check-in: 7c39adc01d user: atomicules@lavabit.com tags: origin/master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to exposurses.c.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html */
#include <curses.h>
#include <menu.h>

#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define CTRLD 	4

char *iso[] = {
	"50",
	"100",
	"200",
	"400",
	"800",
	"1600",
	"3200"
};

char *shutter[] = {
	"1/1000",
	"1/500",
	"1/250",
	"1/125",
	"1/60",
	"1/30",
	"1/15",
	"1/8",
	"1/4",
	"1/2",
	"1"
};

char *aperture[] = {
	"f/1.4",
	"f/2",
	"f/2.8",
	"f/4",
	"f/5.6",
	"f/8",
	"f/11",
................................................................................
	cbreak();
	noecho();
	keypad(stdscr, TRUE);
	init_pair(1, COLOR_RED, COLOR_BLACK);
	init_pair(2, COLOR_CYAN, COLOR_BLACK);

	/* Create items */
	n_iso = ARRAY_SIZE(iso);
	n_shutter = ARRAY_SIZE(shutter);
	n_aperture = ARRAY_SIZE(aperture);
	iso_items = (ITEM **)calloc(n_iso, sizeof(ITEM *));
	for(i = 0; i < n_iso; ++i) {
		iso_items[i] = new_item(iso[i], iso[i]);
		set_item_userptr(iso_items[i], selection);
	}
	shutter_items = (ITEM **)calloc(n_shutter, sizeof(ITEM *));
	for(i = 0; i < n_shutter; ++i){
		shutter_items[i] = new_item(shutter[i], shutter[i]);
		set_item_userptr(shutter_items[i], selection);
	}
	aperture_items = (ITEM **)calloc(n_aperture, sizeof(ITEM *));
	for(i = 0; i < n_aperture; ++i){
		aperture_items[i] = new_item(aperture[i], aperture[i]);
		set_item_userptr(aperture_items[i], selection);
	}

	/* Create menu */
	iso_menu = new_menu((ITEM **)iso_items);
	shutter_menu = new_menu((ITEM **)shutter_items);
	aperture_menu = new_menu((ITEM **)aperture_items);







|









|













|







 







|
|
|


|




|




|







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html */
#include <curses.h>
#include <menu.h>

#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define CTRLD 	4

char *iso_array[] = {
	"50",
	"100",
	"200",
	"400",
	"800",
	"1600",
	"3200"
};

char *shutter_array[] = {
	"1/1000",
	"1/500",
	"1/250",
	"1/125",
	"1/60",
	"1/30",
	"1/15",
	"1/8",
	"1/4",
	"1/2",
	"1"
};

char *aperture_array[] = {
	"f/1.4",
	"f/2",
	"f/2.8",
	"f/4",
	"f/5.6",
	"f/8",
	"f/11",
................................................................................
	cbreak();
	noecho();
	keypad(stdscr, TRUE);
	init_pair(1, COLOR_RED, COLOR_BLACK);
	init_pair(2, COLOR_CYAN, COLOR_BLACK);

	/* Create items */
	n_iso = ARRAY_SIZE(iso_array);
	n_shutter = ARRAY_SIZE(shutter_array);
	n_aperture = ARRAY_SIZE(aperture_array);
	iso_items = (ITEM **)calloc(n_iso, sizeof(ITEM *));
	for(i = 0; i < n_iso; ++i) {
		iso_items[i] = new_item(iso_array[i], iso_array[i]);
		set_item_userptr(iso_items[i], selection);
	}
	shutter_items = (ITEM **)calloc(n_shutter, sizeof(ITEM *));
	for(i = 0; i < n_shutter; ++i){
		shutter_items[i] = new_item(shutter_array[i], shutter_array[i]);
		set_item_userptr(shutter_items[i], selection);
	}
	aperture_items = (ITEM **)calloc(n_aperture, sizeof(ITEM *));
	for(i = 0; i < n_aperture; ++i){
		aperture_items[i] = new_item(aperture_array[i], aperture_array[i]);
		set_item_userptr(aperture_items[i], selection);
	}

	/* Create menu */
	iso_menu = new_menu((ITEM **)iso_items);
	shutter_menu = new_menu((ITEM **)shutter_items);
	aperture_menu = new_menu((ITEM **)aperture_items);