ih_sub_t * ih_sub_new (MateVFSURI *uri, MateVFSMonitorType mon_type) { ih_sub_t *sub = NULL; sub = g_new0 (ih_sub_t, 1); sub->type = mon_type; sub->uri = uri; mate_vfs_uri_ref (uri); sub->pathname = mate_vfs_unescape_string (mate_vfs_uri_get_path (uri), "/"); /* mate_vfs_unescape_string returns NULL when * the uri path passed to it is invalid. */ if (!sub->pathname) { IS_W("new subscription for %s failed because of invalid characters.\n", mate_vfs_uri_get_path (uri)); g_free (sub); mate_vfs_uri_unref (uri); return NULL; } /* TODO: WAITING for flag to be implemented if (mon_type & MATE_VFS_DONT_FOLLOW_SYMLINK) { sub->extra_flags |= IN_DONT_FOLLOW; } */ IS_W("new subscription for %s being setup\n", sub->pathname); ih_sub_setup (sub); return sub; }
ih_sub_t * ih_sub_new (const char *pathname, gboolean is_dir, guint32 flags, void *userdata) { ih_sub_t *sub = NULL; sub = g_new0 (ih_sub_t, 1); sub->usersubdata = userdata; sub->is_dir = is_dir; sub->extra_flags = flags; sub->pathname = g_strdup (pathname); IS_W("new subscription for %s being setup\n", sub->pathname); ih_sub_setup (sub); return sub; }