#include "ofc/core.h"
#include "ofc/types.h"
#include "ofc/config.h"
#include "ofc/file.h"
Go to the source code of this file.
| #define | ofc_path_add_map ofc_path_add_mapA |
| |
| #define | ofc_path_create ofc_path_createA |
| |
| #define | ofc_path_print ofc_path_printA |
| |
| #define | ofc_path_make_url ofc_path_make_urlA |
| |
| #define | ofc_path_map ofc_path_mapA |
| |
| #define | ofc_path_delete_map ofc_path_delete_mapA |
| |
| #define | ofc_path_map_device ofc_path_map_deviceA |
| |
| #define | ofc_path_update_credentials ofc_path_update_credentialsA |
| |
| #define | ofc_path_get_root ofc_path_get_rootA |
| |
| typedef OFC_VOID | OFC_PATH |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_init (OFC_VOID) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_destroy (OFC_VOID) |
| |
| OFC_CORE_LIB OFC_BOOL | ofc_path_add_mapW (OFC_LPCTSTR lpDevice, OFC_LPCTSTR lpDesc, OFC_PATH *map, OFC_FST_TYPE fsType, OFC_BOOL thumbnail) |
| |
| OFC_CORE_LIB OFC_BOOL | ofc_path_add_mapA (OFC_LPCSTR lpDevice, OFC_LPCSTR lpDesc, OFC_PATH *map, OFC_FST_TYPE fsType, OFC_BOOL thumbnail) |
| |
| OFC_CORE_LIB OFC_PATH * | ofc_path_createW (OFC_LPCTSTR lpFileName) |
| |
| OFC_CORE_LIB OFC_PATH * | ofc_path_createA (OFC_LPCSTR lpFileName) |
| |
| OFC_CORE_LIB OFC_PATH * | ofc_path_init_path (OFC_VOID) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_update (OFC_PATH *path, OFC_PATH *map) |
| |
| OFC_CORE_LIB OFC_SIZET | ofc_path_printW (OFC_PATH *path, OFC_LPTSTR *filename, OFC_SIZET *rem) |
| |
| OFC_CORE_LIB OFC_SIZET | ofc_path_printA (OFC_PATH *path, OFC_LPSTR *filename, OFC_SIZET *rem) |
| |
| OFC_CORE_LIB OFC_TCHAR * | ofc_path_print_alloc (OFC_PATH *path) |
| |
| OFC_CORE_LIB OFC_SIZET | ofc_path_make_urlW (OFC_LPTSTR *filename, OFC_SIZET *rem, OFC_LPCTSTR username, OFC_LPCTSTR password, OFC_LPCTSTR domain, OFC_LPCTSTR server, OFC_LPCTSTR share, OFC_LPCTSTR path, OFC_LPCTSTR file) |
| |
| OFC_CORE_LIB OFC_SIZET | ofc_path_make_urlA (OFC_LPSTR *filename, OFC_SIZET *rem, OFC_LPCSTR username, OFC_LPCSTR password, OFC_LPCSTR domain, OFC_LPCSTR server, OFC_LPCSTR share, OFC_LPCSTR path, OFC_LPCSTR file) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_delete (OFC_PATH *path) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_mapW (OFC_LPCTSTR lpFileName, OFC_LPTSTR *lppMappedName, OFC_FST_TYPE *filesystem) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_mapA (OFC_LPCSTR lpFileName, OFC_LPSTR *lppMappedName, OFC_FST_TYPE *filesystem) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_delete_mapW (OFC_LPCTSTR lpVirtual) |
| |
| OFC_CORE_LIB OFC_VOID | ofc_path_delete_mapA (OFC_LPCSTR lpVirtual) |
| |
| OFC_CORE_LIB OFC_PATH * | ofc_path_map_deviceW (OFC_LPCTSTR lpDevice) |
| |
| OFC_CORE_LIB OFC_PATH * | ofc_path_map_deviceA (OFC_LPCSTR lpDevice) |
| |
| OFC_BOOL | ofc_path_is_wild (OFC_LPCTSTR dir) |
| |
◆ ofc_path_add_map
◆ ofc_path_create
◆ ofc_path_delete_map
◆ ofc_path_get_root
| #define ofc_path_get_root ofc_path_get_rootA |
Get the root of a path
- See also
- ofc_path_get_rootW
-
ofc_path_get_rootA
- Examples
- test_file.c.
◆ ofc_path_make_url
◆ ofc_path_map
◆ ofc_path_map_device
◆ ofc_path_print
◆ ofc_path_update_credentials
| #define ofc_path_update_credentials ofc_path_update_credentialsA |
Update a path with credentials
- See also
- ofc_path_update_credentialsW
-
ofc_path_update_credentialsA
- Examples
- test_file.c.
◆ OFC_PATH
The Internal Represenation of a Path
This is exposed to users of the Open Files Path API. It may be preferable to hide this structure behind additional APIs
◆ ofc_path_add_mapA()
◆ ofc_path_add_mapW()
Add a map for a virtual path
- Parameters
-
| lpDevice | The Device Name to use for the path |
| lpDesc | A Description for the map |
| map | path to use for translating virtual path |
| fsType | File System Handler to use for the map |
| thumbnail | Display map contents using thumbnails (info only) |
- Returns
- OFC_TRUE if success, OFC_FALSE otherwise
◆ ofc_path_createA()
◆ ofc_path_createW()
Create a path structure for a path string
- Parameters
-
- Returns
- path structure
- Examples
- test_path.c.
◆ ofc_path_delete()
Delete a path structure
- Parameters
-
| path | The path structure to delete |
- Examples
- test_path.c.
◆ ofc_path_delete_mapA()
◆ ofc_path_delete_mapW()
Delete a map
- Parameters
-
| lpVirtual | Virtual path of map to delete |
◆ ofc_path_destroy()
Destroy the Open Files Path Mapping
This should only be called by framework_init
◆ ofc_path_init()
Initialize the Open Files Path Mapping
This should only be called by framework_init
◆ ofc_path_init_path()
◆ ofc_path_is_wild()
Is directory a wildcard
- Parameters
-
- Returns
- True if wild
◆ ofc_path_make_urlA()
◆ ofc_path_make_urlW()
Construct a URL suitable for passing into Open File APIs as the remote escaped file name.
This routine will fill in a buffer provided by the application with the URL. Since it is difficult to predict the size of the buffer required to hold the URL, this routine will typically be called twice in a row. The first time it is called, it is called with a "rem" value of 0 and a NULL as the pointer to the buffer. The routine will return the number of characters that would have been put into the string assuming the buffer was big enough (len). The application then then allocate a buffer large enough to hold the URL using the returned number of characters in the URL (len). On the second call to the routine, If the Unicode version of the routine is called, the buffer size should be big enough to hold len + 1 times the sizeof (OFC_TCHAR). If the Ascii version of the routine is called, the buffer size should be big enough to hold len+1 times the size of a character, sizeof (OFC_CHAR). The extra one in this calculation is required if you want the string to be null terminated.
- Parameters
-
| filename | Pointer to a pointer to the buffer to place URL in. The API specifies a pointer to a pointer so that the routine can update the pointer to the end of the string. |
| rem | pointer to the number of remaining characters in the buffer. The API will update this with the remaining characters that can fit in the buffer. |
| username | Pointer to the username to put in the URL. A NULL pointer will leave the username field empty. |
| password | Pointer to the password to put in the URL. |
| domain | Pointer to the domain to put in the URL |
| server | Pointer to the server to put in the URL |
| share | Pointer to the share to put in the URL |
| path | Pointer to the directory path to put in the URL. Subdirectories should be encoded with the directory terminator ("\\" or "/") between each directory level |
| file | The file portion of the URL |
- Returns
- Number of bytes in the URL whether they fit in the output buffer or not. The routine also updates the filename pointer to point to the next location in the buffer to append additional text, and the number of characters remaining in the buffer is also returned.
- Examples
- smbls.c, and test_path.c.
◆ ofc_path_map_deviceA()
◆ ofc_path_map_deviceW()
Find a map for a path
- Parameters
-
| lpDevice | The device string |
- Returns
- The map for the path
- Examples
- test_file.c.
◆ ofc_path_mapA()
◆ ofc_path_mapW()
Map a local path to a target path
- Parameters
-
| lpFileName | The local path (virtual path used by applications or CIFS Server) |
| lppMappedName | The target path (relative to the target file system type) |
| filesystem | file system type |
◆ ofc_path_print_alloc()
Print a wide character path and allocate string
- Parameters
-
- Returns
- Wide character string
- Note
- String must be freed by call to ofc_free
- Examples
- test_path.c.
◆ ofc_path_printA()
◆ ofc_path_printW()
Print a path structure to a string
- Parameters
-
| path | path to print |
| filename | string to print path to |
| rem | pointer to number of bytes available in destination filename This is updated to account for any characters output |
- Returns
- Number of bytes printed
- Examples
- test_file.c.
◆ ofc_path_update()
Apply a map to a path
The routine will assentially update the path pointed to by the first argument with info from the map supplied in the second argument. This means that the device, server, credentials, share, and parent directories of the map are simply prepended to the path
- Parameters
-
| path | Path that needs to be updated |
| map | map to update the path with |