Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

rpmrpc.c File Reference

#include "system.h"
#include <rpmio_internal.h>
#include "ugid.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  __dirstream

Defines

#define g_strdup   xstrdup
#define g_free   free
#define MAXCOLS   30
#define alloca_strdup(_s)   strcpy(alloca(strlen(_s)+1), (_s))
#define DT_UNKNOWN   0
#define DT_FIFO   1
#define DT_CHR   2
#define DT_DIR   4
#define DT_BLK   6
#define DT_REG   8
#define DT_LNK   10
#define DT_SOCK   12
#define DT_WHT   14
#define ISFTPMAGIC(_dir)   (!memcmp((_dir), &ftpmagicdir, sizeof(ftpmagicdir)))

Typedefs

typedef __dirstreamFTPDIR

Enumerations

enum  ftpSysCall_t {
  DO_FTP_STAT = 1, DO_FTP_LSTAT = 2, DO_FTP_READLINK = 3, DO_FTP_ACCESS = 4,
  DO_FTP_GLOB = 5
}

Functions

int ftpMkdir (const char *path, mode_t mode)
int ftpChdir (const char *path)
int ftpRmdir (const char *path)
int ftpRename (const char *oldpath, const char *newpath)
int ftpUnlink (const char *path)
int Mkdir (const char *path, mode_t mode)
 mkdir(2) clone.
int Chdir (const char *path)
 chdir(2) clone.
int Rmdir (const char *path)
 rmdir(2) clone.
int Rename (const char *oldpath, const char *newpath)
 rename(2) clone.
int Link (const char *oldpath, const char *newpath)
 link(2) clone.
int Unlink (const char *path)
 unlink(2) clone.
int vfs_split_text (char *p)
int is_num (int idx)
int is_dos_date (const char *str)
int is_week (const char *str, struct tm *tim)
int is_month (const char *str, struct tm *tim)
int is_time (const char *str, struct tm *tim)
int is_year (const char *str, struct tm *tim)
int vfs_parse_filetype (char c)
int vfs_parse_filemode (const char *p)
int vfs_parse_filedate (int idx, time_t *t)
int vfs_parse_ls_lga (char *p, struct stat *st, const char **filename, const char **linkname)
int ftpNLST (const char *url, ftpSysCall_t ftpSysCall, struct stat *st, char *rlbuf, size_t rlbufsiz)
const char * statstr (const struct stat *st, char *buf)
int ftpStat (const char *path, struct stat *st)
int ftpLstat (const char *path, struct stat *st)
int ftpReadlink (const char *path, char *buf, size_t bufsiz)
DIR * ftpOpendir (const char *path)
direct * ftpReaddir (DIR *dir)
int ftpClosedir (DIR *dir)
int Stat (const char *path, struct stat *st)
 stat(2) clone.
int Lstat (const char *path, struct stat *st)
 lstat(2) clone.
int Readlink (const char *path, char *buf, size_t bufsiz)
 readlink(2) clone.
int Access (const char *path, int amode)
 access(2) clone.
int Glob_pattern_p (const char *pattern, int quote)
 glob_pattern_p(3) clone.
int Glob_error (const char *epath, int eerrno)
 glob_error(3) clone.
int Glob (const char *pattern, int flags, int errfunc(const char *epath, int eerrno), glob_t *pglob)
 glob(3) clone.
void Globfree (glob_t *pglob)
 globfree(3) clone.
DIR * Opendir (const char *path)
 opendir(3) clone.
direct * Readdir (DIR *dir)
 readdir(3) clone.
int Closedir (DIR *dir)
 closedir(3) clone.

Variables

int current_mday
int current_mon
int current_year
char * columns [30]
int column_ptr [30]
size_t ftpBufAlloced = 0
char * ftpBuf = NULL
int ftp_st_ino = 0xdead0000
int ftpmagicdir = 0x8440291


Detailed Description

Definition in file rpmrpc.c.


Define Documentation

#define alloca_strdup _s   )     strcpy(alloca(strlen(_s)+1), (_s))
 

Definition at line 821 of file rpmrpc.c.

