appletfileflags.c

Go to the documentation of this file.
00001 
00002 /*  $Id: appletfileflags.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /* copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 
00007 #include "applet.h"
00008 #include "appletbits.h"
00009 #include "appletfilesinternal.h"
00010 #include "appletfileflags.h"
00011 
00012 
00013 
00014 
00015 boolean filesetlocked (ptrfilespec pfs, boolean fllock) {
00016     
00017     OSErr ec;
00018     
00019     if (fllock) 
00020         ec = FSpSetFLock (pfs);
00021     else
00022         ec = FSpRstFLock (pfs);
00023         
00024     return (!fileerror (pfs, ec));
00025     } /*filesetlocked*/
00026     
00027     
00028 boolean filesetfinderflag (ptrfilespec pfs, short flagnum, boolean flag) {
00029 
00030     OSErr ec;
00031     FInfo info;
00032 
00033     ec = FSpGetFInfo (pfs, &info);
00034     
00035     if (fileerror (pfs, ec))
00036         return (false);
00037     
00038     if (flag)
00039         info.fdFlags = setbit (info.fdFlags, flagnum);
00040     else
00041         info.fdFlags = clearbit (info.fdFlags, flagnum);
00042     
00043     ec = FSpSetFInfo (pfs, &info);  
00044     
00045     return (!fileerror (pfs, ec));
00046     } /*filesetfinderflag*/
00047     
00048 
00049 boolean filesetsharedbit (ptrfilespec pfs, boolean flsharedbit) {
00050     
00051     return (filesetfinderflag (pfs, 6, flsharedbit));
00052     } /*filesetsharedbit*/
00053         
00054 
00055 boolean filesetcustomiconbit (ptrfilespec pfs, boolean flcustomiconbit) {
00056     
00057     return (filesetfinderflag (pfs, 10, flcustomiconbit));
00058     } /*filesetcustomiconbit*/
00059         
00060 
00061 boolean filesetstationery (ptrfilespec pfs, boolean flstationery) {
00062     
00063     return (filesetfinderflag (pfs, 11, flstationery));
00064     } /*filesetstationery*/
00065         
00066 
00067 boolean filesetnamelocked (ptrfilespec pfs, boolean flnamelocked) {
00068     
00069     return (filesetfinderflag (pfs, 12, flnamelocked));
00070     } /*filesetnamelocked*/
00071         
00072 
00073 boolean filesetbundlebit (ptrfilespec pfs, boolean flbundlebit) {
00074     
00075     return (filesetfinderflag (pfs, 13, flbundlebit));
00076     } /*filesetbundlebit*/
00077     
00078 
00079 boolean filesetinvisible (ptrfilespec pfs, boolean flinvisible) {
00080     
00081     return (filesetfinderflag (pfs, 14, flinvisible));
00082     } /*filesetinvisible*/
00083     
00084 
00085 boolean filesetaliasbit (ptrfilespec pfs, boolean flaliasbit) {
00086     
00087     return (filesetfinderflag (pfs, 15, flaliasbit));
00088     } /*filesetaliasbit*/
00089     
00090     
00091 

Generated on Wed May 31 18:19:41 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6