Blender  V2.59
Functions | Variables
storage.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <time.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <pwd.h>
#include "MEM_guardedalloc.h"
#include "DNA_listBase.h"
#include "BLI_listbase.h"
#include "BLI_linklist.h"
#include "BLI_storage.h"
#include "BLI_storage_types.h"
#include "BLI_string.h"
#include "BKE_utildefines.h"

Go to the source code of this file.

Functions

char * BLI_getwdN (char *dir, const int maxncpy)
int BLI_compare (struct direntry *entry1, struct direntry *entry2)
double BLI_diskfree (const char *dir)
void BLI_builddir (const char *dirname, const char *relname)
void BLI_adddirstrings (void)
unsigned int BLI_getdir (const char *dirname, struct direntry **filelist)
size_t BLI_filesize (int file)
size_t BLI_filepathsize (const char *path)
int BLI_exist (const char *name)
int BLI_is_dir (const char *file)
LinkNodeBLI_read_file_as_lines (const char *name)
void BLI_free_file_lines (LinkNode *lines)
int BLI_file_older (const char *file1, const char *file2)

Variables

static int totnum
static int actnum
static struct direntryfiles
static struct ListBase dirbase_ = {NULL, NULL}
static struct ListBasedirbase = &dirbase_

Detailed Description

Definition in file storage.c.


Function Documentation

void BLI_adddirstrings ( void  )
void BLI_builddir ( const char *  dirname,
const char *  relname 
)
int BLI_compare ( struct direntry entry1,
struct direntry entry2 
)

Definition at line 119 of file storage.c.

References BLI_natstrcmp(), direntry::relname, and direntry::type.

Referenced by BLI_builddir().

double BLI_diskfree ( const char *  dir)

Definition at line 146 of file storage.c.

References DWORD, and FILE_MAXDIR.

int BLI_exist ( const char *  name)
int BLI_file_older ( const char *  file1,
const char *  file2 
)

Definition at line 522 of file storage.c.

Referenced by imb_cache_filename().

size_t BLI_filepathsize ( const char *  path)

Definition at line 428 of file storage.c.

References BLI_filesize(), O_BINARY, and size().

Referenced by IMB_exr_begin_read(), IMB_thumb_create(), and RE_BlenderAnim().

size_t BLI_filesize ( int  file)
void BLI_free_file_lines ( struct LinkNode lines)

Free the list returned by BLI_read_file_as_lines.

Definition at line 517 of file storage.c.

References BLI_linklist_free(), and MEM_freeN().

Referenced by WM_read_history().

unsigned int BLI_getdir ( const char *  dirname,
struct direntry **  filelist 
)

Definition at line 395 of file storage.c.

References actnum, BLI_adddirstrings(), BLI_builddir(), NULL, and totnum.

Referenced by filelist_read_dir(), and init_iconfile_list().

char* BLI_getwdN ( char *  dir,
const int  maxncpy 
)
int BLI_is_dir ( const char *  file)

Read a file as ASCII lines. An empty list is returned if the file cannot be opened or read.

Attention:
The returned list should be free'd with BLI_free_file_lines.
Parameters:
nameThe name of the file to read.
Return values:
Alist of strings representing the file lines.

Definition at line 472 of file storage.c.

References BLI_exist().

Referenced by BLI_getDefaultDocumentFolder(), BLI_make_exist(), BLI_where_is_temp(), file_browse_exec(), file_change_dir(), file_directory_exec(), file_draw_check_exists(), test_env_path(), and test_path().

LinkNode* BLI_read_file_as_lines ( const char *  name) [read]

Variable Documentation

int actnum

Definition at line 100 of file storage.c.

Referenced by BLI_adddirstrings(), BLI_builddir(), and BLI_getdir().

struct ListBase* dirbase = &dirbase_ [static]

Definition at line 104 of file storage.c.

struct ListBase dirbase_ = {NULL, NULL} [static]

Definition at line 103 of file storage.c.

struct direntry* files [static]

Definition at line 101 of file storage.c.

Referenced by file_draw_list(), and filelist_from_main().

int totnum [static]

Definition at line 100 of file storage.c.

Referenced by BLI_builddir(), and BLI_getdir().