[7297] Fixed profession spells sorting in trainer spell list at client.
[getmangos.git] / dep / ACE_wrappers / ace / Lib_Find.h
blob133b83ffb7b3e344282da37340d5e55bda5d0aa6
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Lib_Find.h
7 * All the static function calls needed to search and open shared
8 * libraries.
10 * $Id: Lib_Find.h 80826 2008-03-04 14:51:23Z wotte $
12 //=============================================================================
14 #ifndef ACE_LIB_FIND_H
15 #define ACE_LIB_FIND_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
19 #include /**/ "ace/ACE_export.h"
20 #include "ace/os_include/os_stdio.h"
21 #if defined (ACE_OPENVMS)
22 # include "ace/OS_NS_dlfcn.h"
23 #endif
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 namespace ACE
29 // = Methods for searching and opening shared libraries.
31 /**
32 * Finds the file @a filename either using an absolute path or using
33 * a relative path in conjunction with ACE_LD_SEARCH_PATH (e.g.,
34 * $LD_LIBRARY_PATH on UNIX or the directories scaned by Win32 API
35 * SearchPath on Win32). This function will add appropriate suffix
36 * (e.g., .dll on Win32 or .so on UNIX) according to the OS
37 * platform. In addition, this function will apply the appropriate
38 * prefix (e.g., "lib" on UNIX and "" on Win32) if the @a filename
39 * doesn't match directly.
41 extern ACE_Export int ldfind (const ACE_TCHAR* filename,
42 ACE_TCHAR pathname[],
43 size_t maxpathnamelen);
45 /**
46 * Uses @c ldfind to locate and open the appropriate @a filename and
47 * returns a pointer to the file, else it returns a NULL
48 * pointer. @a type specifies how the file should be open.
50 extern ACE_Export FILE *ldopen (const ACE_TCHAR *filename,
51 const ACE_TCHAR *type);
53 /**
54 * Transforms @a entry_point into a form that can be located in a
55 * dynamic library using <dlsym>. For example, with Win32/Borland
56 * extern "C" functions which use the default calling convention
57 * have a '_' prepended. Always returns a buffer that has been
58 * dynamically allocated using <operator new>.
60 extern ACE_Export ACE_TCHAR *ldname (const ACE_TCHAR *entry_point);
63 #if defined (ACE_OPENVMS)
64 /**
65 * Registers an @a entry_point and its address for later retrieval
66 * through the ACE::ldsymbol () method.
67 * For use in cases where the OS compiler encodes long symbolnames.
69 extern ACE_Export void ldregister (const ACE_TCHAR *entry_point,
70 void* entry_addr);
72 /**
73 * Looks up an @a entry_point address either from previously registered
74 * symbols or through ACE_OS::dlsym ().
75 * Returns 0 in case the entry_point is not found, otherwise nonzero.
76 * For use in cases where the OS compiler encodes long symbolnames.
78 extern ACE_Export void *ldsymbol (ACE_SHLIB_HANDLE sh,
79 const ACE_TCHAR *entry_point);
80 #endif
82 /**
83 * Returns the temporary directory including the trailing slash in
84 * @a buffer. Returns -1 for an error or if the buffer_len is not
85 * long enough.
87 extern ACE_Export int get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len);
89 /// Opening the temp file. File is automagically unlinked when it is
90 /// closed. This is useful for have temp files.
91 extern ACE_Export ACE_HANDLE open_temp_file (const ACE_TCHAR *name,
92 int mode,
93 int perm = 0);
95 // @@ Though the following functions dont come under the same category as
96 // above, these are used only in the functions in this class. So it makes
97 // more sense to move these functions too to this class.
99 /// Replace all instances of @a search in @a s with @a replace. Returns
100 /// the number of replacements made.
101 extern ACE_Export size_t strrepl (char *s, char search, char replace);
104 * Splits string <s> into pieces separated by the string <token>.
105 * <next_start> is an opaque cookie handed back by the call to store
106 * its state for the next invocation, thus making it re-entrant.
107 * This operates very similar to Perl's <split> function except that
108 * it returns pieces one at a time instead of into an array.
110 extern ACE_Export char *strsplit_r (char *s,
111 const char *token,
112 char *&next_start);
114 #if defined (ACE_HAS_WCHAR)
115 /// As strrepl, but for wide characters.
116 extern ACE_Export size_t strrepl (wchar_t *s,
117 wchar_t search,
118 wchar_t replace);
120 /// As strsplit_r, but for wide characters.
121 extern ACE_Export wchar_t *strsplit_r (wchar_t *s,
122 const wchar_t *token,
123 wchar_t *&next_start);
124 #endif /* ACE_HAS_WCHAR */
127 ACE_END_VERSIONED_NAMESPACE_DECL
129 #include /**/ "ace/post.h"
130 #endif /* ACE_LIB_FIND_H */