+/* --- @pixie_set@ --- *
+ *
+ * Arguments: @int fd@ = pixie file descriptor
+ * @const char *tag@ = pointer to tag string
+ * @const char *phrase@ = pointer to passphrase string
+ *
+ * Returns: ---
+ *
+ * Use: Sends a passphrase to the passphrase pixie.
+ */
+
+void pixie_set(int fd, const char *tag, const char *phrase)
+{
+ dstr d = DSTR_INIT;
+ char buf[16];
+ size_t sz = strlen(phrase);
+ char nl = '\n';
+ char *p, *q;
+
+ /* --- Send the request --- *
+ *
+ * I didn't want to copy it out of the caller's buffer. @writev@ may
+ * produce a copy, too, so I didn't do that either.
+ */
+
+ dstr_putf(&d, "SET %s -- ", tag);
+ write(fd, d.buf, d.len);
+ write(fd, phrase, sz);
+ write(fd, &nl, 1);
+ dstr_destroy(&d);
+
+ /* --- Pick up the pieces --- */
+
+again:
+ pixie_fdline(fd, buf, sizeof(buf));
+ p = buf;
+ if ((q = str_getword(&p)) != 0 && strcmp(q, "INFO") == 0)
+ goto again;
+}
+