#define DT_BLK   6
 

Definition at line 1095 of file rpmrpc.c.

#define DT_CHR   2
 

Definition at line 1093 of file rpmrpc.c.

#define DT_DIR   4
 

Definition at line 1094 of file rpmrpc.c.

Referenced by fts_build().

#define DT_FIFO   1
 

Definition at line 1092 of file rpmrpc.c.

#define DT_LNK   10
 

Definition at line 1097 of file rpmrpc.c.

#define DT_REG   8
 

Definition at line 1096 of file rpmrpc.c.

#define DT_SOCK   12
 

Definition at line 1098 of file rpmrpc.c.

#define DT_UNKNOWN   0
 

Definition at line 1091 of file rpmrpc.c.

#define DT_WHT   14
 

Definition at line 1099 of file rpmrpc.c.

#define g_free   free
 

Definition at line 256 of file rpmrpc.c.

Referenced by vfs_parse_ls_lga().

#define g_strdup   xstrdup
 

Definition at line 255 of file rpmrpc.c.

Referenced by vfs_parse_ls_lga().

#define ISFTPMAGIC _dir   )     (!memcmp((_dir), &ftpmagicdir, sizeof(ftpmagicdir)))
 

Definition at line 1107 of file rpmrpc.c.

Referenced by Closedir(), ftpClosedir(), ftpReaddir(), and Readdir().

#define MAXCOLS   30
 

Definition at line 269 of file rpmrpc.c.


Typedef Documentation

typedef struct __dirstream* FTPDIR
 

Definition at line 1100 of file rpmrpc.c.

Referenced by ftpClosedir(), ftpOpendir(), and ftpReaddir().


Enumeration Type Documentation

enum ftpSysCall_t
 

Enumeration values:
DO_FTP_STAT 
DO_FTP_LSTAT 
DO_FTP_READLINK 
DO_FTP_ACCESS 
DO_FTP_GLOB 

Definition at line 803 of file rpmrpc.c.


Function Documentation

int Access const char *  path,
int  amode
 

access(2) clone.

Definition at line 1391 of file rpmrpc.c.

References URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by rpmMkdirPath().

int Chdir const char *  path  ) 
 

chdir(2) clone.

Definition at line 92 of file rpmrpc.c.

References ftpChdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

int Closedir DIR *  dir  ) 
 

closedir(3) clone.

Definition at line 1541 of file rpmrpc.c.

References ftpClosedir(), and ISFTPMAGIC.

int ftpChdir const char *  path  )  [static]
 

Definition at line 36 of file rpmrpc.c.

References ftpCmd().

Referenced by Chdir(), and ftpNLST().

int ftpClosedir DIR *  dir  )  [static]
 

Definition at line 1299 of file rpmrpc.c.

References FTPDIR, and ISFTPMAGIC.

Referenced by Closedir().

int ftpLstat const char *  path,
struct stat *  st
[static]
 

Definition at line 1052 of file rpmrpc.c.

References DO_FTP_LSTAT, ftp_st_ino, ftpNLST(), and statstr().

Referenced by Lstat().

int ftpMkdir const char *  path,
mode_t  mode
[static]
 

Definition at line 20 of file rpmrpc.c.

References ftpCmd().

Referenced by Mkdir().

int ftpNLST const char *  url,
ftpSysCall_t  ftpSysCall,
struct stat *  st,
char *  rlbuf,
size_t  rlbufsiz
[static]
 

Definition at line 824 of file rpmrpc.c.

References alloca_strdup, DO_FTP_ACCESS, DO_FTP_GLOB, DO_FTP_LSTAT, DO_FTP_READLINK, DO_FTP_STAT, FD_t, fdFgets(), fdLink, ftpBuf, ftpBufAlloced, ftpChdir(), ftpOpen(), ftpReq(), urlinfo_s::openError, ufdClose(), urlinfo, urlPath(), vfs_parse_ls_lga(), xcalloc(), and xrealloc().

Referenced by ftpLstat(), ftpOpendir(), ftpReadlink(), and ftpStat().

