Back to index

im-sdk  12.3.91
Classes | Typedefs | Functions
IMUtil.hh File Reference
#include <vector>
#include <string>
#include <sys/types.h>
#include "basictype.hh"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  DirectoryEntry
class  DirectoryInfo
class  LEDirectoryInfo
class  IMSocketAddress
class  IMSocket
class  IMSocketTrans
class  IMSocketListen
class  IMDaemon


typedef vector< DirectoryEntryDirectoryInfoVec
typedef vector< IMSocketAddressIMSocketAddressVec
typedef vector< IMSocket * > IMSocketVec


CARD8BIT * IM_read_file (const char *filename, size_t size)
int IM_file_size (const char *filename)
void IM_unix_domain_socket_file_dir (string user_name, string &dir)

Class Documentation

struct DirectoryEntry

Definition at line 8 of file IMUtil.hh.

Collaboration diagram for DirectoryEntry:
Class Members
bool directory_p
string dirname
string filename
string fullname
bool readable_p
bool writable_p

Typedef Documentation

Definition at line 16 of file IMUtil.hh.

Definition at line 56 of file IMUtil.hh.

typedef vector<IMSocket*> IMSocketVec

Definition at line 58 of file IMUtil.hh.

Function Documentation

int IM_file_size ( const char *  filename)

Definition at line 283 of file IMUtil.cpp.

    struct stat s;
    if (stat(filename, &s) != 0) return -1;
    return s.st_size;

Here is the caller graph for this function:

CARD8BIT* IM_read_file ( const char *  filename,
size_t  size 

Definition at line 254 of file IMUtil.cpp.

    size_t rsize;
    FILE *fd;
    CARD8BIT *pr;

    fd = fopen(filename, "rb");
    if (!fd) {
       return NULL;
    pr = (CARD8BIT*) malloc(sizeof(CARD8BIT) * size);
    if (!pr) {
       return NULL;
    rsize = fread(pr, sizeof(CARD8BIT), size, fd);
    if (rsize != size) {
       return NULL;

    return pr;

Here is the caller graph for this function:

void IM_unix_domain_socket_file_dir ( string  user_name,
string &  dir 

Definition at line 392 of file IMUtil.cpp.

    string    dir;
    uid_t     euid;
    struct stat      st;

    euid = geteuid();

    dir = (string("/tmp/.iiimp-unix-") + string(user_name));
    if (0 == dir_valid(dir.c_str(), euid)) {
       alternate_unix_domain_socket_file_dir(user_name, euid, dir_ret);
    } else {
       dir_ret = dir;

Here is the call graph for this function:

Here is the caller graph for this function: