#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. | |
|
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)
| int is_virtual_icon_name | ( | const char * | name | ) |
|
static |
Write a big-endian uint16_t to buf
|
static |
Write a big-endian uint32_t to buf
| int real_icon_exists | ( | const struct vol * | vol | ) |
| int virtual_icon_enabled | ( | const 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.
This fills the reply buffer with parameters matching the requested bitmap, just as getmetadata/getfilparams would for a real file.
| void virtual_icon_init | ( | struct vol * | vol | ) |