home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "UUdlldeclares"
- '
- ' * Message Types
- '
- Public Const UUMSG_MESSAGE = 0 ' just a message, nothing important
- Public Const UUMSG_NOTE = 1 ' something that should be noticed
- Public Const UUMSG_WARNING = 2 ' important msg, processing continues
- Public Const UUMSG_ERROR = 3 ' processing has been terminated
- Public Const UUMSG_FATAL = 4 ' decoder cannot process further requests
- Public Const UUMSG_PANIC = 5 ' recovery impossible, app must terminate
-
- '
- ' * Return Values
- '
- Public Const UURET_OK = 0 ' everything went fine
- Public Const UURET_IOERR = 1 ' I/O Error - examine errno
- Public Const UURET_NOMEM = 2 ' not enough memory
- Public Const UURET_ILLVAL = 3 ' illegal value for operation
- Public Const UURET_NODATA = 4 ' decoder didn't find any data
- Public Const UURET_NOEND = 5 ' encoded data wasn't ended properly
- Public Const UURET_UNSUP = 6 ' unsupported function (encoding)
- Public Const UURET_EXISTS = 7 ' file exists (decoding)
- Public Const UURET_CONT = 8 ' continue -- special from ScanPart
- Public Const UURET_CANCEL = 9 ' operation cancelled
-
- '
- ' * File states, may be OR'ed
- '
- Public Const UUFILE_READ = 0 ' Read in, but not further processed
- Public Const UUFILE_MISPART = 1 ' Missing Part(s) detected
- Public Const UUFILE_NOBEGIN = 2 ' No 'begin' found
- Public Const UUFILE_NOEND = 4 ' No 'end' found
- Public Const UUFILE_NODATA = 8 ' File does not contain valid uudata
- Public Const UUFILE_OK = 16 ' All Parts found, ready to decode
- Public Const UUFILE_ERROR = 32 ' Error while decoding
- Public Const UUFILE_DECODED = 64 ' Successfully decoded
- Public Const UUFILE_TMPFILE = 128 ' Temporary decoded file exists
-
- '
- ' * Encoding Types
- '
- Public Const UU_ENCODED = 1 ' UUencoded data
- Public Const B64ENCODED = 2 ' Mime-Base64 data
- Public Const XX_ENCODED = 3 ' XXencoded data
- Public Const BH_ENCODED = 4 ' Binhex encoded
- Public Const PT_ENCODED = 5 ' Plain-Text encoded (MIME)
- Public Const QP_ENCODED = 6 ' Quoted-Printable (MIME)
-
- '
- ' * Option indices for GetOption / SetOption
- '
- Public Const UUOPT_VERSION = 0 ' version number MAJOR.MINORplPATCH (ro)
- Public Const UUOPT_FAST = 1 ' assumes only one part per file
- Public Const UUOPT_DUMBNESS = 2 ' switch off the program's intelligence
- Public Const UUOPT_BRACKPOL = 3 ' give numbers in [] higher precendence
- Public Const UUOPT_VERBOSE = 4 ' generate informative messages
- Public Const UUOPT_DESPERATE = 5 ' try to decode incomplete files
- Public Const UUOPT_IGNREPLY = 6 ' ignore RE:plies (off by default)
- Public Const UUOPT_OVERWRITE = 7 ' whether it's OK to overwrite ex. files
- Public Const UUOPT_SAVEPATH = 8 ' prefix to save-files on disk
- Public Const UUOPT_IGNMODE = 9 ' ignore the original file mode
- Public Const UUOPT_DEBUG = 10 ' print messages with FILE/LINE info
- Public Const UUOPT_ERRNO = 14 ' get last error code for UURET_IOERR (ro)
- Public Const UUOPT_PROGRESS = 15 ' retrieve progress information
- Public Const UUOPT_USETEXT = 16 ' handle text messages
- Public Const UUOPT_PREAMB = 17 ' handle Mime preambles/epilogues
- Public Const UUOPT_TINYB64 = 18 ' detect short B64 outside of Mime
- Public Const UUOPT_ENCEXT = 19 ' extension for single-part encoded files
-
- '
- ' * Code for the "action" in the progress structure
- '
- Public Const UUACT_IDLE = 0 ' we don't do anything
- Public Const UUACT_SCANNING = 1 ' scanning an input file
- Public Const UUACT_DECODING = 2 ' decoding into a temp file
- Public Const UUACT_COPYING = 3 ' copying temp to target
- Public Const UUACT_ENCODING = 4 ' encoding a file
-
-
- '
- ' UUVBEncode control constants (see below)
- '
- Public Const UUVBE_NONE = 0 ' No MIME headers (use standard headers)
- Public Const UUVBE_SIMPLE = 1 ' Simple MIME (no addressing)
- Public Const UUVBE_MAIL = 2 ' MIME E-mail format
- Public Const UUVBE_NEWS = 3 ' MIME News format
-
-
- '
- ' UUVBListData control items (see uudeview.h)
- '
- Public Const UUVBLD_STATE = 0 ' uulist.state
- Public Const UUVBLD_MODE = 1 ' uulist.mode
- Public Const UUVBLD_BEGIN = 2 ' uulist.begin
- Public Const UUVBLD_END = 3 ' uulist.end
- Public Const UUVBLD_UUDET = 4 ' uulist.uudet
- Public Const UUVBLD_FLAGS = 5 ' uulist.flags
- Public Const UUVBLD_SIZE = 6 ' uulist.size
- Public Const UUVBLD_FILEN = 7 ' uulist.filename
- Public Const UUVBLD_SUBF = 8 ' uulist.subfname
- Public Const UUVBLD_MIMEID = 9 ' uulist.mimeid
- Public Const UUVBLD_MIMETYPE = 10 ' uulist.mimetype
- Public Const UUVBLD_BINFILE = 11 ' uulist.binfile
- Public Const UUVBLD_HAVEPART = 12 ' uulist.haveparts[subscr]
- Public Const UUVBLD_MISSPART = 13 ' uulist.msparts[subscr]
- Public Const UUVBLD_UFPART = 14 ' uulist.thisfile[subscr].partno
- Public Const UUVBLD_UFRSUBJ = 15 ' uulist.thisfile[subscr].data.subject
- Public Const UUVBLD_UFRORG = 16 ' uulist.thisfile[subscr].data.origin
- Public Const UUVBLD_UFRSFN = 17 ' uulist.thisfile[subscr].data.sfname
-
-
- '
- ' -----------------------
- ' 32-Bit DLL Declarations
- ' -----------------------
- '
-
- '
- ' Initialize for decoding or encoding. Call before EVERY batch!
- '
- Public Declare Sub UUVBInit Lib "uudeview.dll" ()
-
- '
- ' Retrieve the last error or information message from the library. Retrieving
- ' a message clears the message buffer.
- '
- ' message = String to accept message
- ' severity = Severity level for error messages
- '
- ' Return = TRUE if there was a message to retrieve.
- '
- Public Declare Function UUVBMessage Lib "uudeview.dll" _
- (ByRef message As String, _
- ByRef severity As Integer) As Boolean
-
- '
- ' Walk the list of files found during the UULoadFile operations. Returns
- ' status information, etc.
- '
- ' ptr = Pointer to list item (opaque long integer)
- ' filename = Returns name of file that will be decoded
- ' state = Returns informational message about the item
- ' flags = Returns Status of this item (see File Status Mask values)
- ' nextitem = Pointer to next list item (=0 if no more items)
- '
- ' Return = TRUE if there are items in the list after this item
- '
- Public Declare Function UUVBListWalk Lib "uudeview.dll" _
- (ByVal ptr As Long, _
- ByRef filename As String, _
- ByRef state As String, _
- ByRef flags As Integer, _
- ByRef nextitem As Long) As Boolean
-
- '
- ' Filter a filename to ensure that it is acceptable to Win32
- '
- ' filename = Filename to filter
- '
- ' Return = Filtered filename
- '
- Public Declare Function UUVBFileFilter Lib "uudeview.dll" _
- (ByVal filename As String) As String
-
- '
- ' Deletes an item from the decode list
- '
- ' item = Pointer to item to delete
- '
- ' Return = TRUE if the delete worked
- '
- Public Declare Function UUVBListDelete Lib "uudeview.dll" _
- (ByVal item As Long) As Boolean
-
- '
- ' Gets pointer to first item in the decode list
- '
- ' firstitem = Returns pointer to first decode list item
- '
- ' Return = TRUE if there are items in the list
- '
- Public Declare Function UUVBListFirst Lib "uudeview.dll" _
- (ByRef firstitem As Long) As Boolean
-
- '
- ' Gets info (text ahead of encoded data) for an item in the decode list
- '
- ' item = Pointer to list item to examine
- ' info = Returns info string up to 16K
- '
- ' Return = UURET_OK or error code from list
- '
- Public Declare Function UUVBGetInfo Lib "uudeview.dll" _
- (ByVal item As Long, _
- ByRef info As String) As Integer
-
- '
- ' Decodes a file from the list and writes it to specified name
- '
- ' ptr = Pointer to decode list item to process
- ' flags = Returns new status bits following decode
- ' outfilename = Output name for decoded item
- ' uuret = Returns UURET_OK or error code returned by decode function
- ' mvret = Returns 0 or Win32 error code caused by file move operation
- '
- ' Return = TRUE if everything worked OK
- '
- Public Declare Function UUVBDecode Lib "uudeview.dll" _
- (ByVal ptr As Long, ByRef flags As Integer, _
- ByVal outfilename As String, _
- ByRef uuret As Long, ByRef mvret As Long) As Boolean
-
- '
- ' Get an option (see main library documentation for details)
- '
- ' optno = Number of option to read (see UUOPT_ list)
- ' value = Returns value for integer options
- ' stringval = Returns value for string options
- '
- ' Return = TRUE if option value was retrieved
- '
- ' Note that this is UU->VB<-GetOption, not UUGetOption!
- '
- Public Declare Function UUVBGetOption Lib "uudeview.dll" _
- (ByVal optno As Long, ByRef value As Long, _
- ByRef stringval As String) As Boolean
-
- '
- ' Get the current library version, including the build date
- '
- ' Return = DLL patch level and build date
- '
- Public Declare Function UUVBLibVersion Lib "uudeview.dll" _
- () As String
-
- '
- ' Encode a binary file, more flexible version
- '
- ' inputfilename = Name of binary file to encode
- ' outputfilename = Name of disk file to encode to
- ' nameinfile = Name to place in file (filename to be used when file is decoded)
- ' encoding = Type of encoding to use (??_ENCODED list)
- ' linesperfile = Sets maximum number of lines in each output file (0 = create single file)
- ' MimeHeaders = Enables MIME-style headers (see UUVBE_* constants)
- ' dest = E-mail address of recipient or Newsgroup list
- ' from = Name and E-Mail address of sender
- ' subject = Subject Line for message
- '
- ' Return = TRUE if the operation completed successfully
- '
- Public Declare Function UUVBEncode Lib "uudeview.dll" _
- (ByVal inputfilename As String, _
- ByVal outputfilename As String, _
- ByVal nameinfile As String, _
- ByVal encoding As Long, _
- ByVal linesperfile As Long, _
- ByVal MimeHeaders As Integer, _
- ByVal dest As String, _
- ByVal from As String, _
- ByVal subject As String) As Boolean
-
- '
- ' Read information from the File List
- '
- ' ptr = Item to examine
- ' itemno = Which piece of information to retrieve
- ' subscript = Subscript to be used with arrays and lists
- ' retvar = Receives retrieved information
- '
- ' Return = TRUE if the information was retrieved successfully
- '
- Public Declare Function UUVBListData Lib "uudeview.dll" _
- (ByVal ptr As Long, _
- ByVal itemno As Integer, _
- ByVal subscript As Integer, _
- ByRef retvar As Variant) As Boolean
-
- '
- ' Clean up after an batch is complete
- '
- Public Declare Sub UUVBShutdown Lib "uudeview.dll" ()
-
- '
- ' ------------------------------------
- '
- ' UUDeview Library Functions
- '
- ' ------------------------------------
- '
-
- ' First-time setup
- Public Declare Function UUInitialize Lib "uudeview.dll" _
- () As Integer
-
- '
- ' Retrieve options
- '
- ' option_no = Option to retrieve
- ' int_return = Integer Return buffer
- ' string_return = String Return buffer
- ' string_return_len = Length of String Return buffer
- '
- ' Return = Integer option value, 0 for strings, -1 for error
- '
- Public Declare Function UUGetOption Lib "uudeview.dll" _
- (ByVal option_no As Long, _
- ByRef int_return As Long, _
- ByVal string_return As String, _
- ByVal string_return_len As Long) As Long
-
-
- '
- ' Set options
- '
- ' option_no = Option to set
- ' int_value = Value for integer options
- ' string_value = Value for string options
- '
- ' Return = UURET_ILLVAL for illegal option, UURET_OK otherwise
- '
- Public Declare Function UUSetOption Lib "uudeview.dll" _
- (ByVal option_no As Long, _
- ByVal int_value As Long, _
- ByVal string_value As String) As Long
-
-
- '
- ' Converts a UU error code to a string
- '
- ' code = Code to convert
- ' Return = Error string
- '
- Public Declare Function UUstrerror Lib "uudeview.dll" _
- (ByVal code As Long) As Long
-
-
- '
- ' Sets a function that is called when the UU library wants to send
- ' a message to the caller
- '
- ' opaque = Any pointer; will be passed to callback
- ' callback = C function pointer to callback [int (*)]
- '
- ' Return = UURET_OK
- '
- Public Declare Function UUSetMsgCallback Lib "uudeview.dll" _
- (ByVal opaque As Long, ByVal callback As Long) As Long
-
-
- '
- ' Sets a function that will be called periodically during the
- ' decoding process
- '
- ' opaque = Any pointer; will be passed to callback
- ' callback = C function pointer to callback [int (*)]
- ' interval = Number of milliseconds between calls
- '
- ' Return = UURET_OK
- '
- Public Declare Function UUSetBusyCallback Lib "uudeview.dll" _
- (ByVal opaque As Long, ByVal callback As Long, _
- ByVal interval As Long) As Long
-
-
- '
- ' Set a function that will be called before the UU library attempts to
- ' read each file.
- '
- ' opaque = Any pointer; will be passed to callback
- ' callback = C function pointer to callback [int (*)]
- '
- ' Return = UURET_OK
- '
- Public Declare Function UUSetFileCallback Lib "uudeview.dll" _
- (ByVal opaque As Long, ByVal callback As Long) As Long
-
-
- '
- ' Set a function that will receive each decoded filename before the
- ' file is opened. Filename can be altered to suit local system limitations.
- '
- ' opaque = Any pointer; will be passed to callback
- ' callback = C function pointer to callback [int (*)]
- '
- ' Return = UURET_OK
- '
- Public Declare Function UUSetFNameFilter Lib "uudeview.dll" _
- (ByVal opaque As Long, ByVal filter As Long) As Long
-
-
- '
- ' Run the current filename filter on a filename
- '
- ' filename = Filename to filter
- '
- ' Return = filtered filename
- '
- Public Declare Function UUFNameFilter Lib "uudeview.dll" _
- (ByVal filename As String) As Long
-
-
- '
- ' Return a pointer to the nth item in the File List
- '
- ' n = Item to retrieve
- '
- ' Return = Pointer to the item or NULL if no such item [uulist *]
- '
- Public Declare Function UUGetFileListItem Lib "uudeview.dll" _
- (ByVal n As Integer) As Long
-
- '
- ' The first part of the decoding process. Each file passed to this function
- ' is parsed. If any decodable files are found, they will be added to the
- ' global File List.
- '
- ' filename = File to load
- ' fileid = Identifying information about file (or NULL if none)
- ' deflag = Delete file after decoding (or on cleanup)
- '
- ' Returns UURET_OK or error code
- '
- Public Declare Function UULoadFile Lib "uudeview.dll" _
- (ByVal filename As String, _
- ByVal fileid As String, _
- ByVal delflag As Long) As Long
-
-
- '
- ' Changes the planned output filename of a decodable file on the
- ' File List
- '
- ' fl_item = File List Item to alter [uulist *]
- ' newname = New output filename
- '
- ' Return = UURET_OK or error code
- '
- Public Declare Function UURenameFile Lib "uudeview.dll" _
- (ByVal fl_item As Long, _
- ByVal newname As String) As Long
-
-
- '
- ' Decode a file in the File List to a temporary file
- '
- ' fl_item = Item to decode [uulist *]
- '
- ' Return = UURET_OK or error code
- '
- Public Declare Function UUDecodeToTemp Lib "uudeview.dll" _
- (ByVal fl_item As Long) As Long
-
- '
- ' Remove the temporary file created by UUDecodeToTemp
- '
- ' fl_item = Item to remove temporary file from [uulist *]
- '
- ' Return = UURET_OK or error code
- '
- Public Declare Function UURemoveTemp Lib "uudeview.dll" _
- (ByVal fl_item As Long) As Long
-
-
- '
- ' Decodes a file in the File List to a temporary file,
- ' then moves it to a destination. If the "save path" has been
- ' set in the Options, the destination file will be created using
- ' that path
- '
- ' fl_item = Item to decode [uulist *]
- ' dest = Destination filename
- '
- ' Return = UURET_OK or error code
- '
- Public Declare Function UUDecodeFile Lib "uudeview.dll" _
- (ByVal fl_item As Long, _
- ByVal dest As String) As Long
-
-
- '
- ' Retrieve information about a file in the File List. This may include
- ' news headers, the "zeroth" part of a multipart file, etc.
- ' The callback function is sent lines of information until none remains
- ' or until it returns a non-zero value.
- '
- ' fl_item = Item to examine [uulist *]
- ' opaque = Any pointer; will be passed to callback function
- ' callback = C Function Pointer (gets Info lines)
- '
- ' Return = UURET_OK or error code
- '
- Public Declare Function UUInfoFile Lib "uudeview.dll" _
- (ByVal fl_item As Long, _
- ByVal opaque As Long, _
- ByVal callback As Long) As Long
-
-
- '
- ' Delete the File List and clear the Save Path for another
- ' decoding operation
- '
- ' Return = UURET_OK
- '
- Public Declare Function UUCleanUp Lib "uudeview.dll" () As Long
-
-
- '
- ' Encode a binary file to a stream in one piece using MIME multipart
- ' headers
- '
- ' outfile = Output stream [FILE *]
- ' infile = Input stream (NULL means open infname) [FILE *]
- ' infname = Input filename (if not stream)
- ' encoding = Encoding type
- ' outfname = Filename to encode "as" if not the same is infname
- ' mimetype = MIME content type
- ' filemode = UNIX file mode (==> 0)
- '
- ' Return = UURET_OK or otherwise
- '
- Public Declare Function UUEncodeMulti Lib "uudeview.dll" _
- (ByVal outfile As Long, _
- ByVal infile As Long, _
- ByVal infname As String, _
- ByVal encoding As Long, _
- ByVal outfname As String, _
- ByVal mimetype As String, _
- ByVal filemode As Long) As Long
-
-
- '
- ' Encode a binary file to a stream in pieces with headers
- '
- ' outfile = Output stream [FILE *]
- ' infile = Input stream (NULL means open infname) [FILE *]
- ' infname = Input filename (if not stream)
- ' encoding = Encoding type
- ' outfname = Filename to encode "as" if not the same is infname
- ' mimetype = MIME content type
- ' filemode = UNIX file mode (==> 0)
- ' partno = Segment number
- ' linperfile = Number of lines per file
- '
- ' Return = UURET_OK or otherwise
- '
- Public Declare Function UUEncodePartial Lib "uudeview.dll" _
- (ByVal outfile As Long, _
- ByVal infile As Long, ByVal infname As String, _
- ByVal encoding As Long, ByVal outfname As String, _
- ByVal mimetype As String, ByVal filemode As Long, _
- ByVal partno As Long, _
- ByVal linperfile As Long) As Long
-
-
- '
- ' Encode a binary file to a stream -- no headers
- '
- ' outfile = Output stream [FILE *]
- ' infile = Input stream (NULL means open infname) [FILE *]
- ' infname = Input filename (if not stream)
- ' encoding = Encoding type
- ' outfname = Filename to encode "as" if not the same is infname
- ' filemode = UNIX file mode (==> 0)
- '
- ' Return = UURET_OK or otherwise
- '
- Public Declare Function UUEncodeToStream Lib "uudeview.dll" _
- (ByVal outfile As Long, _
- ByVal infile As Long, _
- ByVal infname As String, _
- ByVal encoding As Long, _
- ByVal outfname As String, _
- ByVal filemode As Long) As Long
-
-
- '
- ' Encode straight to a disk file(s), no headers
- '
- ' infile = Input stream (NULL means open infname) [FILE *]
- ' infname = Input filename (if not stream)
- ' encoding = Encoding type
- ' outfname = Filename to encode "as" if not the same is infname
- ' diskname = Name of output file
- ' linperfile = Number of lines per file (<= 0 means one file)
- '
- ' Return = UURET_OK or other wise
- '
- Public Declare Function UUEncodeToFile Lib "uudeview.dll" _
- (ByVal infile As Long, _
- ByVal infname As String, _
- ByVal encoding As Long, _
- ByVal outfname As String, _
- ByVal diskname As String, _
- ByVal linperfile As Long) As Long
-
-
- '
- ' Encode to a single file using Mail/News style headers
- '
- ' outfile = Output stream [FILE *]
- ' infile = Input stream (NULL means open infname) [FILE *]
- ' infname = Input file (if not stream)
- ' encoding = Encoding type
- ' outfname = Filename to encode "as" if not the same is infname
- ' filemode = UNIX file mode (==> 0)
- ' destination = Destination e-mail address or newsgroup
- ' from = Sender's name/email
- ' subject = Subject line
- ' isemail = NZ means e-mail; Z means newsgroup
- '
- ' Return = UURET_OK or otherwise
- '
- Public Declare Function UUE_PrepSingle Lib "uudeview.dll" _
- (ByVal outfile As Long, _
- ByVal infile As Long, ByVal infname As String, _
- ByVal encoding As Long, ByVal outfname As String, _
- ByVal filemode As Long, ByVal destination As String, _
- ByVal from As String, ByVal subject As String, _
- ByVal isemail As Long) As Long
-
-
-
- '
- ' Encode to multiple files using Mail/News style headers
- '
- ' outfile = Output stream [FILE *]
- ' infile = Input stream (NULL means open infname) [FILE *]
- ' infname = Input file (if not stream)
- ' encoding = Encoding type
- ' outfname = Filename to encode "as" if not the same is infname
- ' filemode = UNIX file mode (==> 0)
- ' partno = Segment number
- ' linperfile = Lines per segment
- ' filesize = Size of input file
- ' destination = Destination e-mail address or newsgroup
- ' from = Sender's name/email
- ' subject = Subject line
- ' isemail = NZ means e-mail; Z means newsgroup
- '
- ' Return = UURET_OK or otherwise
- '
- Public Declare Function UUE_PrepPartial Lib "uudeview.dll" _
- (ByVal outfile As Long, _
- ByVal infile As Long, ByVal infname As String, _
- ByVal encoding As Long, ByVal outfname As String, _
- ByVal filemode As Long, ByVal partno As Long, _
- ByVal linperfile As Long, ByVal filesize As Long, _
- ByVal destination As String, ByVal from As String, _
- ByVal subject As String, _
- ByVal isemail As Long) As Long
-