Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

int smbc_unlink_print_job ( const char *  purl,
int  id 
)

Delete a print job

Parameters:
purl Url of the print share
id The id of the job to delete
Returns:
0 on success, < 0 on error with errno set:
  • EINVAL fname was NULL or smbc_init not called
Todo:
what errno values are possible here?

Definition at line 2563 of file libsmbclient.c.

{
      struct smbc_server *srv;
      fstring server, share, user, password, workgroup;
      pstring path;
      int err;

      if (!smbc_initialized) {

            errno = EINVAL;
            return -1;

      }

      if (!fname) {

            errno = EINVAL;
            return -1;

      }
  
      DEBUG(4, ("smbc_unlink_print_job(%s)\n", fname));

      smbc_parse_path(fname, server, share, path, user, password); /*FIXME, errors*/

      if (user[0] == (char)0) pstrcpy(user, smbc_user);

      pstrcpy(workgroup, lp_workgroup());

      srv = smbc_server(server, share, workgroup, user, password);

      if (!srv) {

            return -1;  /* errno set by smbc_server */

      }

      if ((err = cli_printjob_del(&srv->cli, id)) != 0) {

            if (err < 0)
                  errno = smbc_errno(&srv->cli);
            else if (err == ERRnosuchprintjob)
                  errno = EINVAL;
            return -1;

      }

      return 0;

}


Generated by  Doxygen 1.6.0   Back to index