udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
main.c File Reference
`#include "config.h"`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <errno.h>`
`#include <sys/ioctl.h>`
`#include <sys/types.h>`
`#include <sys/file.h>`
`#include <unistd.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <sys/mman.h>`
`#include <limits.h>`
`#include <signal.h>`
`#include <ecma_167.h>`
`#include <libudffs.h>`
`#include "utils.h"`
`#include "options.h"`
`#include "udffsck.h"`
Include dependency graph for main.c:

Go to the source code of this file.

## Macros
#define | _POSIX_C_SOURCE 200808L
#define | PRINT_DISC
#define | MAX_VERSION 0x0201
#define | ES_AVDP1 0x0001
#define | ES_AVDP2 0x0002
#define | ES_PD 0x0004
#define | ES_LVID 0x0008

## Functions
void | user_interrupt (int dummy)
| User interrupt hander (Ctrl + C or SIGINT) More...
void | segv_interrupt (int dummy)
| Segmentation fault handler. More...
int | main (int argc, char *argv[])
| udffsck entry point More...

## Macro Definition Documentation

#define _POSIX_C_SOURCE 200808L

Definition at line 22 of file main.c.

#define ES_AVDP1 0x0001

Definition at line 74 of file main.c.

#define ES_AVDP2 0x0002

Definition at line 75 of file main.c.

#define ES_LVID 0x0008

Definition at line 77 of file main.c.

#define ES_PD 0x0004

Definition at line 76 of file main.c.

#define MAX_VERSION 0x0201

Definition at line 50 of file main.c.

#define PRINT_DISC

Definition at line 48 of file main.c.

## Function Documentation

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

udffsck entry point

This is entry point for udffsck. It contains structure of whole tool and calls function from udffsck.c

It accepts inputs via argv.

Returns
  0 – No error
  1 – Filesystem errors were fixed
  2 – Filesystem errors were fixed, reboot is recomended (Unsupported)
  4 – Filesystem errors remained unfixed
  8 – Program error
  16 – Wrong input parameters
  32 – Check was interrupted by user request
  128 – Shared library error (Unsupported)

Definition at line 96 of file main.c.

void segv_interrupt | ( | int | dummy | ) |

Segmentation fault handler.

If program dies because of SEGV, this handler catches it and die properly. It instructs user to report it, because this behavior is bug.

Definition at line 68 of file main.c.

void user_interrupt | ( | int | dummy | ) |

User interrupt hander (Ctrl + C or SIGINT)

After calling this, program exits with code 32 (User interrupt).

Definition at line 57 of file main.c.