home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / dos / setcomment.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  2.4 KB  |  97 lines

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