summaryrefslogtreecommitdiffstats
path: root/genext.c
diff options
context:
space:
mode:
authorroot2009-07-05 22:14:21 +0200
committerroot2009-07-05 22:14:21 +0200
commite9bfe48fc5254e79e59c6ffc1698912175edf4e3 (patch)
tree63c13b3d019b9a45bcd1b48354e243f133292401 /genext.c
parentChanged GSM api to current development tree of OpenBSC. (diff)
downloadlcr-e9bfe48fc5254e79e59c6ffc1698912175edf4e3.tar.gz
lcr-e9bfe48fc5254e79e59c6ffc1698912175edf4e3.tar.xz
lcr-e9bfe48fc5254e79e59c6ffc1698912175edf4e3.zip
Source cleanup.
modified: bootstrap.c modified: cause.c modified: crypt.cpp modified: endpoint.cpp modified: genext.c modified: genrc.c modified: gentones.c modified: genwave.c modified: ie.cpp modified: join.cpp modified: joinpbx.cpp modified: joinremote.cpp modified: lcradmin.c modified: mail.c modified: main.c modified: message.c modified: route.c modified: socket_server.c modified: tones.c modified: trace.c modified: vbox.cpp
Diffstat (limited to 'genext.c')
-rw-r--r--genext.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/genext.c b/genext.c
index 979a7c1..486af09 100644
--- a/genext.c
+++ b/genext.c
@@ -53,14 +53,12 @@ int main(int argc, char *argv[])
char pathname[256];
FILE *fp;
- if (!read_options())
- {
+ if (!read_options()) {
PERROR("%s", options_error);
return(-1);
}
- if (argc != 4)
- {
+ if (argc != 4) {
printf("Usage: %s <extension> <interfaces> <callerid>\n\n", argv[0]);
printf("extension: any number for the extension (e.g 200)\n");
printf("interfaces: internal interface(s) to reach extension, NOT port numbers\n");
@@ -70,8 +68,7 @@ int main(int argc, char *argv[])
}
SPRINT(pathname, "%s/%s", EXTENSION_DATA, argv[1]);
- if (mkdir(pathname, 0755) < 0)
- {
+ if (mkdir(pathname, 0755) < 0) {
if (errno == EEXIST)
PERROR("Extension's directory already exists. Nothing done!\n");
else PERROR("Cannot open extension's directory '%s'.\n", pathname);
@@ -91,12 +88,10 @@ int main(int argc, char *argv[])
write_extension(&ext, argv[1]);
SPRINT(pathname, "%s/%s/phonebook", EXTENSION_DATA, argv[1]);
- if (!(fp = fopen(pathname, "w")))
- {
+ if (!(fp = fopen(pathname, "w"))) {
PERROR("Failed to write phonebook example '%s'.\n", pathname);
return(-1);
- } else
- {
+ } else {
fprintf(fp, "# fromat: <shortcut> <phone number> [<Name>]\n");
fprintf(fp, "# The shotcut may have any number of digits. \n");
fprintf(fp, "# The phone number must include the dialing code for external, internal or\n");
@@ -113,12 +108,10 @@ int main(int argc, char *argv[])
}
SPRINT(pathname, "%s/%s/secrets", EXTENSION_DATA, argv[1]);
- if (!(fp = fopen(pathname, "w")))
- {
+ if (!(fp = fopen(pathname, "w"))) {
PERROR("Failed to write secrets example '%s'.\n", pathname);
return(-1);
- } else
- {
+ } else {
fprintf(fp, "# Format: <remote number> <key exchange> <cypher> [<key>]\n");
fprintf(fp, "# The remote number must match the dialed number for outgoing calls.\n");
fprintf(fp, "# The remote number must match the caller id for incoming calls.\n");