Beispiel #1
0
 void inotify_monitor::scan_root_paths()
 {
   for (string &path : paths)
   {
     if (!is_watched(path)) scan(path);
   }
 }
Beispiel #2
0
char *get_poster_mode_item_unknown(DbItem *row_id,char **font_class,char **grid_class)
{
    HTML_LOG(2,"dbg: unclassified : set details as title");
    // Unclassified

    char *title;
    title = row_id->title;
    if (title != NULL) {
        title = STRDUP(title);
    } else {
        title = util_basename(row_id->file);
    }

    if (strlen(title) > 20) {
        strcpy(title+18,"..");
    }
    if (is_watched(row_id)) {
        *grid_class = "class=poster_watched_unknown";
    } else if (is_fresh(row_id)) {
        *grid_class = "class=poster_fresh_unknown";
    } else {
        *grid_class = "class=poster_unknown";
    }
    *font_class = watched_style_small(row_id);
    return title;
}
Beispiel #3
0
static void syscall_fprintf(CPUState* env, const char* __format, ...){
    if (is_watched(env)){
        va_list va;
        va_start(va,__format);
        vfprintf(plugin_log, __format,va);
        va_end(va);
    }
}
Beispiel #4
0
Datei: block.c Projekt: ejrh/ejrh
static BLOCK *read_block(FS *fs, int location, int parse)
{
    size_t nr;
    BLOCK *block = find_free_slot(fs);
    //printf("R %d %p, %d\n", location, fs->f, fileno(fs->f));
    if (fseek(fs->f, location * fs->block_size, SEEK_SET))
        error("Error seeking for reading block %d", location);
    
    nr = fread(block->buffer, fs->block_size, 1, fs->f);
    if (nr < 1)
    {
        clear_flag(block, F_CACHED);
        if (location != 0)
            printf("Error reading block %d, nr = %d, errno was %d\n", location, nr, errno);
        return NULL;
    }
    block->location = location;
    set_flag(block, F_CACHED);
    block->type = B_DATA;
    block->pins = 0;
    
    if (parse)
    {
        if (!parse_block(fs, block))
        {
            printf("Error parsing block %d\n", location);
            return NULL;
        }
    }
    
    if (is_watched(block->location))
    {
        printf("READ ");
        print_block(fs, block);
    }
    add_block_to_hash(fs, block);

    return block;
}
Beispiel #5
0
Datei: block.c Projekt: ejrh/ejrh
void flush_block(FS *fs, BLOCK *block)
{
    if (block->flags & F_CACHED && block->flags & F_DIRTY)
    {
        size_t nw;

        //printf("Saving block %d\n", block->location);
        populate_block(fs, block);
        if (fseek(fs->f, block->location * fs->block_size, SEEK_SET))
        error("Error seeking for writing block %d (written %d)", block->location, fs->blocks_written);
        
        //printf("W %d %p, %d\n", block->location, fs->f, fileno(fs->f));
        if (is_watched(block->location))
        {
            printf("WRITE ");
            print_block(fs, block);
        }
        nw = fwrite(block->buffer, fs->block_size, 1, fs->f);
        if (nw < 1)
        error("Error saving block!\n");
        
        clear_flag(block, F_DIRTY);
    }
}
//===================================================================
void CLitPoolElement::dump(ostream & os)
{
    os << (var_sign()?" -":" +") << var_index();
    if (is_watched())
        os << "*";
}