AmendHub

Download

jcs

/

detritus

/

gemino.h

 

(View History)

jcs   *: Rename to Detritus Latest amendment: 9 on 2024-10-25

1 /*
2 * Copyright (c) 2022 joshua stein <jcs@jcs.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef __GEMINO_H__
18 #define __GEMINO_H__
19
20 #include "browser.h"
21 #include "util.h"
22
23 #define PROGRAM_NAME "Gemino"
24
25 #define MBAR_ID 128
26
27 #define APPLE_MENU_ID 128
28 #define APPLE_MENU_ABOUT_ID 1
29
30 #define FILE_MENU_ID 129
31 #define FILE_MENU_QUIT_ID 1
32
33 #define EDIT_MENU_ID 130
34 #define EDIT_MENU_CUT_ID 1
35 #define EDIT_MENU_COPY_ID 2
36 #define EDIT_MENU_PASTE_ID 3
37 #define EDIT_MENU_SELECT_ALL_ID 4
38
39 #define DEFAULT_GEMINI_PORT 1965
40
41 struct tls_init_request {
42 uint8_t flags[2];
43 #define BLUESCSI_TLS_INIT_REQUEST_FLAG_NO_VERIFY (1 << 0)
44 uint8_t unix_time[4];
45 char hostname[256];
46 };
47
48 extern MenuHandle file_menu, edit_menu;
49
50 void menu_defaults(void);
51
52 short scsi_find_tls(void);
53 bool scsi_tls_init(char tls_id, unsigned char *buf, size_t buf_size,
54 struct tls_init_request *req);
55 bool scsi_tls_close(char tls_id);
56 short scsi_tls_status(char tls_id, unsigned char *buf, size_t buf_size,
57 short *cipherspace, short *plainspace, short *error);
58 size_t scsi_tls_read(char tls_id, unsigned char *buf, size_t buf_size,
59 bool cipher);
60 size_t scsi_tls_write(char tls_id, unsigned char *buf, size_t buf_size,
61 bool cipher);
62 void scsi_cleanup(void);
63
64 #endif