DIR* ftpOpendir const char *  path  )  [static]
 

Definition at line 1111 of file rpmrpc.c.

References __dirstream::allocation, __dirstream::data, dirent, DO_FTP_GLOB, __dirstream::fd, __dirstream::filepos, FTPDIR, ftpNLST(), __dirstream::offset, __dirstream::size, stpcpy(), stpncpy(), and xcalloc().

Referenced by Opendir().

struct direct* ftpReaddir DIR *  dir  )  [static]
 

Definition at line 1250 of file rpmrpc.c.

References __dirstream::data, dirent, FTPDIR, ISFTPMAGIC, __dirstream::offset, and __dirstream::size.

Referenced by Readdir().

int ftpReadlink const char *  path,
char *  buf,
size_t  bufsiz
[static]
 

Definition at line 1067 of file rpmrpc.c.

References DO_FTP_READLINK, and ftpNLST().

Referenced by Readlink().

int ftpRename const char *  oldpath,
const char *  newpath
[static]
 

Definition at line 50 of file rpmrpc.c.

References ftpCmd().

Referenced by Rename().

int ftpRmdir const char *  path  )  [static]
 

Definition at line 43 of file rpmrpc.c.

References ftpCmd().

Referenced by Rmdir().

int ftpStat const char *  path,
struct stat *  st
[static]
 

Definition at line 1037 of file rpmrpc.c.

References DO_FTP_STAT, ftp_st_ino, ftpNLST(), and statstr().

Referenced by Stat().

int ftpUnlink const char *  path  )  [static]
 

Definition at line 60 of file rpmrpc.c.

References ftpCmd().

Referenced by Unlink().

int Glob const char *  pattern,
int  flags,
int   errfunc(const char *epath, int eerrno),
glob_t *  pglob
 

glob(3) clone.

Definition at line 1460 of file rpmrpc.c.

References URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by rpmGlob().

int Glob_error const char *  epath,
int  eerrno
 

glob_error(3) clone.

Definition at line 1455 of file rpmrpc.c.

Referenced by rpmGlob().

int Glob_pattern_p const char *  pattern,
int  quote
 

glob_pattern_p(3) clone.

Definition at line 1419 of file rpmrpc.c.

References urlPath().

Referenced by initGlobs(), processBinaryFile(), and rpmGlob().

void Globfree glob_t *  pglob  ) 
 

globfree(3) clone.

Definition at line 1498 of file rpmrpc.c.

Referenced by rpmGlob().

int is_dos_date const char *  str  )  [static]
 

Definition at line 313 of file rpmrpc.c.

Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().

int is_month const char *  str,
struct tm *  tim
[static]
 

Definition at line 341 of file rpmrpc.c.

Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().

int is_num int  idx  )  [static]
 

Definition at line 302 of file rpmrpc.c.

References columns.

Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().

int is_time const char *  str,
struct tm *  tim
[static]
 

Definition at line 358 of file rpmrpc.c.

Referenced by vfs_parse_filedate().

int is_week const char *  str,
struct tm *  tim
[static]
 

Definition at line 324 of file rpmrpc.c.

Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().

int is_year const char *  str,
struct tm *  tim
[static]
 

Definition at line 377 of file rpmrpc.c.

Referenced by vfs_parse_filedate().

int Link const char *  oldpath,
const char *  newpath
 

link(2) clone.

Definition at line 187 of file rpmrpc.c.

References URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrncasecmp().

Referenced by fsmStage().

int Lstat const char *  path,
struct stat *  st
 

lstat(2) clone.

Definition at line 1341 of file rpmrpc.c.

References ftpLstat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by addFile(), checkOwners(), doUntar(), fsmStage(), and rpmVerifyFile().

DIR* Opendir const char *  path  ) 
 

opendir(3) clone.

Definition at line 1505 of file rpmrpc.c.

References ftpOpendir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

struct direct* Readdir DIR *  dir  ) 
 

readdir(3) clone.

Definition at line 1532 of file rpmrpc.c.

References dirent, ftpReaddir(), and ISFTPMAGIC.

int Readlink const char *  path,
char *  buf,
size_t  bufsiz
 

readlink(2) clone.

Definition at line 1366 of file rpmrpc.c.

References ftpReadlink(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by fsmStage(), genCpioListAndHeader(), and rpmVerifyFile().

int Rename const char *  oldpath,
const char *  newpath
 

rename(2) clone.

Definition at line 140 of file rpmrpc.c.

References ftpRename(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrncasecmp().

Referenced by fsmStage().

int Rmdir const char *  path  ) 
 

rmdir(2) clone.

Definition at line 115 of file rpmrpc.c.

References ftpRmdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by fsmStage(), and rpmdbRebuild().

int Stat const char *  path,
struct stat *  st
 

stat(2) clone.

Definition at line 1316 of file rpmrpc.c.

References ftpStat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by buildForTarget(), fsmStage(), ftsStashLatest(), packageBinaries(), processSourceFiles(), rpmioFileExists(), rpmioMkpath(), and rpmMkdirPath().

const char* statstr const struct stat *  st,
char *  buf
[static]
 

Definition at line 1017 of file rpmrpc.c.

Referenced by ftpLstat(), and ftpStat().

int Unlink const char *  path  ) 
 

unlink(2) clone.

Definition at line 231 of file rpmrpc.c.

References ftpUnlink(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by buildForTarget(), buildSpec(), doRmSource(), doScript(), fsmStage(), rpmInstall(), urlGetFile(), and writeRPM().

int vfs_parse_filedate int  idx,
time_t *  t
[static]
 

Definition at line 488 of file rpmrpc.c.

References columns, current_mon, is_dos_date(), is_month(), is_num(), is_time(), is_week(), and is_year().

Referenced by vfs_parse_ls_lga().

int vfs_parse_filemode const char *  p  )  [static]
 

Definition at line 428 of file rpmrpc.c.

Referenced by vfs_parse_ls_lga().

int vfs_parse_filetype char  c  )  [static]
 

Definition at line 409 of file rpmrpc.c.

Referenced by vfs_parse_ls_lga().

int vfs_parse_ls_lga char *  p,
struct stat *  st,
const char **  filename,
const char **  linkname
[static]
 

Definition at line 599 of file rpmrpc.c.

References column_ptr, columns, error(), g_free, g_strdup, gnameToGid(), is_dos_date(), is_month(), is_num(), is_week(), S_ISLNK, unameToUid(), vfs_parse_filedate(), vfs_parse_filemode(), vfs_parse_filetype(), vfs_split_text(), and xmalloc().

Referenced by ftpNLST().

int vfs_split_text char *  p  )  [static]
 

Definition at line 278 of file rpmrpc.c.

References column_ptr, and columns.

Referenced by vfs_parse_ls_lga().


Variable Documentation

int column_ptr[30] [static]
 

Definition at line 274 of file rpmrpc.c.

Referenced by vfs_parse_ls_lga(), and vfs_split_text().

char* columns[30] [static]
 

Definition at line 272 of file rpmrpc.c.

Referenced by is_num(), vfs_parse_filedate(), vfs_parse_ls_lga(), and vfs_split_text().

int current_mday [static]
 

Definition at line 262 of file rpmrpc.c.

int current_mon [static]
 

Definition at line 264 of file rpmrpc.c.

Referenced by vfs_parse_filedate().

int current_year [static]
 

Definition at line 266 of file rpmrpc.c.

int ftp_st_ino = 0xdead0000 [static]
 

Definition at line 1035 of file rpmrpc.c.

Referenced by ftpLstat(), and ftpStat().

char* ftpBuf = NULL [static]
 

Definition at line 819 of file rpmrpc.c.

Referenced by ftpNLST().

size_t ftpBufAlloced = 0 [static]
 

Definition at line 814 of file rpmrpc.c.

Referenced by ftpNLST().

int ftpmagicdir = 0x8440291 [static]
 

Definition at line 1106 of file rpmrpc.c.


Generated on Thu Aug 14 06:08:47 2008 for rpm by  doxygen 1.3.9.1