Commit Graph

28 Commits

Author SHA1 Message Date
Sean Bright 605dd03b36 term.c: Add support for extended number format terminfo files.
ncurses 6.1 introduced an extended number format for terminfo files
which the terminfo parsing in Asterisk is not able to parse. This
results in some TERM values that do support color (screen-256color on
Ubuntu 20.04 for example) to not get a color console.

ASTERISK-29630 #close

Change-Id: I27a4fcfab502219924af2d6b1c46feba92903cb3
2021-09-08 19:10:54 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Walter Doekes 03759c5587 main: Slight refactor of main. Improve color situation.
Several issues are addressed here:
- main() is large, and half of it is only used if we're not rasterisk;
  fixed by spliting up the daemon part into a separate function.
- Call ast_term_init from rasterisk as well.
- Remove duplicate code reading/writing asterisk history file.
- Attempt to tackle background color issues and color changes that
  occur. Tested by starting asterisk -c until the colors stopped
  changing at odd locations.
- Remove unused term_prep() and term_prompt() functions.

ASTERISK-25585 #close

Change-Id: Ib641a0964c59ef9fe6f59efa8ccb481a9580c52f
2015-11-25 20:29:55 +01:00
D Tucny e4f0a55f7f term: send proper reset sequence when black background is forced
When using the force black background command-line option or configuration
option an invalid reset sequence is sent following a coloured output item 
in the CLI, the result is that the colour is not 'turned off' and continues
until the next non-default coloured text output.

A reset sequence is already defined in term.c, but the ast_term_reset
function doesn't use it, instead building it's own invalid sequence and 
returning that.

This patch changes that behaviour, removing the building of a reset sequence
and instead using the pre-built constant 'enddata' which is a suitable reset
sequence for this purpose.

ASTERISK-24896 #close
Reported by: Dan Tucny

Change-Id: I56323899123ae3264900389cae1f5b252aa3bf43
2015-05-01 22:17:17 -05:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Kinsey Moore 2e1e0735fe Revamp of terminal color codes
The core module related to coloring terminal output was old and needed
some love.  The main thing here was an attempt to get rid of the
obscene number of stack-local buffers that were allocated for no other
reason than to colorize some output.  Instead, this uses a simple trick
to allocate several buffers within threadlocal storage, then
automatically rotates between them, so that you can make multiple calls
to the colorization routine within one function and not need to
allocate multiple buffers.

Review: https://reviewboard.asterisk.org/r/2241/
Patches:
    bug.patch uploaded by Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 18:47:56 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Terry Wilson be38ebe316 Merged revisions 330108 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330108 | twilson | 2011-07-28 16:44:31 -0500 (Thu, 28 Jul 2011) | 9 lines
  
  Merged revisions 330107 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r330107 | twilson | 2011-07-28 16:42:41 -0500 (Thu, 28 Jul 2011) | 2 lines
    
    Make console colors work for TERM=xterm-256color
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-28 21:46:27 +00:00
Paul Belanger 9aafd4c6b1 Merged revisions 269334 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r269334 | pabelanger | 2010-06-09 13:24:53 -0400 (Wed, 09 Jun 2010) | 12 lines
  
  Fix Debian init script to not use -c.
  
  When using the init script as-is currently, it could cause issues on Debian
  such as high CPU usage. This fix has worked for several people so I'm
  implementing the change.  We now handle color displays properly.
  
  (closes issue #16784)
  Reported by: pabelanger
  Patches:
        20100530__issue16784__2.diff.txt uploaded by tilghman (license 14)
  Tested by: pabelanger, tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-09 17:32:52 +00:00
Tilghman Lesher 4e1e6820db Merged revisions 248582 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248582 | tilghman | 2010-02-24 15:02:18 -0600 (Wed, 24 Feb 2010) | 7 lines
  
  Remove color code sequences from verbose messages that go to logfiles.
  (closes issue #16786)
   Reported by: dodo
   Patches: 
         logger2.patch uploaded by dodo (license 989)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24 21:17:26 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 21:10:07 +00:00
Tilghman Lesher 9335b3ad34 Allow people to select the old console behavior of white text on a black
background, by using the startup flag '-B'.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 17:44:32 +00:00
Tilghman Lesher 6dd5b8609f Optional light colored background, for those who use black on white terminals.
(closes issue #13306)
 Reported by: Corydon76
 Patches: 
       20080814__bug13306__3.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, pkempgen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 23:13:32 +00:00
Tilghman Lesher cfc1df4c1a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:04:29 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00
Luigi Rizzo 915b97d300 move internal function declarations to include/asterisk/_private.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 22:18:21 +00:00
Luigi Rizzo 9335ace850 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 19:09:03 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Tilghman Lesher eb856fbb48 Revert commit #86119. Some users intentionally do not want colorized terminals, so this was a misfeature.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-03 14:19:47 +00:00
Tilghman Lesher 6b9841b141 Support color on certain platforms, even when started at boot (before TERM is set)
Closes issue #9048


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 17:06:47 +00:00
Kevin P. Fleming adca0ff14b Merged revisions 49006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49006 | kpfleming | 2006-12-27 16:06:56 -0600 (Wed, 27 Dec 2006) | 2 lines

since these variables all have static duration, none of them need initializers (they default to zero anyway)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 22:14:33 +00:00
Kevin P. Fleming f04ac0ad7e Merged revisions 47641 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47641 | kpfleming | 2006-11-14 18:19:05 -0600 (Tue, 14 Nov 2006) | 2 lines

more formatting cleanup, and avoid running off the end of the string

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 00:19:35 +00:00
Russell Bryant f575b7e25d Merged revisions 47492 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47492 | russell | 2006-11-11 10:18:02 -0500 (Sat, 11 Nov 2006) | 2 lines

Tweak the formatting of this new function to better conform to coding guidelines.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-11 15:22:08 +00:00
Matt O'Gorman b025702287 safe terminal output is sweet.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-11 02:12:27 +00:00
Kevin P. Fleming 41eb95e055 Merged revisions 44322 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44322 | kpfleming | 2006-10-03 19:25:44 -0500 (Tue, 03 Oct 2006) | 3 lines

ensure that local include files are always used
avoid a duplicate function name (term_init())

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 00:26:21 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00