First commit 07/04/1999
This commit is contained in:
commit
fb545e51a6
9
README.md
Normal file
9
README.md
Normal file
@ -0,0 +1,9 @@
|
||||
#Search'n'Replace
|
||||
|
||||
|
||||
*07/04/1999*
|
||||
|
||||
ToDo: wwtcf?
|
||||
|
||||
|
||||

|
164
snr.bpr
Normal file
164
snr.bpr
Normal file
@ -0,0 +1,164 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCB)
|
||||
BCB = $(MAKEDIR)\..
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# IDE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# The following section of the project makefile is managed by the BCB IDE.
|
||||
# It is recommended to use the IDE to change any of the values in this
|
||||
# section.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
VERSION = BCB.03
|
||||
# ---------------------------------------------------------------------------
|
||||
PROJECT = snr.exe
|
||||
OBJFILES = snr.obj
|
||||
RESFILES =
|
||||
RESDEPEN = $(RESFILES)
|
||||
LIBFILES =
|
||||
LIBRARIES =
|
||||
SPARELIBS =
|
||||
PACKAGES =
|
||||
DEFFILE =
|
||||
# ---------------------------------------------------------------------------
|
||||
PATHCPP = .;
|
||||
PATHASM = .;
|
||||
PATHPAS = .;
|
||||
PATHRC = .;
|
||||
DEBUGLIBPATH = $(BCB)\lib\debug
|
||||
RELEASELIBPATH = $(BCB)\lib\release
|
||||
# ---------------------------------------------------------------------------
|
||||
CFLAG1 = -Od -w -r- -k -y -v -vi- -c -tWC
|
||||
CFLAG2 = -I$(BCB)\include -D_NO_VCL
|
||||
CFLAG3 = -Tkh30000
|
||||
PFLAGS = -U$(BCB)\lib;$(DEBUGLIBPATH) -I$(BCB)\include -D_NO_VCL -$Y -$W -$O- -v -JPHN -M
|
||||
RFLAGS = -i$(BCB)\include -D_NO_VCL
|
||||
AFLAGS = /i$(BCB)\include /d_NO_VCL /mx /w2 /zd
|
||||
LFLAGS = -L$(BCB)\lib;$(DEBUGLIBPATH) -ap -Tpe -x -Gn -v
|
||||
IFLAGS =
|
||||
# ---------------------------------------------------------------------------
|
||||
ALLOBJ = c0x32.obj $(OBJFILES)
|
||||
ALLRES = $(RESFILES)
|
||||
ALLLIB = $(LIBFILES) import32.lib cw32mt.lib
|
||||
# ---------------------------------------------------------------------------
|
||||
!ifdef IDEOPTIONS
|
||||
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=3082
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=Executable (Console)
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlRunParameters]
|
||||
Count=4
|
||||
Item0=mode SUSTITUCION < c:\autoexec.bat
|
||||
Item1=gets SUSTITUCION < "L:\Programación (-CBuilder-)\Search'n'Replace\snr.cpp"
|
||||
Item2=gets SUSTITUCION < L:\Programación (-CBuilder-)\Search'n'Replace\snr.cpp
|
||||
Item3=gets SUSTITUCION < snr.cpp
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=
|
||||
|
||||
[Parameters]
|
||||
RunParams=mode SUSTITUCION < c:\autoexec.bat
|
||||
HostApplication=
|
||||
|
||||
!endif
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MAKE SECTION
|
||||
# ---------------------------------------------------------------------------
|
||||
# This section of the project file is not used by the BCB IDE. It is for
|
||||
# the benefit of building from the command-line using the MAKE utility.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.autodepend
|
||||
# ---------------------------------------------------------------------------
|
||||
!if !$d(BCC32)
|
||||
BCC32 = bcc32
|
||||
!endif
|
||||
|
||||
!if !$d(DCC32)
|
||||
DCC32 = dcc32
|
||||
!endif
|
||||
|
||||
!if !$d(TASM32)
|
||||
TASM32 = tasm32
|
||||
!endif
|
||||
|
||||
!if !$d(LINKER)
|
||||
LINKER = ilink32
|
||||
!endif
|
||||
|
||||
!if !$d(BRCC32)
|
||||
BRCC32 = brcc32
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
!if $d(PATHCPP)
|
||||
.PATH.CPP = $(PATHCPP)
|
||||
.PATH.C = $(PATHCPP)
|
||||
!endif
|
||||
|
||||
!if $d(PATHPAS)
|
||||
.PATH.PAS = $(PATHPAS)
|
||||
!endif
|
||||
|
||||
!if $d(PATHASM)
|
||||
.PATH.ASM = $(PATHASM)
|
||||
!endif
|
||||
|
||||
!if $d(PATHRC)
|
||||
.PATH.RC = $(PATHRC)
|
||||
!endif
|
||||
# ---------------------------------------------------------------------------
|
||||
$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE)
|
||||
$(BCB)\BIN\$(LINKER) @&&!
|
||||
$(LFLAGS) +
|
||||
$(ALLOBJ), +
|
||||
$(PROJECT),, +
|
||||
$(ALLLIB), +
|
||||
$(DEFFILE), +
|
||||
$(ALLRES)
|
||||
!
|
||||
# ---------------------------------------------------------------------------
|
||||
.pas.hpp:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.pas.obj:
|
||||
$(BCB)\BIN\$(DCC32) $(PFLAGS) {$< }
|
||||
|
||||
.cpp.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.c.obj:
|
||||
$(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< }
|
||||
|
||||
.asm.obj:
|
||||
$(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@
|
||||
|
||||
.rc.res:
|
||||
$(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $<
|
||||
# ---------------------------------------------------------------------------
|
32
snr.cpp
Normal file
32
snr.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#pragma hdrstop
|
||||
#include <condefs.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma argsused
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char string[500], *ptr;
|
||||
int lengSRC;
|
||||
|
||||
if ( argc < 3 )
|
||||
{
|
||||
puts( "Search'n'Replace v1.0 | José David Guillén\n" );
|
||||
puts( "snr [search] [replace]\n" );
|
||||
} else {
|
||||
lengSRC = strlen( argv[1] );
|
||||
while ( gets( string ) != NULL )
|
||||
{
|
||||
if ( ( ptr = strstr( string, argv[1] ) ) == NULL )
|
||||
{
|
||||
puts( string );
|
||||
} else {
|
||||
ptr[0] = '\0';
|
||||
printf("%s%s%s\n", string, argv[2], ptr + lengSRC );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user