]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/desktop.c
remove the daemon icon, it's not displayed on OS9 and not always on OSX, from HAT
[netatalk.git] / etc / afpd / desktop.c
index 82e8852ca5d6e2f12b9bb961e741cf3206ad4f83..ae9521d32c1d220e61f213a6b0582dacb6ff045a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.26.2.4.2.18 2004-10-09 12:48:21 didg Exp $
+ * $Id: desktop.c,v 1.26.2.4.2.18.2.5 2006-09-15 00:35:03 didg Exp $
  *
  * See COPYRIGHT.
  *
@@ -41,9 +41,9 @@
 
 
 int afp_opendt(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
+AFPObj  *obj _U_;
 char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+int    ibuflen _U_, *rbuflen;
 {
     struct vol *vol;
     u_int16_t  vid;
@@ -62,15 +62,15 @@ int         ibuflen, *rbuflen;
 }
 
 int afp_closedt(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
-char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+AFPObj  *obj _U_;
+char   *ibuf _U_, *rbuf _U_;
+int    ibuflen _U_, *rbuflen;
 {
     *rbuflen = 0;
     return( AFP_OK );
 }
 
-struct savedt  si = { { 0, 0, 0, 0 }, -1, 0 };
+struct savedt  si = { { 0, 0, 0, 0 }, -1, 0, 0 };
 
 static char *icon_dtfile(struct vol *vol, u_char creator[ 4 ])
 {
@@ -80,6 +80,8 @@ static char *icon_dtfile(struct vol *vol, u_char creator[ 4 ])
 static int iconopen( vol, creator, flags, mode )
 struct vol     *vol;
 u_char creator[ 4 ];
+int flags;
+int mode;
 {
     char       *dtf, *adt, *adts;
 
@@ -125,9 +127,9 @@ u_char      creator[ 4 ];
 }
 
 int afp_addicon(obj, ibuf, ibuflen, rbuf, rbuflen)
-AFPObj      *obj;
+AFPObj  *obj;
 char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+int    ibuflen _U_, *rbuflen;
 {
     struct vol         *vol;
 #ifndef NO_DDP
@@ -309,11 +311,13 @@ addicon_err:
     return( AFP_OK );
 }
 
-static u_char  utag[] = { 0, 0, 0, 0 };
-static u_char  ucreator[] = { 0, 0, 0, 0 };/* { 'U', 'N', 'I', 'X' };*/
-static u_char  utype[] = { 0, 0, 0, 0 };/* { 'T', 'E', 'X', 'T' };*/
-static short   usize = 256;
-static u_char  uicon[] = {
+static const u_char    utag[] = { 0, 0, 0, 0 };
+static const u_char    ucreator[] = { 0, 0, 0, 0 };/* { 'U', 'N', 'I', 'X' };*/
+static const u_char    utype[] = { 0, 0, 0, 0 };/* { 'T', 'E', 'X', 'T' };*/
+static const short     usize = 256;
+
+#if 0
+static const u_char    uicon[] = {
     0x1F, 0xFF, 0xFC, 0x00, 0x10, 0x00, 0x06, 0x00,
     0x10, 0x00, 0x05, 0x00, 0x10, 0x00, 0x04, 0x80,
     0x10, 0x00, 0x04, 0x40, 0x10, 0x00, 0x04, 0x20,
@@ -347,11 +351,12 @@ static u_char     uicon[] = {
     0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0,
     0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0,
 };
+#endif
 
 int afp_geticoninfo(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
+AFPObj  *obj _U_;
 char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+int    ibuflen _U_, *rbuflen;
 {
     struct vol *vol;
     u_char     fcreator[ 4 ], ih[ 12 ];
@@ -423,9 +428,9 @@ int         ibuflen, *rbuflen;
 
 
 int afp_geticon(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
+AFPObj  *obj;
 char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+int    ibuflen _U_, *rbuflen;
 {
     struct vol *vol;
     off_t       offset;
@@ -452,6 +457,7 @@ int         ibuflen, *rbuflen;
     memcpy( &bsize, ibuf, sizeof( bsize ));
     bsize = ntohs( bsize );
 
+#if 0
     if ( memcmp( fcreator, ucreator, sizeof( ucreator )) == 0 &&
             memcmp( ftype, utype, sizeof( utype )) == 0 &&
             itype == 1 &&
@@ -460,6 +466,7 @@ int         ibuflen, *rbuflen;
         *rbuflen = bsize;
         return( AFP_OK );
     }
+#endif
 
     if ( iconopen( vol, fcreator, O_RDONLY, 0 ) < 0) {
         return( AFPERR_NOITEM );
@@ -572,7 +579,7 @@ geticon_exit:
 }
 
 /* ---------------------- */
-static char            hexdig[] = "0123456789abcdef";
+static const char              hexdig[] = "0123456789abcdef";
 char *dtfile(const struct vol *vol, u_char creator[], char *ext )
 {
     static char        path[ MAXPATHLEN + 1];
@@ -725,7 +732,7 @@ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf)
     
     isadir = path_isadir(path);
     if (isadir || !(of = of_findname(path))) {
-        ad_init(&ad, vol->v_adouble);
+        ad_init(&ad, vol->v_adouble, vol->v_ad_options);
         adp = &ad;
     } else
         adp = of->of_ad;
@@ -755,9 +762,9 @@ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf)
 
 /* ----------------------------- */
 int afp_addcomment(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
-char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+AFPObj      *obj _U_;
+char   *ibuf, *rbuf _U_;
+int            ibuflen _U_, *rbuflen;
 {
     struct vol         *vol;
     struct dir         *dir;
@@ -803,7 +810,7 @@ static int ad_getcomment(struct vol *vol, struct path *path, char *rbuf, int *rb
     upath = path->u_name;
     isadir = path_isadir(path);
     if (isadir || !(of = of_findname(path))) {
-        ad_init(&ad, vol->v_adouble);
+        ad_init(&ad, vol->v_adouble, vol->v_ad_options);
         adp = &ad;
     } else
         adp = of->of_ad;
@@ -813,6 +820,7 @@ static int ad_getcomment(struct vol *vol, struct path *path, char *rbuf, int *rb
     }
 
     if (!ad_getentryoff(adp, ADEID_COMMENT)) {
+        ad_close( adp, ADFLAGS_HF );
         return AFPERR_NOITEM;
     }
     /*
@@ -835,9 +843,9 @@ static int ad_getcomment(struct vol *vol, struct path *path, char *rbuf, int *rb
 
 /* -------------------- */
 int afp_getcomment(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
+AFPObj      *obj _U_;
 char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+int            ibuflen _U_, *rbuflen;
 {
     struct vol         *vol;
     struct dir         *dir;
@@ -882,7 +890,7 @@ static int ad_rmvcomment(struct vol *vol, struct path *path)
 
     isadir = path_isadir(path);
     if (isadir || !(of = of_findname(path))) {
-        ad_init(&ad, vol->v_adouble);
+        ad_init(&ad, vol->v_adouble, vol->v_ad_options);
         adp = &ad;
     } else
         adp = of->of_ad;
@@ -910,9 +918,9 @@ static int ad_rmvcomment(struct vol *vol, struct path *path)
 
 /* ----------------------- */
 int afp_rmvcomment(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj      *obj;
-char   *ibuf, *rbuf;
-int            ibuflen, *rbuflen;
+AFPObj      *obj _U_;
+char   *ibuf, *rbuf _U_;
+int            ibuflen _U_, *rbuflen;
 {
     struct vol         *vol;
     struct dir         *dir;