MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / ftypelet

Function ftypelet

src/dir.c:64–115  ·  view source on GitHub ↗

@ @ terminates \true; @ assigns \result; @*/

Source from the content-addressed store, hash-verified

62 @ assigns \result;
63 @*/
64static char ftypelet (unsigned int bits)
65{
66#ifdef LINUX_S_ISBLK
67 if (LINUX_S_ISBLK (bits))
68 return 'b';
69#endif
70 if (LINUX_S_ISCHR (bits))
71 return 'c';
72 if (LINUX_S_ISDIR (bits))
73 return 'd';
74 if (LINUX_S_ISREG (bits))
75 return '-';
76#ifdef LINUX_S_ISFIFO
77 if (LINUX_S_ISFIFO (bits))
78 return 'p';
79#endif
80#ifdef LINUX_S_ISLNK
81 if (LINUX_S_ISLNK (bits))
82 return 'l';
83#endif
84#ifdef LINUX_S_ISSOCK
85 if (LINUX_S_ISSOCK (bits))
86 return 's';
87#endif
88#ifdef LINUX_S_ISMPC
89 if (LINUX_S_ISMPC (bits))
90 return 'm';
91#endif
92#ifdef LINUX_S_ISNWK
93 if (LINUX_S_ISNWK (bits))
94 return 'n';
95#endif
96#ifdef LINUX_S_ISDOOR
97 if (LINUX_S_ISDOOR (bits))
98 return 'D';
99#endif
100#ifdef LINUX_S_ISCTG
101 if (LINUX_S_ISCTG (bits))
102 return 'C';
103#endif
104#ifdef LINUX_S_ISOFD
105 if (LINUX_S_ISOFD (bits))
106 /* off line, with data */
107 return 'M';
108#endif
109#ifdef LINUX_S_ISOFL
110 /* off line, with no data */
111 if (LINUX_S_ISOFL (bits))
112 return 'M';
113#endif
114 return '?';
115}
116
117void mode_string (const unsigned int mode, char *str)
118{

Callers 1

mode_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected