ctags는 말 그대로 c 언어 파일의 keyword, identifier를 출력해 주는 툴이다.
ctags -R
을 실행하면 tags라는 파일이 생성이 된다.
source code [test.c]
command [ctags test.c]
file [tags]
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.4 //
CHARLEY test.c /^ CHARLEY,$/;" e file:
FALSE test.c /^ FALSE$/;" e file:
LINDA test.c /^ LINDA$/;" e file:
TOM test.c /^ TOM,$/;" e file:
TRUE test.c /^ TRUE,$/;" e file:
WIN32_VERSION test.c 3;" d file:
boolean test.c /^} boolean;$/;" t file:
main test.c /^int main(int argc,char argv**)$/;" f
test_int test.c /^int test_int;$/;" v
test_int_static test.c /^static int test_int_static;$/;" v file:
command [ctags -n -u test.c]
file [tags]
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 0 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.4 //
WIN32_VERSION test.c 3;" d file:
test_int_static test.c 5;" v file:
test_int test.c 6;" v
TRUE test.c 10;" e file:
FALSE test.c 11;" e file:
boolean test.c 12;" t file:
TOM test.c 16;" e file:
CHARLEY test.c 17;" e file:
LINDA test.c 18;" e file:
main test.c 21;" f
Wikipedia의 ctags file format 에 관련된 내용
Tags file formats
There are multiple tag file formats. Some of them are described below. In the
following, <\x##> represents the byte with hexadecimal representation
##.
Ctags and Exuberant Ctags
The original ctags and Exuberant Ctags have similar file
formats:[2]
Ctags
This is the format used by vi and various clones. The tags file is
normally named "tags".
The tags file is a list of lines, each line in the format:
{tagname}<Tab>{tagfile}<Tab>{tagaddress}
The fields are specified as follows:
{tagname} – Any identifier, not containing white space
<Tab> – Exactly one tab
character, although many versions of vi can handle any amount of white
space
{tagfile} – The name of the file where {tagname} is defined, relative to the
current directory
{tagaddress} – An ex mode command that will take the editor to the
location of the tag. For POSIX implementations of vi this may only be a
search or a line number.
The tags file is sorted on the {tagname} field which allows for fast
searching of the tags file.
Exuberant Ctags
This is the format used by Vim. It can generate an original ctags
file format or an extended format that attempts to retain backward
compatibility.
The fields up to and including {tagaddress} are the same as for ctags above.
Optional additional fields:
;" – semicolon + doublequote: Ends the {tagaddress} in way that looks like
the start of a comment to vi.
{tagfield}
Extended format extends the {tagaddress} field under certain circumstances to
include a set of extension fields embedded in an ex comment immediately appended
to the ex command, which leaves it backward-compatible with original vi
implementations. These extension fields are tab separated "key:value" pairs,
documented in the ctags
manual.
Etags
This is the format used by Emacs etags. The tags file is normally
named "TAGS".
The etags files consists of multiple sections—one section per input source
file. Sections are plain-text with several non-ascii characters used for special
purposes. These characters are represented as bracketed hexadecimal codes
below.
A section starts with a two line header, one line containing a single
<\x0c> character, followed by a line which consists of:
{src_file},{size_of_tag_definition_data_in_bytes}
The header is followed by tag definitions, one definition per line, with the
format:
-a Append the tags to an existing tag file.
-B Use backward searching patterns (?...?).
-e Output tag file for use with Emacs.
-f <name>
Write tags to specified file. Value of "-" writes tags to stdout
["tags"; or "TAGS" when -e supplied].
-F Use forward searching patterns (/.../) (default).
-h <list>
Specify list of file extensions to be treated as include files.
[".h.H.hh.hpp.hxx.h++"].
-I <list|@file>
A list of tokens to be specially handled is read from either the
command line or the specified file.
-L <file>
A list of source file names are read from the specified file.
If specified as "-", then standard input is read. -n Equivalent to --excmd=number.
-N Equivalent to --excmd=pattern.
-o Alternative for -f. -R Equivalent to --recurse. -u Equivalent to --sort=no.
-V Equivalent to --verbose.
-x Print a tabular cross reference file to standard output.
--append=[yes|no]
Should tags should be appended to existing tag file [no]?
--etags-include=file
Include reference to 'file' in Emacs-style tag file (requires -e).
--exclude=pattern
Exclude files and directories matching 'pattern'.
--excmd=number|pattern|mix
Uses the specified type of EX command to locate tags [mix].
--extra=[+|-]flags
Include extra tag entries for selected information (flags: "fq").
--fields=[+|-]flags
Include selected extension fields (flags: "afmikKlnsSz") [fks].
--file-scope=[yes|no]
Should tags scoped only for a single file (e.g. "static" tags
be included in the output [yes]?
--filter=[yes|no]
Behave as a filter, reading file names from standard input and
writing tags to standard output [no].
--filter-terminator=string
Specify string to print to stdout following the tags for each file
parsed when --filter is enabled.
--format=level
Force output of specified tag file format [2].
--help
Print this option summary.
--if0=[yes|no]
Should C code within #if 0 conditional branches be parsed [no]?
--langdef=name
Define a new language to be parsed with regular expressions.
--langmap=map(s)
Override default mapping of language to source file extension.
--language-force=language
Force all files to be interpreated with specified language.
--languages=[+|-]list
Restrict files scanned for tags to those mapped to langauges
specified in the comma-separated 'list'. The list can contain any
built-in or user-defined language [all].
--license
Print details of software license.
--line-directives=[yes|no]
Should #line directives be processed [no]?
--links=[yes|no]
Indicate whether symbolic links should be followed [yes].
--options=file
Specify file from which command line options should be read.
--recurse=[yes|no]
Recurse into directories supplied on command line [no].
--sort=[yes|no|foldcase]
Should tags be sorted (optionally ignoring case) [yes]?.
--tag-relative=[yes|no]
Should paths be relative to location of tag file [no; yes when -e]?
--totals=[yes|no]
Print statistics about source and tag files [no].
--verbose=[yes|no]
Enable verbose messages describing actions on each source file.
--version
Print version identifier to standard output.
The following options are used to specify which language-specific tag
types (or kinds) should be included in the tag file. "Kinds" is a group of
one-letter flags designating kinds of tags to either include or exclude from
the output. Each letter or group of letters may be preceded by either '+' to
add it to those already included, or '-' to exclude it from the output. In
the absence of any preceding '+' or '-' sign, only those kinds listed in
"kinds" will be included in the output. Below each option is a list of the
flags accepted. All kinds are enabled by default unless otherwise noted.
--asm-types=[+|-]kinds
d defines
l labels
m macros
t types
--asp-types=[+|-]kinds
f functions
s subroutines
--awk-types=[+|-]kinds
f functions
--beta-types=[+|-]kinds
f fragment definitions
p all patterns [off]
s slots (fragment uses)
v patterns (only virtual or rebound patterns are recorded)
--c-types=[+|-]kinds
c classes
d macro definitions
e enumerators (values inside an enumeration)
f function definitions
g enumeration names
m class, struct, and union members
n namespaces
p function prototypes [off]
s structure names
t typedefs
u union names
v variable definitions
x external variable declarations [off]
--c++-types=[+|-]kinds
c classes
d macro definitions
e enumerators (values inside an enumeration)
f function definitions
g enumeration names
m class, struct, and union members
n namespaces
p function prototypes [off]
s structure names
t typedefs
u union names
v variable definitions
x external variable declarations [off]
--eiffel-types=[+|-]kinds
c classes
f features
l local entities [off]
--fortran-types=[+|-]kinds
b block data
c common blocks
e entry points
f functions
i interfaces
k type components
l labels
L local and common block variables [off]
m modules
n namelists
p programs
s subroutines
t derived types
v module variables
--java-types=[+|-]kinds
c classes
f fields
i interfaces
m methods
p packages
--lisp-types=[+|-]kinds
f functions
--lua-types=[+|-]kinds
f functions
--make-types=[+|-]kinds
m macros
--pascal-types=[+|-]kinds
f functions
p procedures
--perl-types=[+|-]kinds
s subroutines
p packages
--php-types=[+|-]kinds
c classes
f functions
--python-types=[+|-]kinds
c classes
f functions
m class member
--ruby-types=[+|-]kinds
c classes
f methods
F singleton methods
m mixins
--scheme-types=[+|-]kinds
f functions
s sets
--sh-types=[+|-]kinds
f functions
--sql-types=[+|-]kinds
c cursors
d prototypes [off]
f functions
F record fields
l local variables [off]
P packages
p procedures
r records
s subtypes
t tables
T triggers
v variables
--tcl-types=[+|-]kinds
p procedures
c classes
f methods
--vera-types=[+|-]kinds
c classes
d macro definitions
e enumerators (values inside an enumeration)
f function definitions
g enumeration names
m class, struct, and union members
p programs
P function prototypes [off]
t tasks
T typedefs
v variable definitions
x external variable declarations [off]
--verilog-types=[+|-]kinds
f functions
m modules
P parameters, defines
p ports (input, output, inout)
r registers
t tasks
v variables (integer, real, time)
w wires (supply, tri, wire, wand, ...)
--vim-types=[+|-]kinds
f function definitions
v variable definitions
칫솔님이 예전에 리플 이벤트로 넷북 VS 미니 노트북, 그리고 코어 i7 발표회 공지 포스트가 있었는데
솔찍히 말해서 이벤트라는 생각도 안하고
그냥 평소대로 손이 가는 대로 악플을 하나 적었을 뿐인데 -ㅁ-!
다시는 악플을 달지 말라는 격려의 의미로 이벤트에 당첨을 시켜 주시고 선물까지 주시었다 +_+
1. 회사에 도착한 소포. 엄청난 크기에 놀랐다.
솔찍히 전날에 USB를 이미 질렀는데 그게 도착한 줄 알았다.
(특가 판매로 1개만 하는데 3개를 주문해서 판매자 측에서 취소 한 듯 하다.)
2. 열어 보니. 헉! 과대 포장이었다. 어라라 저것은!! USB!!! +_+
3. 이 희끄무리 한녀석은 머냐 -ㅁ-
4. 오홍 HP? 웬지 핸드폰 줄을 이렇게 크게 넣은걸까?
--- 여기까지 회사에서 폰카로 신나면서 찍어댐
1. 집에서 열어본 희끄무리한 녀석...
L 사이즈인 관계로 인증샷으로 스키니 상의를 보여 드릴려다가.. 손부터 안들어 간다 OTL
대충 접어 놨는데, 내가 좋아하는 옷인데 안들어 간다 ㅠ.ㅠ 우어어어어
모자달린 후드티인데.. XL이라도 웬지 별로 안커서 완전 미셰린 될 것 같다.
2. HP 녀석 넥타이는 잘 모르지만 만져보니 느낌이 좋다 *-_-*
그러나!!! 회사에서 복장이 저런 관계로 아마 누군가의 결혼식에나 사용할 듯 OTL
<- 저런 복장의 예, 전형적인 개발자 복장?
선물 주신 칫솔님께 감사의 말씀 드리며
올해는 반드시 칫솔님 블로그 리플 1위를 달성하도록 노력하겠습니다
(응?)
사족 : 전리품 분배 : USB -> 누님 -> 아부지?
enswerme 티셔츠 -> 누님
넥타이 -> 구차니(당분간은 쓸일 없을 예정)
기존에는 RegSetValue를 사용했었는데, 이 녀석은 Key , SubKey에 대해서 만 등록을 할 수 있지,
Value는 등록하지 못하므로 Value를 등록 할 수 있는 RegSetValueEx를 사용하게 되었다.
RegSetValueExW(key1, L"Debugger", 0, REG_SZ, cmd, len * 2);
데이터는 위의 prototype를 보면 알겠지만,
"키,value name, 0, 변수 타입, value, 길이" 의 순서인데 reserved 값으로 0이 고정 되어 있다.
notepad2 프로젝트는 unicode로 되어 있으므로, 이에 대응하기 위해서 RegSetValueExW로 함수를 사용하였는데,
버그인지는 모르겠지만, len 부분에서 2배를 해주어야 만 제대로 value가 들어 가는 문제가 있었다.
2배라고 함은 unicode는 2byte 문자열이므로 이를 맞추어 주기 위해 2배가 된 것 같기는 하지만,
문자열이 unicode인데 길이만 따로 ascii 식으로 세어 준다는 것은 무언가의 문제가 있는 것으로 보인다.
그리고 prototype 상으로는 BYTE 타입의 문자열을 원하므로 Unicode 함수임에도 불구하고 warning을 출력한다.
--------------------Configuration: Notepad2 - Win32 Release--------------------
Compiling...
Notepad2.c
C:\cvsdown\np2src_VC6\src\Notepad2.c(2994) : warning C4133: 'function' : incompatible types - from 'unsigned short [264]' to 'const unsigned char *'
Linking...
; 1=SourceDrive:\pathname of the directory from which the INF file was installed
; 2=c:\WININST0.400
; 3=c:\UNINSTAL.000
; 4=c:\UNINSTAL.000
; 5=inf
; 10=windows
; 11=system (or system32 on Windows NT)
; 12=system\iosubsystem
; 13=command
; 17=inf
; 18=help
; 19=windows
; 20=fonts
; 21=system\viewers
; 22=VMM32
; 23=color
; 24=c: (the Applications folder [ie. Program Files] root)
; 25=windows (MS doc refers to this as the "Shared directory". ?)
; 27=c:
; 28=windows
; 30=c: Root directory of the boot disk (might not be the same directory as dirid24)
; 31=c: (as above?)
; 32=c:\Winboot
; 33=start menu\programs
; 50 System directory (%windir%\system) on NT-based OS (only)
; 51 Spool directory (not used for installing printer drivers)
; 52 Spool drivers directory (not used for installing printer drivers)
; 53 User profile directory
; 54 Directory where ntldr.exe and osloader.exe are located (NT-based systems only)
; 55 Print processors directory (not used for installing printer drivers)
; Value Shell Special Folder
;
; 16406 All Users\Start Menu
; 16407 All Users\Start Menu\Programs
; 16408 All Users\Start Menu\Programs\Startup
; 16409 All Users\Desktop
; 16415 All Users\Favorites
; 16419 All Users\Application Data
; 16422 Program Files
; 16427 Program Files\Common
; 16429 All Users\Templates
; 16430 All Users\Documents
위의 키는 현재 notepad2.inf에서
(아마도) C:\WINDOWS\NOTEPAD.EXE(혹은 C:\WINDOWS\SYSTEM32\NOTEPAD.EXE)를
대체해서 실행하도록 하는 용도로 쓰이고 있다. (도대체 어느 녀석이 어느 녀석이지?)
하지만 원래 용도는, 프로그램 실행중에 죽는 경우에 디버깅을 하기 위한 방법으로 사용하는 것 이라고 한다.
WFP는 Windows2000 부터 지원하고 있으며 C:\WINDOWS\SYSTEM32\dllcache 폴더 그리고 레지스트리와
연관이 되어 있다
WFP 기능의 작동 방법
WFP 기능은 두 가지 메커니즘을 사용하여 시스템 파일을 보호합니다. 첫 번째 메커니즘은 백그라운드에서 실행됩니다. 이 보호
기능은 WFP에 보호된 디렉터리의 파일에 대한 디렉터리 변경 알림이 나타난 후 실행됩니다. WFP에 이 알림이 나타나면 WFP는
어떤 파일이 변경되었는지 확인합니다. 파일이 보호되면 WFP는 카탈로그 파일에서 파일 서명을 찾아 새 파일이 올바른 버전인지
확인합니다. 이 파일이 올바른 버전이 아니면 WFP는 새 파일을 캐시 폴더(파일이 캐시 폴더에 있는 경우) 또는 설치 원본에
있는 파일로 교체합니다. WFP는 다음과 같은 순서로 해당 위치에서 올바른 파일을 검색합니다.
캐시 폴더(기본적으로 %systemroot%\system32\dllcache)
네트워크 설치 경로(네트워크 설치를 사용하여 시스템을 설치한 경우)
Windows CD-ROM(CD-ROM을 사용하여 시스템을 설치한 경우)
WFP가 캐시 폴더에서 파일을 찾거나 설치 원본이 자동으로 발견되면 WFP는 이 파일을 자동으로 교체합니다.