関数 | |
int | smbc_unlink (const char *furl) |
Unlink (delete) a file or directory. | |
int | smbc_rename (const char *ourl, const char *nurl) |
Rename or move a file or directory. | |
int | smbc_opendir (const char *durl) |
Open a directory used to obtain directory entries. | |
int | smbc_closedir (int dh) |
Close a directory handle opened by smbc_opendir(). | |
int | smbc_getdents (unsigned int dh, struct smbc_dirent *dirp, int count) |
Get multiple directory entries. | |
smbc_dirent * | smbc_readdir (unsigned int dh) |
Get a single directory entry. | |
off_t | smbc_telldir (int dh) |
Get the current directory offset. | |
int | smbc_lseekdir (int fd, off_t offset) |
lseek on directories. | |
int | smbc_mkdir (const char *durl, mode_t mode) |
Create a directory. | |
int | smbc_rmdir (const char *durl) |
Remove a directory. | |
int | smbc_urldecode (char *dest, char *src, size_t max_dest_len) |
Convert strings of xx to their single character equivalent. | |
const char * | smbc_version (void) |
Return the version of the linked Samba code, and thus the version of the libsmbclient code. |
int smbc_unlink | ( | const char * | furl | ) |
Unlink (delete) a file or directory.
furl | The smb url of the file to delete |
libsmb_compat.c の 215 行で定義されています。
参照先 statcont・_SMBCCTX::unlink.
int smbc_rename | ( | const char * | ourl, | |
const char * | nurl | |||
) |
Rename or move a file or directory.
ourl | The original smb url (source url) of file or directory to be moved | |
nurl | The new smb url (destination url) of the file or directory after the move. Currently nurl must be on the same share as ourl. |
libsmb_compat.c の 220 行で定義されています。
参照先 _SMBCCTX::rename・statcont.
参照元 cmd_rename().
int smbc_opendir | ( | const char * | durl | ) |
Open a directory used to obtain directory entries.
durl | The smb url of the directory to open |
libsmb_compat.c の 225 行で定義されています。
参照先 add_fd()・_SMBCCTX::closedir・fd・smbc_compat_fdlist::file・_SMBCCTX::opendir・statcont.
参照元 cb_itemsignal()・cb_select_child()・cb_wholenet()・cmd_mkdir()・do_cd()・main()・smb_download_dir()・tool_list().
00226 { 00227 SMBCFILE * file; 00228 int fd; 00229 00230 file = (statcont->opendir)(statcont, durl); 00231 if (!file) 00232 return -1; 00233 00234 fd = add_fd(file); 00235 if (fd == -1) 00236 (statcont->closedir)(statcont, file); 00237 00238 return fd; 00239 }
int smbc_closedir | ( | int | dh | ) |
Close a directory handle opened by smbc_opendir().
dh | Directory handle to close |
libsmb_compat.c の 241 行で定義されています。
参照先 _SMBCCTX::closedir・del_fd()・smbc_compat_fdlist::file・find_fd()・statcont.
参照元 cb_itemsignal()・cb_wholenet()・cmd_mkdir()・do_cd()・main()・smb_download_dir()・tool_list().
00242 { 00243 SMBCFILE * file = find_fd(dh); 00244 del_fd(dh); 00245 return (statcont->closedir)(statcont, file); 00246 }
int smbc_getdents | ( | unsigned int | dh, | |
struct smbc_dirent * | dirp, | |||
int | count | |||
) |
Get multiple directory entries.
smbc_getdents() reads as many dirent structures from the an open directory handle into a specified memory area as will fit.
dh | Valid directory as returned by smbc_opendir() | |
dirp | pointer to buffer that will receive the directory entries. | |
count | The size of the dirp buffer in bytes |
libsmb_compat.c の 248 行で定義されています。
参照先 smbc_compat_fdlist::file・find_fd()・_SMBCCTX::getdents・statcont.
参照元 cb_itemsignal()・cb_select_child()・cb_wholenet()・main().
00249 { 00250 SMBCFILE * file = find_fd(dh); 00251 return (statcont->getdents)(statcont, file,dirp, count); 00252 }
struct smbc_dirent* smbc_readdir | ( | unsigned int | dh | ) |
Get a single directory entry.
dh | Valid directory as returned by smbc_opendir() |
libsmb_compat.c の 254 行で定義されています。
参照先 find_fd()・_SMBCCTX::readdir・statcont.
参照元 smb_download_dir()・tool_list().
00255 { 00256 SMBCFILE * file = find_fd(dh); 00257 return (statcont->readdir)(statcont, file); 00258 }
off_t smbc_telldir | ( | int | dh | ) |
Get the current directory offset.
smbc_telldir() may be used in conjunction with smbc_readdir() and smbc_lseekdir().
dh | Valid directory as returned by smbc_opendir() |
libsmb_compat.c の 260 行で定義されています。
参照先 find_fd()・statcont・_SMBCCTX::telldir.
00261 { 00262 SMBCFILE * file = find_fd(dh); 00263 return (statcont->telldir)(statcont, file); 00264 }
int smbc_lseekdir | ( | int | fd, | |
off_t | offset | |||
) |
lseek on directories.
smbc_lseekdir() may be used in conjunction with smbc_readdir() and smbc_telldir(). (rewind by smbc_lseekdir(fd, NULL))
fd | Valid directory as returned by smbc_opendir() | |
offset | The offset (as returned by smbc_telldir). Can be NULL, in which case we will rewind |
libsmb_compat.c の 266 行で定義されています。
参照先 find_fd()・_SMBCCTX::lseekdir・statcont.
00267 { 00268 SMBCFILE * file = find_fd(fd); 00269 return (statcont->lseekdir)(statcont, file, offset); 00270 }
int smbc_mkdir | ( | const char * | durl, | |
mode_t | mode | |||
) |
Create a directory.
durl | The url of the directory to create | |
mode | Specifies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask). |
libsmb_compat.c の 272 行で定義されています。
参照先 _SMBCCTX::mkdir・statcont.
参照元 cmd_mput()・do_mkdir().
int smbc_rmdir | ( | const char * | durl | ) |
Remove a directory.
durl | The smb url of the directory to remove |
libsmb_compat.c の 277 行で定義されています。
参照先 _SMBCCTX::rmdir・statcont.
参照元 cmd_rmdir().
int smbc_urldecode | ( | char * | dest, | |
char * | src, | |||
size_t | max_dest_len | |||
) |
Convert strings of xx to their single character equivalent.
dest | A pointer to a buffer in which the resulting decoded string should be placed. This may be a pointer to the same buffer as src_segment. | |
src | A pointer to the buffer containing the URL to be decoded. Any xx sequences herein are converted to their single character equivalent. Each 'x' must be a valid hexadecimal digit, or that % sequence is left undecoded. | |
max_dest_len | The size of the buffer pointed to by dest_segment. |
libsmbclient.c の 146 行で定義されています。
参照先 hex2int().
参照元 smbc_parse_path().
00147 { 00148 int old_length = strlen(src); 00149 int i = 0; 00150 int err_count = 0; 00151 pstring temp; 00152 char * p; 00153 00154 if ( old_length == 0 ) { 00155 return 0; 00156 } 00157 00158 p = temp; 00159 while ( i < old_length ) { 00160 unsigned char character = src[ i++ ]; 00161 00162 if (character == '%') { 00163 int a = i+1 < old_length ? hex2int( src[i] ) : -1; 00164 int b = i+1 < old_length ? hex2int( src[i+1] ) : -1; 00165 00166 /* Replace valid sequence */ 00167 if (a != -1 && b != -1) { 00168 00169 /* Replace valid %xx sequence with %dd */ 00170 character = (a * 16) + b; 00171 00172 if (character == '\0') { 00173 break; /* Stop at %00 */ 00174 } 00175 00176 i += 2; 00177 } else { 00178 00179 err_count++; 00180 } 00181 } 00182 00183 *p++ = character; 00184 } 00185 00186 *p = '\0'; 00187 00188 strncpy(dest, temp, max_dest_len - 1); 00189 dest[max_dest_len - 1] = '\0'; 00190 00191 return err_count; 00192 }
const char* smbc_version | ( | void | ) |
Return the version of the linked Samba code, and thus the version of the libsmbclient code.
libsmbclient.c の 6671 行で定義されています。
06672 { 06673 return samba_version_string(); 06674 }