Define CBError data structure.
More...
#include <Coconut/Coconut.h>
Go to the source code of this file.
Classes |
struct | CBError |
| Error information stored by the command line parer. More...
|
Enumerations |
enum | CBErrorType {
CBNoError = 0,
CBNoDefaultCommand,
CBInvalidLongOptionName,
CBInvalidShortOptionName,
CBNoParameterForLongOptionName,
CBNoParameterForShortOptionName
} |
| Type of command line parser error. More...
|
Functions |
static void | CBSetNoDefaultCommandError (struct CBError *dst) |
| Set "No default command" error.
|
static void | CBSetInvalidLongNameOption (struct CBError *dst, const char *optname) |
| Set "Invalid long name option" error.
|
static void | CBSetInvalidShortNameOption (struct CBError *dst, char optchar) |
| Set "Invalid short name option" error.
|
static void | CBSetNoParameterForLongNameOption (struct CBError *dst, const char *optname) |
| Set "No parameter for long name option" error.
|
static void | CBSetNoParameterForShortNameOption (struct CBError *dst, char optchar) |
| Set "No parameter for short name option" error.
|
struct CNString * | CBErrorToString (const struct CBError *src, struct CNResource *resource) |
| Get error message from error info.
|
Detailed Description
Define CBError data structure.
- Copyright
- Copyright (C) 2012 Steel Wheels Project
Enumeration Type Documentation
Type of command line parser error.
- Enumerator:
-
Function Documentation
struct CNString* CBErrorToString |
( |
const struct CBError * |
src, |
|
|
struct CNResource * |
resource |
|
) |
| [read] |
Get error message from error info.
- Return values:
-
str | Error message |
NULL | Failed to allocate error message |
- Parameters:
-
src | Source error information |
resource | Resource to allocate result string |
static void CBSetInvalidLongNameOption |
( |
struct CBError * |
dst, |
|
|
const char * |
optname |
|
) |
| [inline, static] |
Set "Invalid long name option" error.
- Parameters:
-
dst | Destination error info |
optname | The option name which occurres error |
static void CBSetInvalidShortNameOption |
( |
struct CBError * |
dst, |
|
|
char |
optchar |
|
) |
| [inline, static] |
Set "Invalid short name option" error.
- Parameters:
-
dst | Destination error info |
optchar | The option name which occurres error |
static void CBSetNoDefaultCommandError |
( |
struct CBError * |
dst | ) |
[inline, static] |
Set "No default command" error.
- Parameters:
-
dst | Destination error info |
static void CBSetNoParameterForLongNameOption |
( |
struct CBError * |
dst, |
|
|
const char * |
optname |
|
) |
| [inline, static] |
Set "No parameter for long name option" error.
- Parameters:
-
dst | Destination error info |
optname | The option name which occurres error |
static void CBSetNoParameterForShortNameOption |
( |
struct CBError * |
dst, |
|
|
char |
optchar |
|
) |
| [inline, static] |
Set "No parameter for short name option" error.
- Parameters:
-
dst | Destination error info |
optchar | The option name which occurres error |