Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / JAVA / libjafs / Internal.h
1 #ifndef _Jafsadm_Internal
2 #define _Jafsadm_Internal
3
4 #include <jni.h>
5 #include "Exceptions.h"
6
7 #ifndef LIBJUAFS
8 #include <afs_Admin.h>
9 #include <afs_kasAdmin.h>
10
11 // error codes
12 #define JAFSADMNOMEM 1050 // Memory problems
13 #define JAFSADMCLASSNOTFOUND 1051 // Trouble finding a Java class
14 #define JAFSADMMETHODNOTFOUND 1052 // Trouble finding a Java method
15 #define JAFSADMFIELDNOTFOUND 1053 // Trouble finding a Java field
16
17 // make an identity out of a full name (possibly including an instance )
18 void internal_makeKasIdentity( const char *fullName, kas_identity_p who );
19
20 void internal_getUserClass( JNIEnv *env, jobject user );
21 void internal_getGroupClass( JNIEnv *env, jobject group );
22 void internal_getServerClass( JNIEnv *env, jobject server );
23 void internal_getPartitionClass( JNIEnv *env, jobject partition );
24 void internal_getVolumeClass( JNIEnv *env, jobject volume );
25 void internal_getKeyClass( JNIEnv *env, jobject key );
26 void internal_getProcessClass( JNIEnv *env, jobject process );
27 #else
28 int openAFSFile(JNIEnv *env, jstring fileNameUTF, int flags, int mode, int *err);
29 int readCacheParms(char *afsMountPoint, char *afsConfDir, char *afsCacheDir,
30 int *cacheBlocks, int *cacheFiles, int *cacheStatEntries,
31 int *dCacheSize, int *vCacheSize, int *chunkSize,
32 int *closeSynch, int *debug, int *nDaemons, int *cacheFlags,
33 char *logFile);
34 #endif /* !LIBJUAFS */
35
36 // throw a non-AFS exception with a message
37 void throwMessageException( JNIEnv *env, char *msg );
38
39 // throw an AFS exception with a message
40 void throwAFSException( JNIEnv *env, int code );
41
42 // throw an AFS Admin exception with a message
43 void throwAFSException( JNIEnv *env, int code );
44
45 // throw an AFS File or I/O related exception with a message
46 void throwFileAdminException( JNIEnv *env, int code, char *msg );
47
48 // throw an AFS Security exception with a message
49 void throwAFSSecurityException( JNIEnv *env, int code );
50
51 // throw an exception with an error code
52 void throwException( JNIEnv *env, jclass *excCls, char *excClsName, jmethodID *initID, int code );
53
54 // reclaim global memory used by exceptions
55 void reclaimExceptionMemory( JNIEnv *env, jclass cls );
56
57 int setError(JNIEnv *env, jobject *obj, int code);
58 int setString(JNIEnv *env, jobject *obj, char *field, char *string);
59
60 #endif
61
62
63