Changeset 988 for vendor/current/source3/include/libsmbclient.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/libsmbclient.h
r740 r988 5 5 Copyright (C) Richard Sharpe 2000 6 6 Copyright (C) John Terpsra 2000 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 8 8 Copyright (C) Derrell Lipman 2003-2008 9 9 10 10 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License as published by 13 13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 16 16 This program is distributed in the hope that it will be useful, 17 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 19 GNU General Public License for more details. 20 20 21 21 You should have received a copy of the GNU General Public License 22 22 along with this program; if not, see <http://www.gnu.org/licenses/>. … … 38 38 39 39 /*-------------------------------------------------------------------*/ 40 /* The following are special comments to instruct DOXYGEN (automated 40 /* The following are special comments to instruct DOXYGEN (automated 41 41 * documentation tool: 42 42 */ … … 71 71 * Functions that don't fit in to other categories 72 72 */ 73 /*-------------------------------------------------------------------*/ 73 /*-------------------------------------------------------------------*/ 74 74 75 75 /* Make sure we have the following includes for now ... */ … … 77 77 #include <sys/stat.h> 78 78 #include <sys/statvfs.h> 79 #include <stdint.h> 79 80 #include <fcntl.h> 80 81 #include <utime.h> … … 96 97 * 97 98 */ 98 struct smbc_dirent 99 struct smbc_dirent 99 100 { 100 101 /** Type of entity. 101 102 SMBC_WORKGROUP=1, 102 SMBC_SERVER=2, 103 SMBC_SERVER=2, 103 104 SMBC_FILE_SHARE=3, 104 105 SMBC_PRINTER_SHARE=4, … … 107 108 SMBC_DIR=7, 108 109 SMBC_FILE=8, 109 SMBC_LINK=9,*/ 110 unsigned int smbc_type; 110 SMBC_LINK=9,*/ 111 unsigned int smbc_type; 111 112 112 113 /** Length of this smbc_dirent in bytes … … 117 118 */ 118 119 unsigned int commentlen; 119 /** Points to the null terminated comment string 120 /** Points to the null terminated comment string 120 121 */ 121 122 char *comment; … … 124 125 */ 125 126 unsigned int namelen; 126 /** Points to the null terminated name string 127 /** Points to the null terminated name string 127 128 */ 128 129 char name[1]; … … 207 208 */ 208 209 #ifndef _CLIENT_H 209 struct print_job_info 210 struct print_job_info 210 211 { 211 212 /** numeric ID of the print job 212 213 */ 213 214 unsigned short id; 214 215 215 216 /** represents print job priority (lower numbers mean higher priority) 216 217 */ 217 218 unsigned short priority; 218 219 219 220 /** Size of the print job 220 221 */ 221 222 size_t size; 222 223 223 224 /** Name of the user that owns the print job 224 225 */ 225 226 char user[128]; 226 227 227 228 /** Name of the print job. This will have no name if an anonymous print 228 229 * file was opened. Ie smb://server/printer … … 238 239 239 240 /**@ingroup structure 240 * Server handle 241 * Server handle 241 242 */ 242 243 typedef struct _SMBCSRV SMBCSRV; 243 244 244 245 /**@ingroup structure 245 * File or directory handle 246 * File or directory handle 246 247 */ 247 248 typedef struct _SMBCFILE SMBCFILE; 248 249 249 250 /**@ingroup structure 250 * File or directory handle 251 * File or directory handle 251 252 */ 252 253 typedef struct _SMBCCTX SMBCCTX; … … 276 277 /**@ingroup callback 277 278 * Authentication callback function type (traditional method) 278 * 279 * 279 280 * Type for the the authentication function called by the library to 280 * obtain authentication credent als281 * obtain authentication credentials 281 282 * 282 283 * For kerberos support the function should just be called without … … 292 293 * workgroup to be authenticated. Should be filled in 293 294 * with the correct workgroup if the hint is wrong. 294 * 295 * 295 296 * @param wglen The size of the workgroup buffer in bytes 296 297 * … … 299 300 * filled in with the correct workgroup if the hint is 300 301 * wrong. 301 * 302 * 302 303 * @param unlen The size of the username buffer in bytes 303 304 * 304 * @param pw Pointer to buffer containing to which password 305 * @param pw Pointer to buffer containing to which password 305 306 * copied 306 * 307 * 307 308 * @param pwlen The size of the password buffer in bytes 308 * 309 */ 310 typedef void (*smbc_get_auth_data_fn)(const char *srv, 309 * 310 */ 311 typedef void (*smbc_get_auth_data_fn)(const char *srv, 311 312 const char *shr, 312 char *wg, int wglen, 313 char *wg, int wglen, 313 314 char *un, int unlen, 314 315 char *pw, int pwlen); 315 316 /**@ingroup callback 316 317 * Authentication callback function type (method that includes context) 317 * 318 * 318 319 * Type for the the authentication function called by the library to 319 * obtain authentication credent als320 * obtain authentication credentials 320 321 * 321 322 * For kerberos support the function should just be called without … … 333 334 * workgroup to be authenticated. Should be filled in 334 335 * with the correct workgroup if the hint is wrong. 335 * 336 * 336 337 * @param wglen The size of the workgroup buffer in bytes 337 338 * … … 340 341 * filled in with the correct workgroup if the hint is 341 342 * wrong. 342 * 343 * 343 344 * @param unlen The size of the username buffer in bytes 344 345 * 345 * @param pw Pointer to buffer containing to which password 346 * @param pw Pointer to buffer containing to which password 346 347 * copied 347 * 348 * 348 349 * @param pwlen The size of the password buffer in bytes 349 * 350 * 350 351 */ 351 352 typedef void (*smbc_get_auth_data_with_context_fn)(SMBCCTX *c, 352 const char *srv, 353 const char *srv, 353 354 const char *shr, 354 char *wg, int wglen, 355 char *wg, int wglen, 355 356 char *un, int unlen, 356 357 char *pw, int pwlen); … … 362 363 * @param i pointer to print job information structure 363 364 * 364 */ 365 */ 365 366 typedef void (*smbc_list_print_job_fn)(struct print_job_info *i); 366 367 367 368 368 369 /**@ingroup callback … … 375 376 * @return 0 when connection is good. 1 on error. 376 377 * 377 */ 378 */ 378 379 typedef int (*smbc_check_server_fn)(SMBCCTX * c, SMBCSRV *srv); 379 380 … … 387 388 * @return 0 on success. 1 on failure. 388 389 * 389 */ 390 */ 390 391 typedef int (*smbc_remove_unused_server_fn)(SMBCCTX * c, SMBCSRV *srv); 391 392 … … 398 399 * @param srv pointer to server to add 399 400 * 400 * @param server server name 401 * @param server server name 401 402 * 402 403 * @param share share name … … 408 409 * @return 0 on success. 1 on failure. 409 410 * 410 */ 411 typedef int (*smbc_add_cached_srv_fn) (SMBCCTX * c, SMBCSRV *srv, 411 */ 412 typedef int (*smbc_add_cached_srv_fn) (SMBCCTX * c, SMBCSRV *srv, 412 413 const char * server, const char * share, 413 414 const char * workgroup, const char * username); … … 428 429 * @return pointer to SMBCSRV on success. NULL on failure. 429 430 * 430 */ 431 */ 431 432 typedef SMBCSRV * (*smbc_get_cached_srv_fn) (SMBCCTX * c, const char * server, 432 433 const char * share, const char * workgroup, … … 442 443 * @return 0 when found and removed. 1 on failure. 443 444 * 444 */ 445 */ 445 446 typedef int (*smbc_remove_cached_srv_fn)(SMBCCTX * c, SMBCSRV *srv); 446 447 … … 453 454 * @return 0 when found and removed. 1 on failure. 454 455 * 455 */ 456 */ 456 457 typedef int (*smbc_purge_cached_fn) (SMBCCTX * c); 457 458 … … 506 507 void 507 508 smbc_setTimeout(SMBCCTX *c, int timeout); 509 510 511 /** 512 * Get the TCP port used to connect (0 means default). 513 */ 514 uint16_t 515 smbc_getPort(SMBCCTX *c); 516 517 /** 518 * Set the TCP port used to connect (0 means default). 519 */ 520 void 521 smbc_setPort(SMBCCTX *c, uint16_t port); 508 522 509 523 … … 744 758 smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b); 745 759 760 /** Get indication that the password supplied is the NT hash */ 761 smbc_bool 762 smbc_getOptionUseNTHash(SMBCCTX *c); 763 764 /** Set indication that the password supplied is the NT hash */ 765 void 766 smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b); 767 746 768 747 769 … … 851 873 void smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn); 852 874 875 typedef off_t (*smbc_splice_fn)(SMBCCTX *c, 876 SMBCFILE *srcfile, 877 SMBCFILE *dstfile, 878 off_t count, 879 int (*splice_cb)(off_t n, void *priv), 880 void *priv); 881 smbc_splice_fn smbc_getFunctionSplice(SMBCCTX *c); 882 void smbc_setFunctionSplice(SMBCCTX *c, smbc_splice_fn fn); 883 853 884 typedef int (*smbc_unlink_fn)(SMBCCTX *c, 854 885 const char *fname); … … 963 994 void smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn); 964 995 996 #define SMBC_NOTIFY_ACTION_ADDED 1 997 #define SMBC_NOTIFY_ACTION_REMOVED 2 998 #define SMBC_NOTIFY_ACTION_MODIFIED 3 999 #define SMBC_NOTIFY_ACTION_OLD_NAME 4 1000 #define SMBC_NOTIFY_ACTION_NEW_NAME 5 1001 #define SMBC_NOTIFY_ACTION_ADDED_STREAM 6 1002 #define SMBC_NOTIFY_ACTION_REMOVED_STREAM 7 1003 #define SMBC_NOTIFY_ACTION_MODIFIED_STREAM 8 1004 1005 struct smbc_notify_callback_action { 1006 uint32_t action; 1007 const char *filename; 1008 }; 1009 1010 typedef int (*smbc_notify_callback_fn)( 1011 const struct smbc_notify_callback_action *actions, 1012 size_t num_actions, void *private_data); 1013 1014 typedef int (*smbc_notify_fn)(SMBCCTX *c, SMBCFILE *dir, smbc_bool recursive, 1015 uint32_t completion_filter, 1016 unsigned callback_timeout_ms, 1017 smbc_notify_callback_fn cb, void *private_data); 1018 smbc_notify_fn smbc_getFunctionNotify(SMBCCTX *c); 1019 void smbc_setFunctionNotify(SMBCCTX *c, smbc_notify_fn fn); 965 1020 966 1021 … … 1074 1129 * 1075 1130 * @return Returns 0 on succes. Returns 1 on failure with errno set: 1076 * - EBUSY Server connections are still used, Files are open or cache 1131 * - EBUSY Server connections are still used, Files are open or cache 1077 1132 * could not be purged 1078 1133 * - EBADF context == NULL … … 1122 1177 * smbc_context_init() failure. Avoid this. 1123 1178 * You'll have to call smbc_free_context() yourself 1124 * on failure. 1179 * on failure. 1125 1180 */ 1126 1181 … … 1131 1186 * 1132 1187 * Must be called before using any of the smbclient API function 1133 * 1134 * @param fn The function that will be called to obtaion 1188 * 1189 * @param fn The function that will be called to obtaion 1135 1190 * authentication credentials. 1136 1191 * … … 1138 1193 * changed in smb.conf file. Allows caller to set 1139 1194 * debugging if no smb.conf. 1140 * 1195 * 1141 1196 * @return 0 on success, < 0 on error with errno set: 1142 1197 * - ENOMEM Out of memory … … 1174 1229 * Open a file on an SMB server. 1175 1230 * 1176 * @param furl The smb url of the file to be opened. 1177 * 1178 * @param flags Is one of O_RDONLY, O_WRONLY or O_RDWR which 1231 * @param furl The smb url of the file to be opened. 1232 * 1233 * @param flags Is one of O_RDONLY, O_WRONLY or O_RDWR which 1179 1234 * request opening the file read-only,write-only 1180 1235 * or read/write. flags may also be bitwise-or'd with 1181 * one or more of the following: 1182 * O_CREAT - If the file does not exist it will be 1236 * one or more of the following: 1237 * O_CREAT - If the file does not exist it will be 1183 1238 * created. 1184 * O_EXCL - When used with O_CREAT, if the file 1185 * already exists it is an error and the open will 1186 * fail. 1239 * O_EXCL - When used with O_CREAT, if the file 1240 * already exists it is an error and the open will 1241 * fail. 1187 1242 * O_TRUNC - If the file already exists it will be 1188 1243 * truncated. 1189 * O_APPEND The file is opened in append mode 1190 * 1191 * @param mode mode specifies the permissions to use if a new 1192 * file is created. It is modified by the 1244 * O_APPEND The file is opened in append mode 1245 * 1246 * @param mode mode specifies the permissions to use if a new 1247 * file is created. It is modified by the 1193 1248 * process's umask in the usual way: the permissions 1194 * of the created file are (mode & ~umask) 1249 * of the created file are (mode & ~umask) 1195 1250 * 1196 1251 * Not currently use, but there for future use. … … 1200 1255 * @return Valid file handle, < 0 on error with errno set: 1201 1256 * - ENOMEM Out of memory 1202 * - EINVAL if an invalid parameter passed, like no 1203 * file, or smbc_init not called. 1204 * - EEXIST pathname already exists and O_CREAT and 1205 * O_EXCL were used. 1206 * - EISDIR pathname refers to a directory and 1207 * the access requested involved writing. 1208 * - EACCES The requested access to the file is not 1209 * allowed 1210 * - ENODEV The requested share does not exist 1211 * - ENOTDIR A file on the path is not a directory 1212 * - ENOENT A directory component in pathname does 1213 * not exist. 1214 * 1215 * @see smbc_creat() 1216 * 1217 * @note This call uses an underlying routine that may create 1218 * a new connection to the server specified in the URL. 1219 * If the credentials supplied in the URL, or via the 1220 * auth_fn in the smbc_init call, fail, this call will 1221 * try again with an empty username and password. This 1222 * often gets mapped to the guest account on some machines. 1223 */ 1224 1225 int smbc_open(const char *furl, int flags, mode_t mode); 1226 1227 /**@ingroup file 1228 * Create a file on an SMB server. 1229 * 1230 * Same as calling smbc_open() with flags = O_CREAT|O_WRONLY|O_TRUNC 1231 * 1232 * @param furl The smb url of the file to be created 1233 * 1234 * @param mode mode specifies the permissions to use if a new 1235 * file is created. It is modified by the 1236 * process's umask in the usual way: the permissions 1237 * of the created file are (mode & ~umask) 1238 * 1239 * NOTE, the above is not true. We are dealing with 1240 * an SMB server, which has no concept of a umask! 1241 * 1242 * @return Valid file handle, < 0 on error with errno set: 1243 * - ENOMEM Out of memory 1244 * - EINVAL if an invalid parameter passed, like no 1257 * - EINVAL if an invalid parameter passed, like no 1245 1258 * file, or smbc_init not called. 1246 1259 * - EEXIST pathname already exists and O_CREAT and … … 1249 1262 * the access requested involved writing. 1250 1263 * - EACCES The requested access to the file is not 1251 * allowed 1252 * - ENOENT A directory component in pathname does 1264 * allowed 1265 * - ENODEV The requested share does not exist 1266 * - ENOTDIR A file on the path is not a directory 1267 * - ENOENT A directory component in pathname does 1268 * not exist. 1269 * 1270 * @see smbc_creat() 1271 * 1272 * @note This call uses an underlying routine that may create 1273 * a new connection to the server specified in the URL. 1274 * If the credentials supplied in the URL, or via the 1275 * auth_fn in the smbc_init call, fail, this call will 1276 * try again with an empty username and password. This 1277 * often gets mapped to the guest account on some machines. 1278 */ 1279 1280 int smbc_open(const char *furl, int flags, mode_t mode); 1281 1282 /**@ingroup file 1283 * Create a file on an SMB server. 1284 * 1285 * Same as calling smbc_open() with flags = O_CREAT|O_WRONLY|O_TRUNC 1286 * 1287 * @param furl The smb url of the file to be created 1288 * 1289 * @param mode mode specifies the permissions to use if a new 1290 * file is created. It is modified by the 1291 * process's umask in the usual way: the permissions 1292 * of the created file are (mode & ~umask) 1293 * 1294 * NOTE, the above is not true. We are dealing with 1295 * an SMB server, which has no concept of a umask! 1296 * 1297 * @return Valid file handle, < 0 on error with errno set: 1298 * - ENOMEM Out of memory 1299 * - EINVAL if an invalid parameter passed, like no 1300 * file, or smbc_init not called. 1301 * - EEXIST pathname already exists and O_CREAT and 1302 * O_EXCL were used. 1303 * - EISDIR pathname refers to a directory and 1304 * the access requested involved writing. 1305 * - EACCES The requested access to the file is not 1306 * allowed 1307 * - ENOENT A directory component in pathname does 1253 1308 * not exist. 1254 1309 * - ENODEV The requested share does not exist. … … 1272 1327 * < 0 on error, with errno set: 1273 1328 * - EISDIR fd refers to a directory 1274 * - EBADF fd is not a valid file descriptor or 1329 * - EBADF fd is not a valid file descriptor or 1275 1330 * is not open for reading. 1276 * - EINVAL fd is attached to an object which is 1331 * - EINVAL fd is attached to an object which is 1277 1332 * unsuitable for reading, or no buffer passed or 1278 1333 * smbc_init not called. … … 1295 1350 * @return Number of bytes written, < 0 on error with errno set: 1296 1351 * - EISDIR fd refers to a directory. 1297 * - EBADF fd is not a valid file descriptor or 1352 * - EBADF fd is not a valid file descriptor or 1298 1353 * is not open for reading. 1299 * - EINVAL fd is attached to an object which is 1354 * - EINVAL fd is attached to an object which is 1300 1355 * unsuitable for reading, or no buffer passed or 1301 1356 * smbc_init not called. … … 1311 1366 * 1312 1367 * @param fd Open file handle from smbc_open() or smbc_creat() 1313 * 1368 * 1314 1369 * @param offset Offset in bytes from whence 1315 * 1370 * 1316 1371 * @param whence A location in the file: 1317 1372 * - SEEK_SET The offset is set to offset bytes from 1318 1373 * the beginning of the file 1319 * - SEEK_CUR The offset is set to current location 1374 * - SEEK_CUR The offset is set to current location 1320 1375 * plus offset bytes. 1321 * - SEEK_END The offset is set to the size of the 1376 * - SEEK_END The offset is set to the size of the 1322 1377 * file plus offset bytes. 1323 1378 * 1324 * @return Upon successful completion, lseek returns the 1325 * resulting offset location as measured in bytes 1379 * @return Upon successful completion, lseek returns the 1380 * resulting offset location as measured in bytes 1326 1381 * from the beginning of the file. Otherwise, a value 1327 * of (off_t)-1 is returned and errno is set to 1382 * of (off_t)-1 is returned and errno is set to 1328 1383 * indicate the error: 1329 1384 * - EBADF Fildes is not an open file descriptor. … … 1332 1387 * 1333 1388 * @todo Are all the whence values really supported? 1334 * 1389 * 1335 1390 * @todo Are errno values complete and correct? 1336 1391 */ … … 1358 1413 * 1359 1414 * @return 0 on success, < 0 on error with errno set: 1360 * - EACCES or EPERM Write access to the directory 1361 * containing pathname is not allowed or one 1415 * - EACCES or EPERM Write access to the directory 1416 * containing pathname is not allowed or one 1362 1417 * of the directories in pathname did not allow 1363 1418 * search (execute) permission … … 1378 1433 /**@ingroup directory 1379 1434 * Rename or move a file or directory. 1380 * 1381 * @param ourl The original smb url (source url) of file or 1435 * 1436 * @param ourl The original smb url (source url) of file or 1382 1437 * directory to be moved 1383 * 1438 * 1384 1439 * @param nurl The new smb url (destination url) of the file 1385 1440 * or directory after the move. Currently nurl must … … 1389 1444 * - EISDIR nurl is an existing directory, but ourl is 1390 1445 * not a directory. 1391 * - EEXIST nurl is a non-empty directory, 1446 * - EEXIST nurl is a non-empty directory, 1392 1447 * i.e., contains entries other than "." and ".." 1393 * - EINVAL The new url contained a path prefix 1448 * - EINVAL The new url contained a path prefix 1394 1449 * of the old, or, more generally, an attempt was 1395 1450 * made to make a directory a subdirectory of itself 1396 1451 * or smbc_init not called. 1397 * - ENOTDIR A component used as a directory in ourl 1398 * or nurl path is not, in fact, a directory. Or, 1452 * - ENOTDIR A component used as a directory in ourl 1453 * or nurl path is not, in fact, a directory. Or, 1399 1454 * ourl is a directory, and newpath exists but is not 1400 1455 * a directory. 1401 * - EACCES or EPERM Write access to the directory 1402 * containing ourl or nurl is not allowed for the 1403 * process's effective uid, or one of the 1456 * - EACCES or EPERM Write access to the directory 1457 * containing ourl or nurl is not allowed for the 1458 * process's effective uid, or one of the 1404 1459 * directories in ourl or nurl did not allow search 1405 1460 * (execute) permission, or ourl was a directory 1406 1461 * and did not allow write permission. 1407 * - ENOENT A directory component in ourl or nurl 1462 * - ENOENT A directory component in ourl or nurl 1408 1463 * does not exist. 1409 1464 * - EXDEV Rename across shares not supported. … … 1429 1484 * not parse, or was of incorrect form or smbc_init not 1430 1485 * called. 1431 * - ENOENT durl does not exist, or name is an 1432 * - ENOMEM Insufficient memory to complete the 1433 * operation. 1486 * - ENOENT durl does not exist, or name is an 1487 * - ENOMEM Insufficient memory to complete the 1488 * operation. 1434 1489 * - ENOTDIR name is not a directory. 1435 1490 * - EPERM the workgroup could not be found. … … 1458 1513 * Get multiple directory entries. 1459 1514 * 1460 * smbc_getdents() reads as many dirent structures from the an open 1515 * smbc_getdents() reads as many dirent structures from the an open 1461 1516 * directory handle into a specified memory area as will fit. 1462 1517 * … … 1465 1520 * @param dirp pointer to buffer that will receive the directory 1466 1521 * entries. 1467 * 1522 * 1468 1523 * @param count The size of the dirp buffer in bytes 1469 1524 * … … 1509 1564 * @return The current location in the directory stream or -1 1510 1565 * if an error occur. The current location is not 1511 * an offset. Becuase of the implementation, it is a 1566 * an offset. Becuase of the implementation, it is a 1512 1567 * handle that allows the library to find the entry 1513 1568 * later. … … 1529 1584 * 1530 1585 * @param fd Valid directory as returned by smbc_opendir() 1531 * 1586 * 1532 1587 * @param offset The offset (as returned by smbc_telldir). Can be 1533 1588 * NULL, in which case we will rewind … … 1552 1607 * 1553 1608 * @param mode Specifies the permissions to use. It is modified 1554 * by the process's umask in the usual way: the 1609 * by the process's umask in the usual way: the 1555 1610 * permissions of the created file are (mode & ~umask). 1556 * 1611 * 1557 1612 * @return 0 on success, < 0 on error with errno set: 1558 1613 * - EEXIST directory url already exists … … 1572 1627 /**@ingroup directory 1573 1628 * Remove a directory. 1574 * 1629 * 1575 1630 * @param durl The smb url of the directory to remove 1576 1631 * … … 1584 1639 * - ENOMEM Insufficient kernel memory was available. 1585 1640 * 1586 * @see smbc_mkdir(), smbc_unlink() 1641 * @see smbc_mkdir(), smbc_unlink() 1587 1642 * 1588 1643 * @todo Are errno values complete and correct? … … 1590 1645 int smbc_rmdir(const char *durl); 1591 1646 1647 /**@ingroup directory 1648 * Request directory notifications 1649 * 1650 * @param dh Valid directory as returned by smbc_opendir() 1651 * 1652 * @param recursive Are changes in subdirectories wanted? 1653 * 1654 * @param completion_filter Bitwise-or of the SMBC_NOTIFY_CHANGE_* 1655 * events that are interesting 1656 * 1657 * @param callback_timeout_ms If set to non-zero, interval in milliseconds 1658 * that "cb" will be called with 0 actions. 1659 * This gives "cb" the chance to cancel the 1660 * smbc_notify call. 1661 * 1662 * @param cb Callback functions taking events. If "cb" 1663 * returns nonzero, smbc_notify will return. 1664 * 1665 * @param private_data Pointer given to "cb" 1666 * 1667 * @return 0 on success, -1 on error with errno set 1668 * 1669 * @see smbc_opendir(), smbc_closedir() 1670 */ 1671 1672 #define SMBC_NOTIFY_CHANGE_FILE_NAME 0x001 1673 #define SMBC_NOTIFY_CHANGE_DIR_NAME 0x002 1674 #define SMBC_NOTIFY_CHANGE_ATTRIBUTES 0x004 1675 #define SMBC_NOTIFY_CHANGE_SIZE 0x008 1676 #define SMBC_NOTIFY_CHANGE_LAST_WRITE 0x010 1677 #define SMBC_NOTIFY_CHANGE_LAST_ACCESS 0x020 1678 #define SMBC_NOTIFY_CHANGE_CREATION 0x040 1679 #define SMBC_NOTIFY_CHANGE_EA 0x080 1680 #define SMBC_NOTIFY_CHANGE_SECURITY 0x100 1681 #define SMBC_NOTIFY_CHANGE_STREAM_NAME 0x200 1682 #define SMBC_NOTIFY_CHANGE_STREAM_SIZE 0x400 1683 #define SMBC_NOTIFY_CHANGE_STREAM_WRITE 0x800 1684 1685 int smbc_notify(int dh, smbc_bool recursive, uint32_t completion_filter, 1686 unsigned callback_timeout_ms, 1687 smbc_notify_callback_fn cb, void *private_data); 1592 1688 1593 1689 /**@ingroup attribute … … 1596 1692 * @param url The smb url to get information for 1597 1693 * 1598 * @param st pointer to a buffer that will be filled with 1694 * @param st pointer to a buffer that will be filled with 1599 1695 * standard Unix struct stat information. 1600 1696 * … … 1615 1711 /**@ingroup attribute 1616 1712 * Get file information via an file descriptor. 1617 * 1713 * 1618 1714 * @param fd Open file handle from smbc_open() or smbc_creat() 1619 1715 * 1620 * @param st pointer to a buffer that will be filled with 1716 * @param st pointer to a buffer that will be filled with 1621 1717 * standard Unix struct stat information. 1622 * 1718 * 1623 1719 * @return 0 on success, < 0 on error with errno set: 1624 1720 * - EBADF filedes is bad. … … 1637 1733 /**@ingroup attribute 1638 1734 * Get file system information for a specified path. 1639 * 1735 * 1640 1736 * @param url The smb url to get information for 1641 1737 * 1642 * @param st pointer to a buffer that will be filled with 1738 * @param st pointer to a buffer that will be filled with 1643 1739 * standard Unix struct statvfs information. 1644 * 1740 * 1645 1741 * @return 0 on success, < 0 on error with errno set: 1646 1742 * - EBADF filedes is bad. … … 1660 1756 /**@ingroup attribute 1661 1757 * Get file system information via an file descriptor. 1662 * 1758 * 1663 1759 * @param fd Open file handle from smbc_open(), smbc_creat(), 1664 1760 * or smbc_opendir() 1665 1761 * 1666 * @param st pointer to a buffer that will be filled with 1762 * @param st pointer to a buffer that will be filled with 1667 1763 * standard Unix struct statvfs information. 1668 * 1764 * 1669 1765 * @return 0 on success, < 0 on error with errno set: 1670 1766 * - EBADF filedes is bad. … … 1685 1781 /**@ingroup attribute 1686 1782 * Truncate a file given a file descriptor 1687 * 1783 * 1688 1784 * @param fd Open file handle from smbc_open() or smbc_creat() 1689 1785 * 1690 1786 * @param size size to truncate the file to 1691 * 1787 * 1692 1788 * @return 0 on success, < 0 on error with errno set: 1693 1789 * - EBADF filedes is bad. … … 1709 1805 * @param url The smb url of the file or directory to change 1710 1806 * permissions of 1711 * 1807 * 1712 1808 * @param mode The permissions to set: 1713 1809 * - Put good explaination of permissions here! … … 1771 1867 * @param url The smb url of the file or directory to set extended 1772 1868 * attributes for. 1773 * 1869 * 1774 1870 * @param name The name of an attribute to be changed. Names are of 1775 1871 * one of the following forms: … … 1881 1977 * @param url The smb url of the file or directory to set extended 1882 1978 * attributes for. 1883 * 1979 * 1884 1980 * @param name The name of an attribute to be changed. Names are of 1885 1981 * one of the following forms: … … 1988 2084 * previously returned by smbc_open(), to get extended 1989 2085 * attributes for. 1990 * 2086 * 1991 2087 * @param name The name of an attribute to be changed. Names are of 1992 2088 * one of the following forms: … … 2093 2189 * @param url The smb url of the file or directory to get extended 2094 2190 * attributes for. 2095 * 2191 * 2096 2192 * @param name The name of an attribute to be retrieved. Names are of 2097 2193 * one of the following forms: … … 2129 2225 * required to hold the attribute value will be returned, 2130 2226 * but nothing will be placed into the value buffer. 2131 * 2227 * 2132 2228 * @return 0 on success, < 0 on error with errno set: 2133 2229 * - EINVAL The client library is not properly initialized … … 2158 2254 * @param url The smb url of the file or directory to get extended 2159 2255 * attributes for. 2160 * 2256 * 2161 2257 * @param name The name of an attribute to be retrieved. Names are of 2162 2258 * one of the following forms: … … 2194 2290 * required to hold the attribute value will be returned, 2195 2291 * but nothing will be placed into the value buffer. 2196 * 2292 * 2197 2293 * @return 0 on success, < 0 on error with errno set: 2198 2294 * - EINVAL The client library is not properly initialized … … 2221 2317 * previously returned by smbc_open(), to get extended 2222 2318 * attributes for. 2223 * 2319 * 2224 2320 * @param name The name of an attribute to be retrieved. Names are of 2225 2321 * one of the following forms: … … 2257 2353 * required to hold the attribute value will be returned, 2258 2354 * but nothing will be placed into the value buffer. 2259 * 2355 * 2260 2356 * @return 0 on success, < 0 on error with errno set: 2261 2357 * - EINVAL The client library is not properly initialized … … 2284 2380 * @param url The smb url of the file or directory to remove the extended 2285 2381 * attributes for. 2286 * 2382 * 2287 2383 * @param name The name of an attribute to be removed. Names are of 2288 2384 * one of the following forms: … … 2334 2430 * @param url The smb url of the file or directory to remove the extended 2335 2431 * attributes for. 2336 * 2432 * 2337 2433 * @param name The name of an attribute to be removed. Names are of 2338 2434 * one of the following forms: … … 2382 2478 * previously returned by smbc_open(), to get extended 2383 2479 * attributes for. 2384 * 2480 * 2385 2481 * @param name The name of an attribute to be removed. Names are of 2386 2482 * one of the following forms: … … 2437 2533 * required to hold all of the attribute names will be 2438 2534 * returned, but nothing will be placed into the list buffer. 2439 * 2535 * 2440 2536 * @return 0 on success, < 0 on error with errno set: 2441 2537 * - EINVAL The client library is not properly initialized … … 2475 2571 * required to hold all of the attribute names will be 2476 2572 * returned, but nothing will be placed into the list buffer. 2477 * 2573 * 2478 2574 * @return 0 on success, < 0 on error with errno set: 2479 2575 * - EINVAL The client library is not properly initialized … … 2501 2597 * previously returned by smbc_open(), to get extended 2502 2598 * attributes for. 2503 * 2599 * 2504 2600 * @param list A pointer to a buffer in which the list of attributes for 2505 2601 * the specified file or directory will be placed (unless … … 2510 2606 * required to hold all of the attribute names will be 2511 2607 * returned, but nothing will be placed into the list buffer. 2512 * 2608 * 2513 2609 * @return 0 on success, < 0 on error with errno set: 2514 2610 * - EINVAL The client library is not properly initialized … … 2532 2628 /**@ingroup print 2533 2629 * Print a file given the name in fname. It would be a URL ... 2534 * 2630 * 2535 2631 * @param fname The URL of a file on a remote SMB server that the 2536 2632 * caller wants printed … … 2538 2634 * @param printq The URL of the print share to print the file to. 2539 2635 * 2540 * @return 0 on success, < 0 on error with errno set: 2636 * @return 0 on success, < 0 on error with errno set: 2541 2637 * 2542 2638 * - EINVAL fname or printq was NULL or smbc_init not … … 2544 2640 * and errors returned by smbc_open 2545 2641 * 2546 */ 2642 */ 2547 2643 int smbc_print_file(const char *fname, const char *printq); 2548 2644 … … 2563 2659 2564 2660 /**@ingroup print 2565 * List the print jobs on a print share, for the moment, pass a callback 2661 * List the print jobs on a print share, for the moment, pass a callback 2566 2662 * 2567 2663 * @param purl The url of the print share to list the jobs of 2568 * 2664 * 2569 2665 * @param fn Callback function the receives printjob info 2570 * 2571 * @return 0 on success, < 0 on error with errno set: 2666 * 2667 * @return 0 on success, < 0 on error with errno set: 2572 2668 * - EINVAL fname was NULL or smbc_init not called 2573 2669 * - EACCES ??? … … 2576 2672 2577 2673 /**@ingroup print 2578 * Delete a print job 2674 * Delete a print job 2579 2675 * 2580 2676 * @param purl Url of the print share … … 2582 2678 * @param id The id of the job to delete 2583 2679 * 2584 * @return 0 on success, < 0 on error with errno set: 2680 * @return 0 on success, < 0 on error with errno set: 2585 2681 * - EINVAL fname was NULL or smbc_init not called 2586 2682 * … … 2611 2707 * string should be placed. This may be a pointer to the 2612 2708 * same buffer as src_segment. 2613 * 2709 * 2614 2710 * @param src A pointer to the buffer containing the URL to be decoded. 2615 2711 * Any %xx sequences herein are converted to their single … … 2619 2715 * @param max_dest_len 2620 2716 * The size of the buffer pointed to by dest_segment. 2621 * 2717 * 2622 2718 * @return The number of % sequences which could not be converted 2623 2719 * due to lack of two following hexadecimal digits. … … 2640 2736 * string should be placed. Unlike smbc_urldecode(), this 2641 2737 * must be a buffer unique from src. 2642 * 2738 * 2643 2739 * @param src A pointer to the buffer containing the string to be encoded. 2644 2740 * Any character not specifically allowed in a URL is converted … … 2647 2743 * @param max_dest_len 2648 2744 * The size of the buffer pointed to by dest_segment. 2649 * 2745 * 2650 2746 * @returns The remaining buffer length. 2651 2747 */ … … 2704 2800 * Wrapper around smbc_set_credentials. 2705 2801 * Used to set correct credentials that will 2706 * be used to connect to DFS target share 2802 * be used to connect to DFS target share 2707 2803 * in libsmbclient 2708 2804 */ … … 2807 2903 int lock_type, 2808 2904 const char *location), 2809 2905 2810 2906 /* Thread local storage. */ 2811 2907 int (*create_tls)(const char *keyname, … … 2825 2921 /** 2826 2922 * @ingroup structure 2827 * Structure that contains a client context information 2923 * Structure that contains a client context information 2828 2924 * This structure is known as SMBCCTX 2829 2925 * … … 2847 2943 */ 2848 2944 int debug DEPRECATED_SMBC_INTERFACE; 2849 2945 2850 2946 /** 2851 2947 * netbios name used for making connections … … 2889 2985 * Use smbc_getFunction*() and smbc_setFunction*(), e.g. 2890 2986 * smbc_getFunctionOpen(), smbc_setFunctionUnlink(), etc. 2891 */ 2987 */ 2892 2988 smbc_open_fn open DEPRECATED_SMBC_INTERFACE; 2893 2989 smbc_creat_fn creat DEPRECATED_SMBC_INTERFACE; … … 2942 3038 */ 2943 3039 smbc_get_auth_data_fn auth_fn DEPRECATED_SMBC_INTERFACE; 2944 3040 2945 3041 /** 2946 3042 * check if a server is still good … … 2970 3066 2971 3067 /** 2972 * server cache addition 3068 * server cache addition 2973 3069 * 2974 3070 * DEPRECATED: … … 2979 3075 2980 3076 /** 2981 * server cache lookup 3077 * server cache lookup 2982 3078 * 2983 3079 * DEPRECATED: … … 2995 3091 */ 2996 3092 smbc_remove_cached_srv_fn remove_cached_srv_fn DEPRECATED_SMBC_INTERFACE; 2997 3093 2998 3094 /** 2999 3095 * server cache purging, try to remove all cached servers … … 3017 3113 /* 3018 3114 * Very old configuration options. 3019 * 3115 * 3020 3116 * DEPRECATED: 3021 3117 * Use one of the following functions instead: … … 3028 3124 */ 3029 3125 int flags DEPRECATED_SMBC_INTERFACE; 3030 3126 3031 3127 /** 3032 3128 * user options selections that apply to this session … … 3043 3139 int one_share_per_server DEPRECATED_SMBC_INTERFACE; 3044 3140 } options DEPRECATED_SMBC_INTERFACE; 3045 3141 3046 3142 /** INTERNAL DATA 3047 3143 * do _NOT_ touch this from your program !
Note:
See TracChangeset
for help on using the changeset viewer.