netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
cnid.c File Reference
`#include <arpa/inet.h>`
`#include <errno.h>`
`#include <fcntl.h>`
`#include <libgen.h>`
`#include <limits.h>`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/param.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <unistd.h>`
`#include <bstrlib.h>`
`#include <atalk/cnid.h>`
`#include <atalk/errchk.h>`
`#include <atalk/logger.h>`
`#include <atalk/unicode.h>`
`#include <atalk/util.h>`

## Functions
bstring | rel_path_in_vol (const char *path, const char *volpath)
| Build path relative to volume root.
cnid_t | cnid_for_path (struct _cnid_db *cdb, const char *volpath, const char *path, cnid_t *did)
| Resolves CNID of a given path.
char * | uuid_strip_dashes (const char *uuid)

## Function Documentation

## ◆ cnid_for_path()

cnid_t cnid_for_path | ( | struct _cnid_db * | cdb,
|  | const char * | volpath,
|  | const char * | path,
|  | cnid_t * | did )

Resolves CNID of a given path.

path might be:

1. relative: "dir/subdir" with cwd: "/afp_volume/topdir"
2. absolute: "/afp_volume/dir/subdir"

path MUST be pointing inside vol, this is usually the case as vol has been build from path using loadvolinfo and friends.

Parameters

  [in] | cdb | CNID db handle
  [in] | volpath | UNIX path of volume
  [in] | path | path, see above
  [out] | did | parent CNID of returned CNID

Returns
  CNID of path

## ◆ rel_path_in_vol()

bstring rel_path_in_vol | ( | const char * | path,
|  | const char * | volpath )

Build path relative to volume root.

path might be:

1. relative: "dir/subdir" with cwd: "/afp_volume/topdir"
2. absolute: "/afp_volume/dir/subdir"

Parameters

  [in] | path | path relative to cwd() or absolute
  [in] | volpath | volume path that path is a subdir of (has been computed in volinfo funcs)

Returns
  relative path in new bstring, caller must bdestroy it

## ◆ uuid_strip_dashes()

char * uuid_strip_dashes | ( | const char * | uuid | ) |

Return allocated UUID string with dashes stripped