summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-02-05 13:02:20 +0000
committerRichard Sharpe <sharpe@samba.org>2001-02-05 13:02:20 +0000
commitca03ad79cfaad48fb20426dfb98a30740fe80a0d (patch)
tree10350d4791a0d329ff7b9351f7685046c6696440 /source3
parent2fd7e6e6a0d1b22d841d49c4fc0868c0be471475 (diff)
downloadsamba-ca03ad79cfaad48fb20426dfb98a30740fe80a0d.tar.gz
samba-ca03ad79cfaad48fb20426dfb98a30740fe80a0d.tar.bz2
samba-ca03ad79cfaad48fb20426dfb98a30740fe80a0d.zip
Implement two printing related functions and start the remaining two.
(This used to be commit c19559a286c3ec6dedefbd2423aa5738edd9ba41)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/libsmbclient.h4
-rw-r--r--source3/libsmb/libsmbclient.c63
2 files changed, 65 insertions, 2 deletions
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index a02c0e5317..5469966cf8 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -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
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index feb0baaee3..68dbe666f7 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -2141,6 +2141,20 @@ int smbc_fstatdir(int fd, struct stat *st)
}
/*
+ * 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)
+{
+
+
+
+}
+
+/*
* Routine to list print jobs on a printer share ...
*/
@@ -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;
+
+}
+