xref: /haiku/headers/private/package/DaemonDefs.h (revision 37fedaf8494b34aad811abcc49e79aa32943f880)
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_INSTALLATION_LOCATION_BUSY,
22 	B_DAEMON_CHANGE_COUNT_MISMATCH,
23 	B_DAEMON_BAD_REQUEST,
24 	B_DAEMON_NO_SUCH_PACKAGE,
25 	B_DAEMON_PACKAGE_ALREADY_EXISTS
26 };
27 
28 
29 // message codes for requests to and replies from the daemon
30 enum {
31 	B_MESSAGE_GET_INSTALLATION_LOCATION_INFO		= 'PKLI',
32 		// "location": int32
33 		//		the respective installation location constant
34 	B_MESSAGE_GET_INSTALLATION_LOCATION_INFO_REPLY	= 'PKLR',
35 		// "base directory device": int32
36 		// "base directory node": int64
37 		// "packages directory device": int32
38 		// "packages directory node": int64
39 		// "change count": int64
40 		// "active packages": message[]
41 		//		archived BPackageInfos of the active packages
42 		// "inactive packages": message[]
43 		//		archived BPackageInfos of the inactive packages
44 
45 	B_MESSAGE_COMMIT_TRANSACTION		= 'PKTC',
46 		// "location": int32
47 		//		the respective installation location constant
48 		// "change count": int64
49 		//		the expected change count of the installation location; fail,
50 		//		if something has changed in the meantime
51 		// "transaction": string
52 		//		name of the transaction directory (subdirectory of the
53 		//		administrative directory) where to-be-activated packages live
54 		// "activate": string[]
55 		//		file names of the packages to activate; must be in the
56 		//		transaction directory
57 		// "deactivate": string[]
58 		//		file names of the packages to activate; must be in the
59 		//		transaction directory
60 	B_MESSAGE_COMMIT_TRANSACTION_REPLY	= 'PKTR'
61 		// "error": int32
62 		//		regular error code or BDaemonError describing how committing
63 		//		the transaction went
64 		// "error message": string
65 		//		[error case only] gives some additional information what went
66 		//		wrong; optional
67 		// "error package": string
68 		//		[error case only] file name of the package causing the error,
69 		//		if any in particarly; optional
70 		// "old state": string
71 		//		name of the directory (subdirectory of the administrative
72 		//		directory) containing the deactivated packages
73 };
74 
75 
76 }	// namespace BPrivate
77 }	// namespace BPackageKit
78 
79 
80 #endif	// _PACKAGE__PRIVATE__DAEMON_DEFS_H_
81