home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / dos / setcomment.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  2.2 KB  |  89 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: setcomment.c,v 1.4 1996/10/24 15:50:37 aros Exp $
  4.     $Log: setcomment.c,v $
  5.     Revision 1.4  1996/10/24 15:50:37  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.3  1996/09/21 14:14:23  digulla
  9.     Hand DOSBase to DoName()
  10.  
  11.     Revision 1.2  1996/09/13 17:50:09  digulla
  12.     Use IPTR
  13.  
  14.     Revision 1.1  1996/09/11 12:54:47  digulla
  15.     A couple of new DOS functions from M. Fleischer
  16.  
  17.     Desc:
  18.     Lang: english
  19. */
  20. #include <clib/exec_protos.h>
  21. #include <dos/dosextens.h>
  22. #include <dos/filesystem.h>
  23. #include <clib/dos_protos.h>
  24. #include "dos_intern.h"
  25.  
  26. /*****************************************************************************
  27.  
  28.     NAME */
  29.     #include <clib/dos_protos.h>
  30.  
  31.     AROS_LH2(BOOL, SetComment,
  32.  
  33. /*  SYNOPSIS */
  34.     AROS_LHA(STRPTR, name,    D1),
  35.     AROS_LHA(STRPTR, comment, D2),
  36.  
  37. /*  LOCATION */
  38.     struct DosLibrary *, DOSBase, 30, Dos)
  39.  
  40. /*  FUNCTION
  41.     Change the comment on a file or directory.
  42.     The comment may be any NUL terminated string. The supported
  43.     size varies from filesystem to filesystem.
  44.  
  45.     INPUTS
  46.     name    - name of the file
  47.     comment - new comment for the file or NULL.
  48.  
  49.     RESULT
  50.     !=0 if all went well, 0 else. IoErr() gives additional
  51.     information in that case.
  52.  
  53.     NOTES
  54.  
  55.     EXAMPLE
  56.  
  57.     BUGS
  58.  
  59.     SEE ALSO
  60.  
  61.     INTERNALS
  62.  
  63.     HISTORY
  64.     29-10-95    digulla automatically created from
  65.                 dos_lib.fd and clib/dos_protos.h
  66.  
  67. *****************************************************************************/
  68. {
  69.     AROS_LIBFUNC_INIT
  70.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  71.  
  72.     /* Get pointer to process structure */
  73.     struct Process *me=(struct Process *)FindTask(NULL);
  74.  
  75.     /* Get pointer to I/O request. Use stackspace for now. */
  76.     struct IOFileSys io,*iofs=&io;
  77.  
  78.     /* Prepare I/O request. */
  79.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  80.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  81.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  82.     iofs->IOFS.io_Flags=0;
  83.     iofs->IOFS.io_Command=FSA_SET_COMMENT;
  84.     /* io_Args[0] is the name which is set by DoName(). */
  85.     iofs->io_Args[1]=(IPTR)comment;
  86.     return !DoName(iofs,name,DOSBase);
  87.     AROS_LIBFUNC_EXIT
  88. } /* SetComment */
  89.