1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

Implement two printing related functions and start the remaining two.

(This used to be commit c19559a286)
This commit is contained in:
Richard Sharpe 2001-02-05 13:02:20 +00:00
parent 2fd7e6e6a0
commit ca03ad79cf
2 changed files with 65 additions and 2 deletions

View File

@ -195,7 +195,7 @@ int smbc_lseekdir(int fd, off_t offset, int whence);
* Print a file given the name in fname. It would be a URL ...
*/
int smbc_print_file(const char *fname);
int smbc_print_file(const char *fname, const char *printq);
/*
* Open a print file that can be written to by other calls. This simply
@ -215,6 +215,6 @@ int smbc_list_print_jobs(const char *fname, void (*fn)(struct print_job_info *))
* Delete a print job
*/
int smbc_unlink_print_job(int id);
int smbc_unlink_print_job(const char *fname, int id);
#endif

View File

@ -2138,6 +2138,20 @@ int smbc_fstatdir(int fd, struct stat *st)
return 0;
}
/*
* Routine to print a file on a remote server ...
*
* We open the file, which we assume to be on a remote server, and then
* copy it to a print file on the share specified by printq.
*/
int smbc_print_file(const char *fname, const char *printq)
{
}
/*
@ -2189,3 +2203,52 @@ int smbc_list_print_jobs(const char *fname, void (*fn)(struct print_job_info *))
}
/*
* Delete a print job from a remote printer share
*/
int smbc_unlink_print_job(const char *fname, int id)
{
struct smbc_server *srv;
fstring server, share, user, password;
pstring path;
if (!smbc_initialized) {
errno = EUCLEAN;
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);
srv = smbc_server(server, share, lp_workgroup(), user, password);
if (!srv) {
return -1; /* errno set by smbc_server */
}
if (cli_printjob_del(&srv->cli, id) < 0) {
errno = smbc_errno(&srv->cli);
return -1;
}
return 0;
}