netatalk: virtual_icon.c File Reference

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
virtual_icon.c File Reference
`#include <arpa/inet.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/stat.h>`
`#include <atalk/adouble.h>`
`#include <atalk/afp.h>`
`#include <atalk/globals.h>`
`#include <atalk/logger.h>`
`#include "file.h"`
`#include "directory.h"`
`#include "icon.h"`
`#include "virtual_icon.h"`
`#include "volume.h"`

## Macros
#define | ICON_RES_ID (-16455) /* 0xBFB9 - Finder volume custom icon resource ID */

## Functions
static void | put_u32 (unsigned char *buf, uint32_t val)
static void | put_u16 (unsigned char *buf, uint16_t val)
static void | build_resource_fork (struct vol *vol, const unsigned char *icn_hash, const unsigned char *icl4, const unsigned char *icl8)
| Build the Macintosh resource fork binary data containing ICN#, icl4, and icl8.
int | virtual_icon_enabled (const struct vol *vol)
int | real_icon_exists (const struct vol *vol)
int | is_virtual_icon_name (const char *name)
void | virtual_icon_init (struct vol *vol)
const unsigned char * | virtual_icon_get_rfork (const struct vol *vol, size_t *outlen)
int | virtual_icon_getfilparams (const AFPObj *obj, struct vol *vol, uint16_t bitmap, char *buf, size_t *buflen)
| Synthesize AFP file parameters for the virtual Icon\r file.

## Macro Definition Documentation

## ◆ ICON_RES_ID

#define ICON_RES_ID (-16455) /* 0xBFB9 - Finder volume custom icon resource ID */

## Function Documentation

## ◆ build_resource_fork()

void build_resource_fork | ( | struct vol * | vol,
|  | const unsigned char * | icn_hash,
|  | const unsigned char * | icl4,
|  | const unsigned char * | icl8 )
| static

Build the Macintosh resource fork binary data containing ICN#, icl4, and icl8.

icn_hash: 256-byte ICN# resource (icon bitmap + mask) icl4: 512-byte icl4 resource (32x32 4-bit color icon) icl8: 1024-byte icl8 resource (32x32 8-bit color icon)

## ◆ is_virtual_icon_name()

int is_virtual_icon_name | ( | const char * | name | ) |

## ◆ put_u16()

void put_u16 | ( | unsigned char * | buf,
|  | uint16_t | val )
| static

Write a big-endian uint16_t to buf

## ◆ put_u32()

void put_u32 | ( | unsigned char * | buf,
|  | uint32_t | val )
| static

Write a big-endian uint32_t to buf

## ◆ real_icon_exists()

int real_icon_exists | ( | const struct vol * | vol | ) |

## ◆ virtual_icon_enabled()

int virtual_icon_enabled | ( | const struct vol * | vol | ) |

## ◆ virtual_icon_get_rfork()

const unsigned char * virtual_icon_get_rfork | ( | const struct vol * | vol,
|  | size_t * | outlen )

## ◆ virtual_icon_getfilparams()

int virtual_icon_getfilparams | ( | const AFPObj * | obj,
|  | struct vol * | vol,
|  | uint16_t | bitmap,
|  | char * | buf,
|  | size_t * | buflen )

Synthesize AFP file parameters for the virtual Icon\r file.

This fills the reply buffer with parameters matching the requested bitmap, just as getmetadata/getfilparams would for a real file.

## ◆ virtual_icon_init()

void virtual_icon_init | ( | struct vol * | vol | ) |