Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/include/libsmbclient.h

    r740 r988  
    55  Copyright (C) Richard Sharpe 2000
    66  Copyright (C) John Terpsra 2000
    7   Copyright (C) Tom Jansen (Ninja ISD) 2002 
     7  Copyright (C) Tom Jansen (Ninja ISD) 2002
    88  Copyright (C) Derrell Lipman 2003-2008
    99
    10    
     10
    1111  This program is free software; you can redistribute it and/or modify
    1212  it under the terms of the GNU General Public License as published by
    1313  the Free Software Foundation; either version 3 of the License, or
    1414  (at your option) any later version.
    15    
     15
    1616  This program is distributed in the hope that it will be useful,
    1717  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1818  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1919  GNU General Public License for more details.
    20    
     20
    2121  You should have received a copy of the GNU General Public License
    2222  along with this program; if not, see <http://www.gnu.org/licenses/>.
     
    3838
    3939/*-------------------------------------------------------------------*/
    40 /* The following are special comments to instruct DOXYGEN (automated 
     40/* The following are special comments to instruct DOXYGEN (automated
    4141 * documentation tool:
    4242*/
     
    7171*   Functions that don't fit in to other categories
    7272*/
    73 /*-------------------------------------------------------------------*/   
     73/*-------------------------------------------------------------------*/
    7474
    7575/* Make sure we have the following includes for now ... */
     
    7777#include <sys/stat.h>
    7878#include <sys/statvfs.h>
     79#include <stdint.h>
    7980#include <fcntl.h>
    8081#include <utime.h>
     
    9697 *
    9798 */
    98 struct smbc_dirent 
     99struct smbc_dirent
    99100{
    100101        /** Type of entity.
    101102            SMBC_WORKGROUP=1,
    102             SMBC_SERVER=2, 
     103            SMBC_SERVER=2,
    103104            SMBC_FILE_SHARE=3,
    104105            SMBC_PRINTER_SHARE=4,
     
    107108            SMBC_DIR=7,
    108109            SMBC_FILE=8,
    109             SMBC_LINK=9,*/ 
    110         unsigned int smbc_type; 
     110            SMBC_LINK=9,*/
     111        unsigned int smbc_type;
    111112
    112113        /** Length of this smbc_dirent in bytes
     
    117118         */
    118119        unsigned int commentlen;
    119         /** Points to the null terminated comment string 
     120        /** Points to the null terminated comment string
    120121         */
    121122        char *comment;
     
    124125         */
    125126        unsigned int namelen;
    126         /** Points to the null terminated name string 
     127        /** Points to the null terminated name string
    127128         */
    128129        char name[1];
     
    207208 */
    208209#ifndef _CLIENT_H
    209 struct print_job_info 
     210struct print_job_info
    210211{
    211212        /** numeric ID of the print job
    212213         */
    213214        unsigned short id;
    214    
     215
    215216        /** represents print job priority (lower numbers mean higher priority)
    216217         */
    217218        unsigned short priority;
    218    
     219
    219220        /** Size of the print job
    220221         */
    221222        size_t size;
    222    
     223
    223224        /** Name of the user that owns the print job
    224225         */
    225226        char user[128];
    226  
     227
    227228        /** Name of the print job. This will have no name if an anonymous print
    228229         *  file was opened. Ie smb://server/printer
     
    238239
    239240/**@ingroup structure
    240  * Server handle 
     241 * Server handle
    241242 */
    242243typedef struct _SMBCSRV  SMBCSRV;
    243244
    244245/**@ingroup structure
    245  * File or directory handle 
     246 * File or directory handle
    246247 */
    247248typedef struct _SMBCFILE SMBCFILE;
    248249
    249250/**@ingroup structure
    250  * File or directory handle 
     251 * File or directory handle
    251252 */
    252253typedef struct _SMBCCTX SMBCCTX;
     
    276277/**@ingroup callback
    277278 * Authentication callback function type (traditional method)
    278  * 
     279 *
    279280 * Type for the the authentication function called by the library to
    280  * obtain authentication credentals
     281 * obtain authentication credentials
    281282 *
    282283 * For kerberos support the function should just be called without
     
    292293 *                  workgroup to be authenticated.  Should be filled in
    293294 *                  with the correct workgroup if the hint is wrong.
    294  * 
     295 *
    295296 * @param wglen     The size of the workgroup buffer in bytes
    296297 *
     
    299300 *                  filled in with the correct workgroup if the hint is
    300301 *                  wrong.
    301  * 
     302 *
    302303 * @param unlen     The size of the username buffer in bytes
    303304 *
    304  * @param pw        Pointer to buffer containing to which password 
     305 * @param pw        Pointer to buffer containing to which password
    305306 *                  copied
    306  * 
     307 *
    307308 * @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 */
     311typedef void (*smbc_get_auth_data_fn)(const char *srv,
    311312                                      const char *shr,
    312                                       char *wg, int wglen, 
     313                                      char *wg, int wglen,
    313314                                      char *un, int unlen,
    314315                                      char *pw, int pwlen);
    315316/**@ingroup callback
    316317 * Authentication callback function type (method that includes context)
    317  * 
     318 *
    318319 * Type for the the authentication function called by the library to
    319  * obtain authentication credentals
     320 * obtain authentication credentials
    320321 *
    321322 * For kerberos support the function should just be called without
     
    333334 *                  workgroup to be authenticated.  Should be filled in
    334335 *                  with the correct workgroup if the hint is wrong.
    335  * 
     336 *
    336337 * @param wglen     The size of the workgroup buffer in bytes
    337338 *
     
    340341 *                  filled in with the correct workgroup if the hint is
    341342 *                  wrong.
    342  * 
     343 *
    343344 * @param unlen     The size of the username buffer in bytes
    344345 *
    345  * @param pw        Pointer to buffer containing to which password 
     346 * @param pw        Pointer to buffer containing to which password
    346347 *                  copied
    347  * 
     348 *
    348349 * @param pwlen     The size of the password buffer in bytes
    349  *           
     350 *
    350351 */
    351352typedef void (*smbc_get_auth_data_with_context_fn)(SMBCCTX *c,
    352                                                    const char *srv, 
     353                                                   const char *srv,
    353354                                                   const char *shr,
    354                                                    char *wg, int wglen, 
     355                                                   char *wg, int wglen,
    355356                                                   char *un, int unlen,
    356357                                                   char *pw, int pwlen);
     
    362363 * @param i         pointer to print job information structure
    363364 *
    364  */ 
     365 */
    365366typedef void (*smbc_list_print_job_fn)(struct print_job_info *i);
    366                
     367
    367368
    368369/**@ingroup callback
     
    375376 * @return          0 when connection is good. 1 on error.
    376377 *
    377  */ 
     378 */
    378379typedef int (*smbc_check_server_fn)(SMBCCTX * c, SMBCSRV *srv);
    379380
     
    387388 * @return          0 on success. 1 on failure.
    388389 *
    389  */ 
     390 */
    390391typedef int (*smbc_remove_unused_server_fn)(SMBCCTX * c, SMBCSRV *srv);
    391392
     
    398399 * @param srv       pointer to server to add
    399400 *
    400  * @param server    server name 
     401 * @param server    server name
    401402 *
    402403 * @param share     share name
     
    408409 * @return          0 on success. 1 on failure.
    409410 *
    410  */ 
    411 typedef int (*smbc_add_cached_srv_fn)   (SMBCCTX * c, SMBCSRV *srv, 
     411 */
     412typedef int (*smbc_add_cached_srv_fn)   (SMBCCTX * c, SMBCSRV *srv,
    412413                                    const char * server, const char * share,
    413414                                    const char * workgroup, const char * username);
     
    428429 * @return          pointer to SMBCSRV on success. NULL on failure.
    429430 *
    430  */ 
     431 */
    431432typedef SMBCSRV * (*smbc_get_cached_srv_fn)   (SMBCCTX * c, const char * server,
    432433                                               const char * share, const char * workgroup,
     
    442443 * @return          0 when found and removed. 1 on failure.
    443444 *
    444  */ 
     445 */
    445446typedef int (*smbc_remove_cached_srv_fn)(SMBCCTX * c, SMBCSRV *srv);
    446447
     
    453454 * @return          0 when found and removed. 1 on failure.
    454455 *
    455  */ 
     456 */
    456457typedef int (*smbc_purge_cached_fn)     (SMBCCTX * c);
    457458
     
    506507void
    507508smbc_setTimeout(SMBCCTX *c, int timeout);
     509
     510
     511/**
     512 * Get the TCP port used to connect (0 means default).
     513 */
     514uint16_t
     515smbc_getPort(SMBCCTX *c);
     516
     517/**
     518 * Set the TCP port used to connect (0 means default).
     519 */
     520void
     521smbc_setPort(SMBCCTX *c, uint16_t port);
    508522
    509523
     
    744758smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b);
    745759
     760/** Get indication that the password supplied is the NT hash */
     761smbc_bool
     762smbc_getOptionUseNTHash(SMBCCTX *c);
     763
     764/** Set indication that the password supplied is the NT hash */
     765void
     766smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b);
     767
    746768
    747769
     
    851873void smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn);
    852874
     875typedef 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);
     881smbc_splice_fn smbc_getFunctionSplice(SMBCCTX *c);
     882void smbc_setFunctionSplice(SMBCCTX *c, smbc_splice_fn fn);
     883
    853884typedef int (*smbc_unlink_fn)(SMBCCTX *c,
    854885                              const char *fname);
     
    963994void smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn);
    964995
     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
     1005struct smbc_notify_callback_action {
     1006        uint32_t action;
     1007        const char *filename;
     1008};
     1009
     1010typedef int (*smbc_notify_callback_fn)(
     1011        const struct smbc_notify_callback_action *actions,
     1012        size_t num_actions, void *private_data);
     1013
     1014typedef 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);
     1018smbc_notify_fn smbc_getFunctionNotify(SMBCCTX *c);
     1019void smbc_setFunctionNotify(SMBCCTX *c, smbc_notify_fn fn);
    9651020
    9661021
     
    10741129 *
    10751130 * @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
    10771132 *                          could not be purged
    10781133 *                  - EBADF context == NULL
     
    11221177 *                  smbc_context_init() failure. Avoid this.
    11231178 *                  You'll have to call smbc_free_context() yourself
    1124  *                  on failure. 
     1179 *                  on failure.
    11251180 */
    11261181
     
    11311186 *
    11321187 * 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
    11351190 *                  authentication credentials.
    11361191 *
     
    11381193 *                  changed in smb.conf file. Allows caller to set
    11391194 *                  debugging if no smb.conf.
    1140  *   
     1195 *
    11411196 * @return          0 on success, < 0 on error with errno set:
    11421197 *                  - ENOMEM Out of memory
     
    11741229 * Open a file on an SMB server.
    11751230 *
    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
    11791234 *                  request opening  the  file  read-only,write-only
    11801235 *                  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
    11831238 *                  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.
    11871242 *                  O_TRUNC - If the file already exists it will be
    11881243 *                  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
    11931248 *                  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)
    11951250 *
    11961251 *                  Not currently use, but there for future use.
     
    12001255 * @return          Valid file handle, < 0 on error with errno set:
    12011256 *                  - 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
    12451258 *                  file, or smbc_init not called.
    12461259 *                  - EEXIST  pathname already exists and O_CREAT and
     
    12491262 *                  the access requested involved writing.
    12501263 *                  - 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
     1280int 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
    12531308 *                  not exist.
    12541309 *                  - ENODEV The requested share does not exist.
     
    12721327 *                  < 0 on error, with errno set:
    12731328 *                  - 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
    12751330 *                    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
    12771332 *                    unsuitable for reading, or no buffer passed or
    12781333 *                    smbc_init not called.
     
    12951350 * @return          Number of bytes written, < 0 on error with errno set:
    12961351 *                  - 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
    12981353 *                  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
    13001355 *                  unsuitable for reading, or no buffer passed or
    13011356 *                  smbc_init not called.
     
    13111366 *
    13121367 * @param fd        Open file handle from smbc_open() or smbc_creat()
    1313  * 
     1368 *
    13141369 * @param offset    Offset in bytes from whence
    1315  * 
     1370 *
    13161371 * @param whence    A location in the file:
    13171372 *                  - SEEK_SET The offset is set to offset bytes from
    13181373 *                  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
    13201375 *                  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
    13221377 *                  file plus offset bytes.
    13231378 *
    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
    13261381 *                  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
    13281383 *                  indicate the error:
    13291384 *                  - EBADF  Fildes is not an open file descriptor.
     
    13321387 *
    13331388 * @todo Are all the whence values really supported?
    1334  * 
     1389 *
    13351390 * @todo Are errno values complete and correct?
    13361391 */
     
    13581413 *
    13591414 * @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
    13621417 *                  of  the  directories in pathname did not allow
    13631418 *                  search (execute) permission
     
    13781433/**@ingroup directory
    13791434 * 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
    13821437 *                  directory to be moved
    1383  * 
     1438 *
    13841439 * @param nurl      The new smb url (destination url) of the file
    13851440 *                  or directory after the move.  Currently nurl must
     
    13891444 *                  - EISDIR nurl is an existing directory, but ourl is
    13901445 *                  not a directory.
    1391  *                  - EEXIST nurl is  a  non-empty directory, 
     1446 *                  - EEXIST nurl is  a  non-empty directory,
    13921447 *                  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
    13941449 *                  of the old, or, more generally, an  attempt was
    13951450 *                  made  to make a directory a subdirectory of itself
    13961451 *                  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,
    13991454 *                  ourl  is a directory, and newpath exists but is not
    14001455 *                  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
    14041459 *                  directories in ourl or nurl did not allow search
    14051460 *                  (execute) permission,  or ourl  was  a  directory
    14061461 *                  and did not allow write permission.
    1407  *                  - ENOENT A  directory component in ourl or nurl 
     1462 *                  - ENOENT A  directory component in ourl or nurl
    14081463 *                  does not exist.
    14091464 *                  - EXDEV Rename across shares not supported.
     
    14291484 *                  not parse, or was of incorrect form or smbc_init not
    14301485 *                  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.
    14341489 *                  - ENOTDIR name is not a directory.
    14351490 *                  - EPERM the workgroup could not be found.
     
    14581513 * Get multiple directory entries.
    14591514 *
    1460  * smbc_getdents() reads as many dirent structures from the an open 
     1515 * smbc_getdents() reads as many dirent structures from the an open
    14611516 * directory handle into a specified memory area as will fit.
    14621517 *
     
    14651520 * @param dirp      pointer to buffer that will receive the directory
    14661521 *                  entries.
    1467  * 
     1522 *
    14681523 * @param count     The size of the dirp buffer in bytes
    14691524 *
     
    15091564 * @return          The current location in the directory stream or -1
    15101565 *                  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
    15121567 *                  handle that allows the library to find the entry
    15131568 *                  later.
     
    15291584 *
    15301585 * @param fd        Valid directory as returned by smbc_opendir()
    1531  * 
     1586 *
    15321587 * @param offset    The offset (as returned by smbc_telldir). Can be
    15331588 *                  NULL, in which case we will rewind
     
    15521607 *
    15531608 * @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
    15551610 *                  permissions of the created file are (mode & ~umask).
    1556  * 
     1611 *
    15571612 * @return          0 on success, < 0 on error with errno set:
    15581613 *                  - EEXIST directory url already exists
     
    15721627/**@ingroup directory
    15731628 * Remove a directory.
    1574  * 
     1629 *
    15751630 * @param durl      The smb url of the directory to remove
    15761631 *
     
    15841639 *                  - ENOMEM Insufficient kernel memory was available.
    15851640 *
    1586  * @see             smbc_mkdir(), smbc_unlink() 
     1641 * @see             smbc_mkdir(), smbc_unlink()
    15871642 *
    15881643 * @todo Are errno values complete and correct?
     
    15901645int smbc_rmdir(const char *durl);
    15911646
     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
     1685int 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);
    15921688
    15931689/**@ingroup attribute
     
    15961692 * @param url       The smb url to get information for
    15971693 *
    1598  * @param st        pointer to a buffer that will be filled with 
     1694 * @param st        pointer to a buffer that will be filled with
    15991695 *                  standard Unix struct stat information.
    16001696 *
     
    16151711/**@ingroup attribute
    16161712 * Get file information via an file descriptor.
    1617  * 
     1713 *
    16181714 * @param fd        Open file handle from smbc_open() or smbc_creat()
    16191715 *
    1620  * @param st        pointer to a buffer that will be filled with 
     1716 * @param st        pointer to a buffer that will be filled with
    16211717 *                  standard Unix struct stat information.
    1622  * 
     1718 *
    16231719 * @return          0 on success, < 0 on error with errno set:
    16241720 *                  - EBADF  filedes is bad.
     
    16371733/**@ingroup attribute
    16381734 * Get file system information for a specified path.
    1639  * 
     1735 *
    16401736 * @param url       The smb url to get information for
    16411737 *
    1642  * @param st        pointer to a buffer that will be filled with 
     1738 * @param st        pointer to a buffer that will be filled with
    16431739 *                  standard Unix struct statvfs information.
    1644  * 
     1740 *
    16451741 * @return          0 on success, < 0 on error with errno set:
    16461742 *                  - EBADF  filedes is bad.
     
    16601756/**@ingroup attribute
    16611757 * Get file system information via an file descriptor.
    1662  * 
     1758 *
    16631759 * @param fd        Open file handle from smbc_open(), smbc_creat(),
    16641760 *                  or smbc_opendir()
    16651761 *
    1666  * @param st        pointer to a buffer that will be filled with 
     1762 * @param st        pointer to a buffer that will be filled with
    16671763 *                  standard Unix struct statvfs information.
    1668  * 
     1764 *
    16691765 * @return          0 on success, < 0 on error with errno set:
    16701766 *                  - EBADF  filedes is bad.
     
    16851781/**@ingroup attribute
    16861782 * Truncate a file given a file descriptor
    1687  * 
     1783 *
    16881784 * @param fd        Open file handle from smbc_open() or smbc_creat()
    16891785 *
    16901786 * @param size      size to truncate the file to
    1691  * 
     1787 *
    16921788 * @return          0 on success, < 0 on error with errno set:
    16931789 *                  - EBADF  filedes is bad.
     
    17091805 * @param url       The smb url of the file or directory to change
    17101806 *                  permissions of
    1711  * 
     1807 *
    17121808 * @param mode      The permissions to set:
    17131809 *                  - Put good explaination of permissions here!
     
    17711867 * @param url       The smb url of the file or directory to set extended
    17721868 *                  attributes for.
    1773  * 
     1869 *
    17741870 * @param name      The name of an attribute to be changed.  Names are of
    17751871 *                  one of the following forms:
     
    18811977 * @param url       The smb url of the file or directory to set extended
    18821978 *                  attributes for.
    1883  * 
     1979 *
    18841980 * @param name      The name of an attribute to be changed.  Names are of
    18851981 *                  one of the following forms:
     
    19882084 *                  previously returned by smbc_open(), to get extended
    19892085 *                  attributes for.
    1990  * 
     2086 *
    19912087 * @param name      The name of an attribute to be changed.  Names are of
    19922088 *                  one of the following forms:
     
    20932189 * @param url       The smb url of the file or directory to get extended
    20942190 *                  attributes for.
    2095  * 
     2191 *
    20962192 * @param name      The name of an attribute to be retrieved.  Names are of
    20972193 *                  one of the following forms:
     
    21292225 *                  required to hold the attribute value will be returned,
    21302226 *                  but nothing will be placed into the value buffer.
    2131  * 
     2227 *
    21322228 * @return          0 on success, < 0 on error with errno set:
    21332229 *                  - EINVAL  The client library is not properly initialized
     
    21582254 * @param url       The smb url of the file or directory to get extended
    21592255 *                  attributes for.
    2160  * 
     2256 *
    21612257 * @param name      The name of an attribute to be retrieved.  Names are of
    21622258 *                  one of the following forms:
     
    21942290 *                  required to hold the attribute value will be returned,
    21952291 *                  but nothing will be placed into the value buffer.
    2196  * 
     2292 *
    21972293 * @return          0 on success, < 0 on error with errno set:
    21982294 *                  - EINVAL  The client library is not properly initialized
     
    22212317 *                  previously returned by smbc_open(), to get extended
    22222318 *                  attributes for.
    2223  * 
     2319 *
    22242320 * @param name      The name of an attribute to be retrieved.  Names are of
    22252321 *                  one of the following forms:
     
    22572353 *                  required to hold the attribute value will be returned,
    22582354 *                  but nothing will be placed into the value buffer.
    2259  * 
     2355 *
    22602356 * @return          0 on success, < 0 on error with errno set:
    22612357 *                  - EINVAL  The client library is not properly initialized
     
    22842380 * @param url       The smb url of the file or directory to remove the extended
    22852381 *                  attributes for.
    2286  * 
     2382 *
    22872383 * @param name      The name of an attribute to be removed.  Names are of
    22882384 *                  one of the following forms:
     
    23342430 * @param url       The smb url of the file or directory to remove the extended
    23352431 *                  attributes for.
    2336  * 
     2432 *
    23372433 * @param name      The name of an attribute to be removed.  Names are of
    23382434 *                  one of the following forms:
     
    23822478 *                  previously returned by smbc_open(), to get extended
    23832479 *                  attributes for.
    2384  * 
     2480 *
    23852481 * @param name      The name of an attribute to be removed.  Names are of
    23862482 *                  one of the following forms:
     
    24372533 *                  required to hold all of the attribute names will be
    24382534 *                  returned, but nothing will be placed into the list buffer.
    2439  * 
     2535 *
    24402536 * @return          0 on success, < 0 on error with errno set:
    24412537 *                  - EINVAL The client library is not properly initialized
     
    24752571 *                  required to hold all of the attribute names will be
    24762572 *                  returned, but nothing will be placed into the list buffer.
    2477  * 
     2573 *
    24782574 * @return          0 on success, < 0 on error with errno set:
    24792575 *                  - EINVAL The client library is not properly initialized
     
    25012597 *                  previously returned by smbc_open(), to get extended
    25022598 *                  attributes for.
    2503  * 
     2599 *
    25042600 * @param list      A pointer to a buffer in which the list of attributes for
    25052601 *                  the specified file or directory will be placed (unless
     
    25102606 *                  required to hold all of the attribute names will be
    25112607 *                  returned, but nothing will be placed into the list buffer.
    2512  * 
     2608 *
    25132609 * @return          0 on success, < 0 on error with errno set:
    25142610 *                  - EINVAL The client library is not properly initialized
     
    25322628/**@ingroup print
    25332629 * Print a file given the name in fname. It would be a URL ...
    2534  * 
     2630 *
    25352631 * @param fname     The URL of a file on a remote SMB server that the
    25362632 *                  caller wants printed
     
    25382634 * @param printq    The URL of the print share to print the file to.
    25392635 *
    2540  * @return          0 on success, < 0 on error with errno set:         
     2636 * @return          0 on success, < 0 on error with errno set:
    25412637 *
    25422638 *                  - EINVAL fname or printq was NULL or smbc_init not
     
    25442640 *                  and errors returned by smbc_open
    25452641 *
    2546  */                                     
     2642 */
    25472643int smbc_print_file(const char *fname, const char *printq);
    25482644
     
    25632659
    25642660/**@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
    25662662 *
    25672663 * @param purl      The url of the print share to list the jobs of
    2568  * 
     2664 *
    25692665 * @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:
    25722668 *                  - EINVAL fname was NULL or smbc_init not called
    25732669 *                  - EACCES ???
     
    25762672
    25772673/**@ingroup print
    2578  * Delete a print job 
     2674 * Delete a print job
    25792675 *
    25802676 * @param purl      Url of the print share
     
    25822678 * @param id        The id of the job to delete
    25832679 *
    2584  * @return          0 on success, < 0 on error with errno set: 
     2680 * @return          0 on success, < 0 on error with errno set:
    25852681 *                  - EINVAL fname was NULL or smbc_init not called
    25862682 *
     
    26112707 *                  string should be placed.  This may be a pointer to the
    26122708 *                  same buffer as src_segment.
    2613  * 
     2709 *
    26142710 * @param src       A pointer to the buffer containing the URL to be decoded.
    26152711 *                  Any %xx sequences herein are converted to their single
     
    26192715 * @param max_dest_len
    26202716 *                  The size of the buffer pointed to by dest_segment.
    2621  * 
     2717 *
    26222718 * @return          The number of % sequences which could not be converted
    26232719 *                  due to lack of two following hexadecimal digits.
     
    26402736 *                  string should be placed.  Unlike smbc_urldecode(), this
    26412737 *                  must be a buffer unique from src.
    2642  * 
     2738 *
    26432739 * @param src       A pointer to the buffer containing the string to be encoded.
    26442740 *                  Any character not specifically allowed in a URL is converted
     
    26472743 * @param max_dest_len
    26482744 *                  The size of the buffer pointed to by dest_segment.
    2649  * 
     2745 *
    26502746 * @returns         The remaining buffer length.
    26512747 */
     
    27042800 * Wrapper around smbc_set_credentials.
    27052801 * 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
    27072803 * in libsmbclient
    27082804 */
     
    28072903                          int lock_type,
    28082904                          const char *location),
    2809    
     2905
    28102906        /* Thread local storage. */
    28112907        int (*create_tls)(const char *keyname,
     
    28252921/**
    28262922 * @ingroup structure
    2827  * Structure that contains a client context information 
     2923 * Structure that contains a client context information
    28282924 * This structure is known as SMBCCTX
    28292925 *
     
    28472943         */
    28482944        int     debug DEPRECATED_SMBC_INTERFACE;
    2849        
     2945
    28502946        /**
    28512947         * netbios name used for making connections
     
    28892985         * Use smbc_getFunction*() and smbc_setFunction*(), e.g.
    28902986         * smbc_getFunctionOpen(), smbc_setFunctionUnlink(), etc.
    2891          */ 
     2987         */
    28922988        smbc_open_fn                    open DEPRECATED_SMBC_INTERFACE;
    28932989        smbc_creat_fn                   creat DEPRECATED_SMBC_INTERFACE;
     
    29423038                 */
    29433039                smbc_get_auth_data_fn auth_fn DEPRECATED_SMBC_INTERFACE;
    2944                
     3040
    29453041                /**
    29463042                 * check if a server is still good
     
    29703066
    29713067                /**
    2972                  * server cache addition 
     3068                 * server cache addition
    29733069                 *
    29743070                 * DEPRECATED:
     
    29793075
    29803076                /**
    2981                  * server cache lookup 
     3077                 * server cache lookup
    29823078                 *
    29833079                 * DEPRECATED:
     
    29953091                 */
    29963092                smbc_remove_cached_srv_fn remove_cached_srv_fn DEPRECATED_SMBC_INTERFACE;
    2997                
     3093
    29983094                /**
    29993095                 * server cache purging, try to remove all cached servers
     
    30173113        /*
    30183114         * Very old configuration options.
    3019          * 
     3115         *
    30203116         * DEPRECATED:
    30213117         * Use one of the following functions instead:
     
    30283124         */
    30293125        int flags DEPRECATED_SMBC_INTERFACE;
    3030        
     3126
    30313127        /**
    30323128         * user options selections that apply to this session
     
    30433139                int one_share_per_server DEPRECATED_SMBC_INTERFACE;
    30443140        } options DEPRECATED_SMBC_INTERFACE;
    3045        
     3141
    30463142        /** INTERNAL DATA
    30473143         * do _NOT_ touch this from your program !
Note: See TracChangeset for help on using the changeset viewer.