Skip to content

Commit 07a8f7d

Browse files
committed
touch up code documentation syntax and grammar
1 parent 41ccd4c commit 07a8f7d

File tree

14 files changed

+261
-190
lines changed

14 files changed

+261
-190
lines changed

etc/afpd/volume.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ static long long int get_tm_bands(const char *path)
156156
*
157157
* This assumes that the volume is used only for TimeMachine.
158158
*
159-
* 1) readdir(path of volume)
160-
* 2) for every element that matches regex "\(.*\)\.sparsebundle$" :
161-
* 3) parse "\1.sparsebundle/Info.plist" and read the band-size XML key integer value
162-
* 4) readdir "\1.sparsebundle/bands/" counting files
163-
* 5) calculate used size as: (file_count - 1) * band-size
159+
* 1. readdir(path of volume)
160+
* 2. for every element that matches regex "\(.*\)\.sparsebundle$" :
161+
* 3. parse "\1.sparsebundle/Info.plist" and read the band-size XML key integer value
162+
* 4. readdir "\1.sparsebundle/bands/" counting files
163+
* 5. calculate used size as: (file_count - 1) * band-size
164164
*
165165
* The result of the calculation is returned in "volume->v_tm_used".
166166
* "volume->v_appended" gets reset to 0.

etc/cnid_dbd/dbif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int dbif_init_rootinfo(DBD *dbd, int version)
130130
*
131131
* Returns version in *version
132132
*
133-
* @returns -1 on error, 0 if theres no rootinfo key yet, 1 if *version is returned
133+
* @returns -1 on error, 0 if there's no rootinfo key yet, 1 if *version is returned
134134
*/
135135
static int dbif_getversion(DBD *dbd, uint32_t *version)
136136
{

etc/cnid_dbd/main.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,16 @@ static void block_sigs_onoff(int block)
8989
* @brief Get lock on db lock file
9090
*
9191
* @param cmd (r) lock command:
92-
* LOCK_FREE: close lockfd
93-
* LOCK_UNLOCK: unlock lockm keep lockfd open
94-
* LOCK_EXCL: F_WRLCK on lockfd
95-
* LOCK_SHRD: F_RDLCK on lockfd
92+
* - LOCK_FREE: close lockfd
93+
* - LOCK_UNLOCK: unlock lockm keep lockfd open
94+
* - LOCK_EXCL: F_WRLCK on lockfd
95+
* - LOCK_SHRD: F_RDLCK on lockfd
9696
* @param dbpath (r) path to lockfile, only used on first call,
9797
* later the stored fd is used
98-
* @returns LOCK_FREE/LOCK_UNLOCK return 0 on success, -1 on error
99-
* LOCK_EXCL/LOCK_SHRD return LOCK_EXCL or LOCK_SHRD respectively on
100-
* success, 0 if the lock couldn't be acquired, -1 on other errors
98+
* @returns depending on lock command:
99+
* - LOCK_FREE/LOCK_UNLOCK return 0 on success, -1 on error
100+
* - LOCK_EXCL/LOCK_SHRD return LOCK_EXCL or LOCK_SHRD respectively on
101+
* success, 0 if the lock couldn't be acquired, -1 on other errors
101102
*/
102103
static int get_lock(int cmd, const char *dbpath)
103104
{

include/atalk/list.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static inline void list_splice(struct list_head *list, struct list_head *head)
134134

135135
#endif
136136
/*!
137-
* @brief list_entry - get the struct for this entry
137+
* @brief get the struct for this entry
138138
* @param ptr the &struct list_head pointer.
139139
* @param type the type of the struct this is embedded in.
140140
* @param member the name of the list_struct within the struct.
@@ -143,7 +143,7 @@ static inline void list_splice(struct list_head *list, struct list_head *head)
143143
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
144144

145145
/*!
146-
* @brief list_for_each - iterate over a list
146+
* @brief iterate over a list
147147
* @param pos the &struct list_head to use as a loop counter.
148148
* @param head the head for your list.
149149
*/
@@ -152,7 +152,7 @@ static inline void list_splice(struct list_head *list, struct list_head *head)
152152
pos = pos->next)
153153

154154
/*!
155-
* @brief list_for_each_prev - iterate over a list in reverse order
155+
* @brief iterate over a list in reverse order
156156
* @param pos the &struct list_head to use as a loop counter.
157157
* @param head the head for your list.
158158
*/

libatalk/acl/ldap.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,16 @@ struct pref_array prefs_array[] = {
103103
* Static helper function
104104
********************************************************/
105105

106-
/*
106+
/*!
107+
* @brief LDAP get attribute from filter with base and scope
107108
* ldap_getattr_fromfilter_withbase_scope():
108109
* conflags: KEEPALIVE
109110
* scope: LDAP_SCOPE_BASE, LDAP_SCOPE_ONELEVEL, LDAP_SCOPE_SUBTREE
110111
* result: return unique search result here, allocated here, caller must free
111112
*
112-
* returns: -1 on error
113-
* 0 nothing found
114-
* 1 successfull search, result int 'result'
113+
* @returns: -1 on error,
114+
* 0 nothing found,
115+
* 1 successful search, result int 'result'
115116
*
116117
* All connection managment to the LDAP server is done here. Just set KEEPALIVE if you know
117118
* you will be dispatching more than one search in a row, then don't set it with the last search.
@@ -437,16 +438,17 @@ int ldap_getuuidfromname(const char *name, uuidtype_t type, char **uuid_string)
437438
return 0;
438439
}
439440

440-
/*
441-
* LDAP search wrapper
441+
/*!
442+
* @brief LDAP search wrapper
443+
*
442444
* returns allocated storage in name, caller must free it
443445
* returns 0 on success, -1 on error or not found
444446
*
445447
* @param uuidstr (r) uuid to search as ascii string
446448
* @param name (w) return pointer to name as allocated string
447449
* @param type (w) return type: USER or GROUP
448450
*
449-
* returns 0 on success, -1 on errror
451+
* @returns 0 on success, -1 on errror
450452
*/
451453
int ldap_getnamefromuuid(const char *uuidstr, char **name, uuidtype_t *type)
452454
{

libatalk/acl/unix.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,16 @@ int strip_nontrivial_aces(ace_t **saces, int sacecount)
223223
* @brief Change mode of file preserving existing explicit ACEs
224224
*
225225
* nfsv4_chmod
226-
* (1) reads objects ACL (acl1), may return 0 or -1 NFSv4 ACEs on e.g. UFS fs
227-
* (2) removes all trivial ACEs from the ACL by calling strip_trivial_aces(), possibly
228-
* leaving 0 ACEs in the ACL if there were only trivial ACEs as mapped from the mode
229-
* (3) calls chmod() with mode, we're done if step (1) returned 0 for noaces
230-
* (4) reads the changed ACL (acl2) which
231-
* a) might still contain explicit ACEs (up to onnv132)
232-
* b) will have any explicit ACE removed (starting with onnv145/Openindiana)
233-
* (5) strip any explicit ACE from acl2 using strip_nontrivial_aces()
234-
* (6) merge acl2 and acl2
235-
* (7) set the ACL merged ACL on the object
226+
* 1. reads objects ACL (acl1), may return 0 or -1 NFSv4 ACEs on e.g. UFS fs
227+
* 2. removes all trivial ACEs from the ACL by calling strip_trivial_aces(), possibly
228+
* leaving 0 ACEs in the ACL if there were only trivial ACEs as mapped from the mode
229+
* 3. calls chmod() with mode, we're done if step (1) returned 0 for noaces
230+
* 4. reads the changed ACL (acl2) which
231+
* a. might still contain explicit ACEs (up to onnv132)
232+
* b. will have any explicit ACE removed (starting with onnv145/Openindiana)
233+
* 5. strip any explicit ACE from acl2 using strip_nontrivial_aces()
234+
* 6. merge acl2 and acl2
235+
* 7. set the ACL merged ACL on the object
236236
*/
237237
int nfsv4_chmod(char *name, mode_t mode)
238238
{

libatalk/adouble/ad_open.c

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,10 +2251,12 @@ void ad_init(struct adouble *ad, const struct vol *restrict vol)
22512251
/*!
22522252
* @brief Open data-, metadata(header)- or resource fork
22532253
*
2254+
* @code
22542255
* ad_open(struct adouble *ad, const char *path, int adflags, int flags)
22552256
* ad_open(struct adouble *ad, const char *path, int adflags, int flags, mode_t mode)
2257+
* @endcode
22562258
*
2257-
* You must call ad_init() before ad_open, usually you'll just call it like this: \n
2259+
* You must call ad_init() before ad_open, usually you'll just call it like this:
22582260
* @code
22592261
* struct adoube ad;
22602262
* ad_init(&ad, vol->v_adouble, vol->v_ad_options);
@@ -2264,29 +2266,32 @@ void ad_init(struct adouble *ad, const struct vol *restrict vol)
22642266
*
22652267
* @param ad (rw) pointer to struct adouble
22662268
* @param path (r) Path to file or directory
2267-
* @param adflags (r) Flags specifying which fork to open, can be or'd:
2268-
* ADFLAGS_DF: open data fork
2269-
* ADFLAGS_RF: open resource fork
2270-
* ADFLAGS_HF: open header (metadata) file
2271-
* ADFLAGS_NOHF: it's not an error if header file couldn't be opened
2272-
* ADFLAGS_NORF: it's not an error if reso fork couldn't be opened
2273-
* ADFLAGS_DIR: if path is a directory you MUST or ADFLAGS_DIR to adflags
2269+
* @param adflags (r) Flags specifying which fork to open, can be or'd (see below)
2270+
* @param ... (r) mode used with O_CREATE
2271+
*
2272+
* Regular adflags:
2273+
* - ADFLAGS_DF: open data fork
2274+
* - ADFLAGS_RF: open resource fork
2275+
* - ADFLAGS_HF: open header (metadata) file
2276+
* - ADFLAGS_NOHF: it's not an error if header file couldn't be opened
2277+
* - ADFLAGS_NORF: it's not an error if reso fork couldn't be opened
2278+
* - ADFLAGS_DIR: if path is a directory you MUST or ADFLAGS_DIR to adflags
22742279
*
2275-
* Access mode for the forks:
2276-
* ADFLAGS_RDONLY: open read only
2277-
* ADFLAGS_RDWR: open read write
2280+
* Access mode for the forks:
2281+
* - ADFLAGS_RDONLY: open read only
2282+
* - ADFLAGS_RDWR: open read write
22782283
*
2279-
* Creation flags:
2280-
* ADFLAGS_CREATE: create if not existing
2281-
* ADFLAGS_TRUNC: truncate
2284+
* Creation flags:
2285+
* - ADFLAGS_CREATE: create if not existing
2286+
* - ADFLAGS_TRUNC: truncate
22822287
*
2283-
* Special flags:
2284-
* ADFLAGS_CHECK_OF: check for open forks from us and other afpd's
2285-
* ADFLAGS_SETSHRMD: this adouble struct will be used to set sharemode locks.
2286-
* This basically results in the files being opened RW instead of RDONLY.
2287-
* @param ... (r) mode used with O_CREATE
2288+
* Special flags:
2289+
* - ADFLAGS_CHECK_OF: check for open forks from us and other afpd's
2290+
* - ADFLAGS_SETSHRMD: this adouble struct will be used to set sharemode locks.
2291+
* This basically results in the files being opened RW instead of RDONLY.
22882292
*
22892293
* The open mode flags (rw vs ro) have to take into account all the following requirements:
2294+
*
22902295
* - we remember open fds for files because me must avoid a single close releasing fcntl locks for other
22912296
* fds of the same file
22922297
*

0 commit comments

Comments
 (0)