xref: /haiku/headers/private/package/DaemonDefs.h (revision 85d2badf007cb152215485db7916578ed6700504)
1 /*
2  * Copyright 2013, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold <ingo_weinhold@gmx.de>
7  */
8 #ifndef _PACKAGE__PRIVATE__DAEMON_DEFS_H_
9 #define _PACKAGE__PRIVATE__DAEMON_DEFS_H_
10 
11 
12 namespace BPackageKit {
13 namespace BPrivate {
14 
15 
16 #define B_PACKAGE_DAEMON_APP_SIGNATURE "application/x-vnd.haiku-package_daemon"
17 
18 
19 enum BDaemonError {
20 	B_DAEMON_OK = 0,
21 	B_DAEMON_CHANGE_COUNT_MISMATCH,
22 	B_DAEMON_BAD_REQUEST,
23 	B_DAEMON_NO_SUCH_PACKAGE,
24 	B_DAEMON_PACKAGE_ALREADY_EXISTS
25 };
26 
27 
28 // message codes for requests to and replies from the daemon
29 enum {
30 	B_MESSAGE_GET_INSTALLATION_LOCATION_INFO		= 'PKLI',
31 		// "location": int32
32 		//		the respective installation location constant
33 	B_MESSAGE_GET_INSTALLATION_LOCATION_INFO_REPLY	= 'PKLR',
34 		// "base directory device": int32
35 		// "base directory node": int64
36 		// "packages directory device": int32
37 		// "packages directory node": int64
38 		// "change count": int64
39 		// "active packages": message[]
40 		//		archived BPackageInfos of the active packages
41 		// "inactive packages": message[]
42 		//		archived BPackageInfos of the inactive packages
43 
44 	B_MESSAGE_COMMIT_TRANSACTION		= 'PKTC',
45 		// "location": int32
46 		//		the respective installation location constant
47 		// "change count": int64
48 		//		the expected change count of the installation location; fail,
49 		//		if something has changed in the meantime
50 		// "transaction": string
51 		//		name of the transaction directory (subdirectory of the
52 		//		administrative directory) where to-be-activated packages live
53 		// "activate": string[]
54 		//		file names of the packages to activate; must be in the
55 		//		transaction directory
56 		// "deactivate": string[]
57 		//		file names of the packages to activate; must be in the
58 		//		transaction directory
59 	B_MESSAGE_COMMIT_TRANSACTION_REPLY	= 'PKTR'
60 		// "error": int32
61 		//		regular error code or BDaemonError describing how committing
62 		//		the transaction went
63 		// "error message": string
64 		//		[error case only] gives some additional information what went
65 		//		wrong; optional
66 		// "error package": string
67 		//		[error case only] file name of the package causing the error,
68 		//		if any in particarly; optional
69 		// "old state": string
70 		//		name of the directory (subdirectory of the administrative
71 		//		directory) containing the deactivated packages
72 };
73 
74 
75 }	// namespace BPrivate
76 }	// namespace BPackageKit
77 
78 
79 #endif	// _PACKAGE__PRIVATE__DAEMON_DEFS_H_
80